hypso.io.naming#
Product file names.
Current style, NASA OB.DAAC-like - satellite and instrument first, then time, so a plain listing groups by satellite and sorts by time:
{SAT}_{INSTRUMENT}.{YYYYMMDDTHHMMSS}.{target}.{LEVEL}[.{QUANTITY|GROUP}.{source}][.{grid}][.{label}].nc
HYPSO2_HSI.20250612T095802.aeronetvenice.L1A.nc
HYPSO2_HSI.20250612T095802.aeronetvenice.L1C.nc
HYPSO2_HSI.20250612T095802.aeronetvenice.L2A.RRS.polymer.nc
HYPSO2_HSI.20250612T095802.aeronetvenice.L2A.RHOS.machi.nc
HYPSO2_HSI.20250612T095802.aeronetvenice.L2B.BGC.oc4.nc
HYPSO2_HSI.20250612T095802.aeronetvenice.L1C.adjusted.nc (label: experiments)
HYPSO2_HSI.20250612T095802.aeronetvenice.L2A.RRS.polymer.utm33n_880m.nc (regridded)
The first field is the satellite and the instrument, like NASA’s
{MISSION}_{INSTRUMENT} (PACE_OCI): HYPSO2_HSI is HYPSO-2’s
Hyperspectral Imager, the instrument every product so far comes from
(INSTRUMENTS lists the known ones). . separates fields and never
appears inside one. L2A always carries the quantity (QUANTITIES:
RRS remote-sensing reflectance, RHOS surface reflectance; AUX the
AC tool’s other per-band outputs, AUX_QUANTITY) and the AC
method, which produced it; L2B (products derived from an L2A) always carries
its product group (L2B_GROUPS, e.g. BGC) and the source (the
algorithm or AC tool) in the same two fields; a regridded product carries its grid (hypso.grid.grid_name:
utm<zone><n|s> or epsg<code>, then the pixel size, e.g. utm33n_880m,
epsg4326_0p01deg); the optional free-text label is always last and may
not look like a grid. Calibration set and
masking state are not part of the name - they are recorded in the file.
Times are UTC.
Legacy names ({target}_{YYYY-MM-DDTHH-MM-SSZ}[-{label}]-{level}[-{ac}].nc, where label mixed calibration set and masking, e.g. “moved_unmasked”) are still parsed (the ground segment’s L1A files use them); a legacy name’s level is the old one, with L1C for georeferenced radiance and L1D for reflectance. Capture directories keep the capture ID form {target}_{YYYY-MM-DDTHH-MM-SSZ}.
Classes#
A parsed or composed product file name; |
Functions#
|
The AC field of an L2A name: the method, without ACOLITE's output |
|
|
|
Parse a current-style or legacy product file name. |
|
The satellite-and-instrument field: |
|
Compose a product name. |
|
The L2A quantity token of a product variable: |
Module Contents#
- class hypso.io.naming.ProductName[source]#
A parsed or composed product file name;
filename()renders it.Build one with
product_name(), or parse a file name withparse_product_name().- filename()[source]#
Current-style file name. Requires sat_id (a legacy name doesn’t carry one - use replace(name, sat_id=…)).
- Return type:
- hypso.io.naming.name_method(ac)[source]#
The AC field of an L2A name: the method, without ACOLITE’s output suffix (the quantity field says L2R or L2W):
"acolite_l2w"->"acolite".
- hypso.io.naming.parse_platform_token(token)[source]#
"HYPSO2_HSI"->("HYPSO-2", "HSI"): satellite and instrument.
- hypso.io.naming.parse_product_name(path)[source]#
Parse a current-style or legacy product file name.
- Parameters:
path (str or pathlib.Path) – A file name or path; only the name is used.
- Return type:
- Raises:
ValueError – If the name is not a HYPSO product name.
- hypso.io.naming.platform_token(sat_id, instrument='HSI')[source]#
The satellite-and-instrument field:
("HYPSO-2", "HSI")->"HYPSO2_HSI".
- hypso.io.naming.product_name(sat_id, time, target, level, ac=None, label=None, grid=None, instrument='HSI', quantity=None)[source]#
Compose a product name.
- Parameters:
sat_id (str) – e.g.
"HYPSO-2".time (datetime.datetime) – Capture start; converted to UTC if timezone-aware.
target (str) – Capture target, e.g.
"aeronetvenice".level (str) –
"L1A"…"L1C","L2A".ac (str, optional) – Atmospheric correction method (L2A) or source (L2B: algorithm or tool); required there, not allowed otherwise.
label (str, optional) – Free-text label for experiments (letters, digits,
_,-).grid (str, optional) – Grid name of a regridded product (
hypso.grid.grid_name()).instrument (str, default "HSI") – Instrument token (
INSTRUMENTS).quantity (str, optional) – L2A quantity token (
QUANTITIES, e.g."RRS", or the product variable"Rrs") or L2B group (L2B_GROUPS, e.g."BGC"); required for L2A and L2B.
- Returns:
product_name(...).filename()gives the file name.- Return type: