diff --git a/changes/441.feature.rst b/changes/441.feature.rst index 28c11b8d..fd37413b 100644 --- a/changes/441.feature.rst +++ b/changes/441.feature.rst @@ -1 +1 @@ -Added support for skycell reference file \ No newline at end of file +Added support for skycell reference file diff --git a/src/roman_datamodels/maker_utils/_common_meta.py b/src/roman_datamodels/maker_utils/_common_meta.py index 6eb2da2a..55aa4395 100644 --- a/src/roman_datamodels/maker_utils/_common_meta.py +++ b/src/roman_datamodels/maker_utils/_common_meta.py @@ -753,6 +753,7 @@ def mk_ref_readnoise_meta(**kwargs): return meta + def mk_ref_skycells_meta(**kwargs): """ Create dummy metadata for skycells reference file instances. @@ -770,6 +771,7 @@ def mk_ref_skycells_meta(**kwargs): return meta + def mk_mosaic_basic(**kwargs): """ Create a dummy mosaic basic instance with valid values for attributes diff --git a/src/roman_datamodels/maker_utils/_ref_files.py b/src/roman_datamodels/maker_utils/_ref_files.py index d23a49a3..ee528b62 100644 --- a/src/roman_datamodels/maker_utils/_ref_files.py +++ b/src/roman_datamodels/maker_utils/_ref_files.py @@ -14,8 +14,8 @@ mk_ref_epsf_meta, mk_ref_pixelarea_meta, mk_ref_readnoise_meta, - mk_ref_units_dn_meta, mk_ref_skycells_meta, + mk_ref_units_dn_meta, ) __all__ = [ @@ -33,10 +33,10 @@ "mk_pixelarea", "mk_readnoise", "mk_refpix", + "mk_roman_skycells", "mk_saturation", "mk_superbias", "mk_wfi_img_photom", - "mk_roman_skycells", ] OPT_ELEM = ("F062", "F087", "F106", "F129", "F146", "F158", "F184", "F213", "GRISM", "PRISM", "DARK") @@ -566,61 +566,170 @@ def mk_saturation(*, shape=(4096, 4096), filepath=None, **kwargs): return save_node(saturationref, filepath=filepath) + def mk_roman_skycells(*, filepath=None, **kwargs): skycellref = stnode.RomanSkycellsRef() skycellref["meta"] = mk_ref_skycells_meta(**kwargs) - proj_dtype = np.dtype([('index', ' 0: + if repr(tag).find("roman_skycells") > 0: return schema = asdf.schema.load_schema(tag.schema_uris[0]) # Check that schema references common reference schema @@ -614,11 +614,13 @@ def test_make_refpix(): assert refpix.meta.input_units == u.DN assert refpix.meta.output_units == u.DN + # Skycells tests def test_make_roman_skycells(): skycells_ref = utils.mk_roman_skycells() assert skycells_ref.projection_regions["index"][2] == 2 - assert skycells_ref.skycells['dec_corn2'][0] > 88 + assert skycells_ref.skycells["dec_corn2"][0] > 88 + # WFI Photom tests def test_make_wfi_img_photom():