def _write_qaframes(self): """Write QA data frame files""" frm0 = self._make_frame() frm1 = self._make_frame(camera='b1') qafrm0 = QA_Frame(frm0) qafrm1 = QA_Frame(frm1) # SKY qafrm0.init_skysub() qafrm1.init_skysub() qafrm0.qa_data['SKYSUB']['METRICS'] = {} qafrm1.qa_data['SKYSUB']['METRICS'] = {} qafrm0.qa_data['SKYSUB']['METRICS']['NSKY_FIB'] = 10 qafrm1.qa_data['SKYSUB']['METRICS']['NSKY_FIB'] = 30 # FLUX qafrm0.init_fluxcalib() qafrm1.init_fluxcalib() qafrm0.qa_data['FLUXCALIB']['METRICS'] = {} qafrm0.qa_data['FLUXCALIB']['METRICS']['ZP'] = 24. qafrm0.qa_data['FLUXCALIB']['METRICS']['RMS_ZP'] = 0.05 qafrm1.qa_data['FLUXCALIB']['METRICS'] = {} qafrm1.qa_data['FLUXCALIB']['METRICS']['ZP'] = 24.5 qafrm1.qa_data['FLUXCALIB']['METRICS']['RMS_ZP'] = 0.05 # WRITE write_qa_frame(self.qafile_b0, qafrm0) write_qa_frame(self.qafile_b1, qafrm1)
def _write_qaframe(self, camera='b0', expid=1, night='20160101', ZPval=24., flavor='science'): """Write QA data frame files""" frm = self._make_frame(camera=camera, expid=expid, night=night, flavor=flavor) qafrm = QA_Frame(frm) # SKY qafrm.init_skysub() qafrm.qa_data['SKYSUB']['METRICS'] = {} qafrm.qa_data['SKYSUB']['METRICS']['NSKY_FIB'] = 10 # FLUX qafrm.init_fluxcalib() qafrm.qa_data['FLUXCALIB']['METRICS'] = {} qafrm.qa_data['FLUXCALIB']['METRICS']['ZP'] = ZPval qafrm.qa_data['FLUXCALIB']['METRICS']['RMS_ZP'] = 0.05 # Outfile qafile = findfile('qa_data', night=night, expid=expid, specprod_dir=self.testDir, camera=camera) # WRITE write_qa_frame(qafile, qafrm) self.files_written.append(qafile) # Generate frame too (for QA_Exposure) frame = self._make_frame(camera=camera, flavor=flavor, night=night, expid=expid) frame_file = findfile('frame', night=night, expid=expid, specprod_dir=self.testDir, camera=camera) _ = write_frame(frame_file, frame) self.files_written.append(frame_file) # return qafile
def _write_qaframe(self, camera='b0', expid=1, night='20160101', ZPval=24.): """Write QA data frame files""" frm = self._make_frame(camera=camera) qafrm = QA_Frame(frm) # SKY qafrm.init_skysub() qafrm.qa_data['SKYSUB']['METRICS'] = {} qafrm.qa_data['SKYSUB']['METRICS']['NSKY_FIB'] = 10 # FLUX qafrm.init_fluxcalib() qafrm.qa_data['FLUXCALIB']['METRICS'] = {} qafrm.qa_data['FLUXCALIB']['METRICS']['ZP'] = ZPval qafrm.qa_data['FLUXCALIB']['METRICS']['RMS_ZP'] = 0.05 # Outfile qafile = findfile('qa_data', night=night, expid=expid, specprod_dir=self.testDir, camera=camera) # WRITE write_qa_frame(qafile, qafrm) self.files_written.append(qafile) return qafile
def test_init_qa_skysub(self): #- Init SkySub dict qafrm = QA_Frame(self._make_frame(flavor='science')) qafrm.init_skysub() assert qafrm.qa_data['SKYSUB']['PARAMS']['PCHI_RESID'] > 0. #- ReInit SkySub dict qafrm.init_skysub(re_init=True) assert qafrm.qa_data['SKYSUB']['PARAMS']['PCHI_RESID'] > 0.