libera_utils.scene_identification.scene_id.add_placeholder_quality_flag#

libera_utils.scene_identification.scene_id.add_placeholder_quality_flag(product: Dataset, dimensions: str | Sequence[str] = 'RADIOMETER_TIME') → Dataset#

Add the SCENE-ID Quality_Flag variable as an all-zero placeholder.

The SCENE-ID product definitions (e.g. scene_id_cam.yml) declare a per-footprint Quality_Flag bit-flag variable. Per-footprint quality flagging is not implemented yet, so this fills every footprint with 0 (“no flags set”) so the product still conforms to its definition. The variable is added over the product’s record grid, so the input must already carry those dimensions.

Parameters:
  • product (xr.Dataset) – A per-footprint product dataset to add the flag to.

  • dimensions (str or sequence of str, optional) – Name(s) of the record grid dimension(s) to add the flag over. Defaults to RADIOMETER_TIME (the radiometer-timescale products, whose records are 1-D); the camera-timescale product passes the 2-D grid ("CAMERA_TIME", "PSEUDOFOOTPRINT") so the flag spans one entry per (image, subsection).

Returns:

The same dataset with a Quality_Flag variable added (or overwritten).

Return type:

xr.Dataset

Notes

The placeholder is emitted as uint32 to match the Quality_Flag dtype in the product definition; the NetCDF writer’s conformance step will re-cast if the definition ever changes.