def test_fgs_pointing(): model = make_level1b() stp.update_wcs(model, siaf_path=siaf_db) assert model.meta.wcsinfo.pc1_1 == -0.9997617223891989 assert model.meta.wcsinfo.pc1_2 == -0.02182884434372137 assert model.meta.wcsinfo.pc2_1 == -0.02182884434372137 assert model.meta.wcsinfo.pc2_2 == 0.9997617223891989
def test_fgs_pointing(): model = make_level1b() stp.update_wcs(model, siaf_path=siaf_db) assert isclose(model.meta.wcsinfo.pc1_1, -0.9997617158628777, atol=1e-15) assert isclose(model.meta.wcsinfo.pc1_2, -0.021829143247382235, atol=1e-15) assert isclose(model.meta.wcsinfo.pc2_1, -0.021829143247382235, atol=1e-15) assert isclose(model.meta.wcsinfo.pc2_2, 0.9997617158628777, atol=1e-15)
def test_tsgrism_siaf_values(eng_db_ngas, data_file_nosiaf): """ Test that FITS WCS default values were set. """ with datamodels.Level1bModel(data_file_nosiaf) as model: model.meta.exposure.start_time = STARTTIME.mjd model.meta.exposure.end_time = ENDTIME.mjd model.meta.aperture.name = "NRCA5_GRISM256_F444W" model.meta.observation.date = '1/1/2017' model.meta.exposure.type = "NRC_TSGRISM" model.meta.visit.tsovisit = True stp.update_wcs(model, siaf_path=siaf_db) assert model.meta.wcsinfo.siaf_xref_sci == 887 assert model.meta.wcsinfo.siaf_yref_sci == 35
def test_default_siaf_values(eng_db_ngas, data_file_nosiaf): """ Test that FITS WCS default values were set. """ with datamodels.Level1bModel(data_file_nosiaf) as model: model.meta.exposure.start_time = STARTTIME.mjd model.meta.exposure.end_time = ENDTIME.mjd model.meta.target.ra = TARG_RA model.meta.target.dec = TARG_DEC model.meta.aperture.name = "MIRIM_TAFULL" model.meta.observation.date = '1/1/2017' model.meta.exposure.type = "MIR_IMAGE" stp.update_wcs(model, siaf_path=siaf_db, allow_default=False) assert model.meta.wcsinfo.crpix1 == 0 assert model.meta.wcsinfo.crpix2 == 0 assert model.meta.wcsinfo.cdelt1 == 1 assert model.meta.wcsinfo.cdelt2 == 1
def test_default_siaf_values(eng_db_ngas, data_file_nosiaf): """ Test that FITS WCS default values were set. """ with datamodels.Level1bModel(data_file_nosiaf) as model: model.meta.exposure.start_time = STARTTIME.mjd model.meta.exposure.end_time = ENDTIME.mjd model.meta.target.ra = TARG_RA model.meta.target.dec = TARG_DEC model.meta.aperture.name = "MIRIM_TAFULL" model.meta.observation.date = '2017-01-01' model.meta.exposure.type = "MIR_IMAGE" stp.update_wcs(model, siaf_path=siaf_path, allow_default=False, engdb_url='http://localhost') assert model.meta.wcsinfo.crpix1 == 24.5 assert model.meta.wcsinfo.crpix2 == 24.5 assert model.meta.wcsinfo.cdelt1 == 3.067124166666667e-05 assert model.meta.wcsinfo.cdelt2 == 3.090061944444444e-05