@@ -448,9 +448,33 @@ def mk_source_catalog(*, filepath=None, **kwargs):
448
448
roman_datamodels.stnode.SourceCatalog
449
449
"""
450
450
source_catalog = stnode .SourceCatalog ()
451
- # There currently is no meta attribute for SourceCatalog
452
- # This is likely to change once metadata has been added
453
- # source_catalog["meta"] = kwargs.get("meta", {})
451
+
454
452
source_catalog ["source_catalog" ] = kwargs .get ("source_catalog" , Table ([range (3 ), range (3 )], names = ["a" , "b" ]))
453
+ source_catalog ["meta" ] = mk_common_meta ()
454
+ source_catalog ["meta" ].update (kwargs .get ("meta" , dict (segmentation_map = '' )))
455
455
456
456
return save_node (source_catalog , filepath = filepath )
457
+
458
+
459
+ def mk_segmentation_map (* , filepath = None , shape = (4096 , 4096 ), ** kwargs ):
460
+ """
461
+ Create a dummy Segmentation Map (or file) with arrays and valid values
462
+ for attributes required by the schema.
463
+
464
+ Parameters
465
+ ----------
466
+ filepath
467
+ (optional, keyword-only) File name and path to write model to.
468
+
469
+ Returns
470
+ -------
471
+ roman_datamodels.stnode.SegmentationMap
472
+ """
473
+ segmentation_map = stnode .SegmentationMap ()
474
+
475
+ segmentation_map ["data" ] = kwargs .get ("data" , np .zeros (shape , dtype = np .uint32 ))
476
+ segmentation_map ["meta" ] = mk_common_meta ()
477
+ segmentation_map ["meta" ].update (kwargs .get ("meta" , dict (filename = '' )))
478
+
479
+ return save_node (segmentation_map , filepath = filepath )
480
+
0 commit comments