QA for an Exposures (v1.3)

v1.2 -- Fuss with table() method
v1.3 -- Add coeffs

In [1]:
# imports
from importlib import reload

import time

from desispec.qa import qa_exposure as dqaexp

Load


In [2]:
expid = 23
night = '20200323'
specprod_dir = '/home/xavier/DESI/DESI_SCRATCH/18.11/spectro/redux/mini/'
multi_root = 'mini_qa'

In [15]:
# Load data
reload(dqaexp)
qaexp = dqaexp.QA_Exposure(expid, night, 'science', specprod_dir=specprod_dir, multi_root=multi_root)


INFO:qa.py:220:load_qa_multiexp: Loading QA prod file: /home/xavier/DESI/DESI_SCRATCH/18.11/spectro/redux/mini/QA/mini_qa.json

In [16]:
qaexp.data['frames']['b1']['FLUXCALIB']


Out[16]:
{'METRICS': {'MAX_ZP_OFF': [0.0, 40],
  'NSTARS_FIBER': 10,
  'RMS_ZP': 0.0,
  'ZP': 17.603189791244063},
 'PARAMS': {'MAX_ZP_OFF': 0.2, 'ZP_WAVE': 4800.0}}

Table me


In [17]:
tstart = time.time()
qaexp.s2n_table()
tend = time.time()
tend-tstart


Out[17]:
0.14874505996704102

In [18]:
qaexp.qa_s2n[0:10]


Out[18]:
Table length=10
MEDIAN_SNRFIBERCAMERANIGHTEXPIDCHANNELMAGSRESIDOBJTYPECOEFFS [2]
float64int64str2str8int64str1float64float64str4float64
0.202161573150775320z12020032323z22.721061706542970.08267254502423291ELG0.01 .. 2.1
0.48518682393476851z12020032323z21.7956352233886720.11087270982658509ELG0.01 .. 2.1
0.349234092940033442z12020032323z21.974483489990234-0.05786463842179481ELG0.01 .. 2.1
0.447290271227534063z12020032323z21.6116943359375-0.13477311037700476ELG0.01 .. 2.1
4.1139912332022884z12020032323z18.7459392547607420.0032413979384317768LRG0.01 .. 6.300000000000001
-0.00096079351375273665z12020032323z0.0-999.00.0 .. 0.0
0.292220538447519446z12020032323z22.14106559753418-0.08144893604033841ELG0.01 .. 2.1
2.0405807809388947z12020032323z19.5284538269042970.010381037233789657LRG0.01 .. 6.300000000000001
1.28888122300524538z12020032323z19.8674373626709-0.13075888135649236LRG0.01 .. 6.300000000000001
0.215980837567134549z12020032323z22.7528591156005860.19099090924752737ELG0.01 .. 2.1

In [16]:
qaexp.qa_s2n.meta


Out[16]:
{'AIRMASS': 1.084055919995993,
 'DATE-OBS': '2020-03-24T04:11:21.522',
 'EXPTIME': 1104.473903438055,
 'FLAVOR': 'science',
 'NIGHT': '20200323'}

FluxCalib QA


In [7]:
outfil = 'qa-00000006-flux.pdf'
qaexp.fluxcalib(outfil)


Wrote QA FluxCalib Exposure file: qa-00000006-flux.pdf

In [ ]: