dartobsgen.NNJASource#
- class dartobsgen.NNJASource(catalog_mirror='gcp_nodd', obs_type_map=None)[source]#
Bases:
DataSourceData source backed by the NNJA-AI (NOAA/NASA Joint Archive) cloud catalog.
Uses the
nnja-aiSDK to load ADPSFC (surface) and ADPUPA (upper-air) observations from GCS, then writes DART obs_seq files viapydartdiags.ObsSequence.- Parameters:
catalog_mirror (str) – NNJA catalog GCS mirror.
"gcp_nodd"(default) uses the NOAA Open Data Dissemination mirror;"gcp_brightband"uses the Brightband mirror.obs_type_map (dict or None) – Additional obs-type entries merged on top of
DEFAULT_OBS_TYPE_MAP. Use this to override error variances, swap dataset IDs, or add custom obs types. PassNoneto use defaults only.
Notes
The catalog is opened lazily on first call to
write_obs_seq()so thatNNJASourceinstances can be safely pickled forProcessPoolExecutorworkers.Wind components are derived from NNJA speed + direction columns:
U = −speed × sin(direction_rad) V = −speed × cos(direction_rad)
Radiosonde pressure levels: ADPUPA flat columns are named
{var}_PRLC{n}wherepressure_Pa = int(n) × 10(e.g.TMDB_PRLC5000→ 500 hPa = 50 000 Pa).Methods
__init__([catalog_mirror, obs_type_map])check_coverage(windows)Pre-flight check of windows against the data this source can serve.
write_obs_seq(output_file, analysis_time, ...)Load NNJA obs for the given window, write a DART obs_seq file.
- write_obs_seq(output_file, analysis_time, date0, date1, lat_min, lat_max, lon_min, lon_max, obs_types, obs_type_map)[source]#
Load NNJA obs for the given window, write a DART obs_seq file.
- Parameters:
output_file (str) – Path to write the DART obs_seq file.
analysis_time (datetime) – Cycle time this window is centered on. Unused — observation times come from the archive’s
OBS_TIMESTAMP.date0 (datetime) – Time window
(date0, date1]— open below, closed above.date1 (datetime) – Time window
(date0, date1]— open below, closed above.lat_min (float) – Bounding box for spatial subsetting (degrees).
lat_max (float) – Bounding box for spatial subsetting (degrees).
lon_min (float) – Bounding box for spatial subsetting (degrees).
lon_max (float) – Bounding box for spatial subsetting (degrees).
obs_types (list[str]) – DART obs type names to generate (e.g.
["METAR_TEMPERATURE_2_METER"]).obs_type_map (dict or None) – Per-call overrides merged on top of the source-level map.
- Returns:
Trueif the file was written,Falseif no observations were found for this window.- Return type: