hypso.processing.l2b#
L2A to L2B: geophysical products in their own files.
An L2B product holds products derived from one L2A product, one group per
file (hypso.io.naming.L2B_GROUPS), as PACE OCI’s suites: BGC
holds chlorophyll-a and suspended matter, IOP absorption, scattering,
backscattering and Kd. Like PACE’s OC_AOP suite, the L2A keeps Rrs and the
AC tool’s aerosol optical depth. An L2B file has 2D variables only, no band cube; per-wavelength quantities are separate
variables (aph_443, bbp_443), as in NASA’s OC_IOP files. It keeps
the L2A’s geometry, pixel_flags, grid and metadata, so it can be
regridded, windowed and read by Satpy like any other level. File names:
...L2B.<GROUP>.<source>.nc, where the source is the algorithm (e.g.
oc4) or the AC tool whose own product it is (e.g. polymer). An
OC-SMART run thus writes L2A.RRS (Rrs, aod), L2B.BGC, L2B.IOP
and L2A.AUX.
The AC tool’s other per-band outputs (OC-SMART’s Lt, Lr, Lrc, Lwp, tg_sol,
tg_sen, …) go to another file next to the L2A, ...L2A.AUX.<method>.nc
(split_intermediates()), built the same way: 2D variables only, one per
quantity and band (Lt_434), with the L2A’s geometry and flags.
Functions#
|
An L2B tree from one of the package's algorithms on an L2A. |
|
An L2B tree from an L2A tree and the derived variables. |
|
Separate an L2A's AC-tool intermediates (its other per-band outputs). |
|
Separate an L2A's AC-tool products from its reflectance. |
|
The L2B group of an AC tool's variable (e.g. |
Module Contents#
- hypso.processing.l2b.derive(tree, group, algorithm=None)[source]#
An L2B tree from one of the package’s algorithms on an L2A.
- Parameters:
tree (xarray.DataTree) – An L2A tree; most algorithms need
Rrs(L2A.RRS.*).group (str) – L2B group,
"BGC"or"IOP".algorithm (str, optional) – See
hypso.processing.l2b_algorithms.ALGORITHMS; default the group’s default (BGC:"oci", IOP:"qaa").
- Returns:
...L2B.<group>.<algorithm>.- Return type:
- hypso.processing.l2b.make_l2b(tree, group, source, variables, parameters=None)[source]#
An L2B tree from an L2A tree and the derived variables.
- Parameters:
tree (xarray.DataTree) – The L2A product the variables were derived from.
group (str) – Product group, a key of
hypso.io.naming.L2B_GROUPS.source (str) – Algorithm or tool, e.g.
"oc4"or"polymer"(a file-name token).variables (dict) –
{name: xarray.DataArray or (array, attrs)}, each of the product’s spatial shape; attributes should includeunitsandlong_name.parameters (dict, optional) – Recorded in the
l2b_<group>_<source>provenance step.
- Return type:
- hypso.processing.l2b.split_intermediates(tree)[source]#
Separate an L2A’s AC-tool intermediates (its other per-band outputs).
- Parameters:
tree (xarray.DataTree) – An L2A tree from
hypso.processing.correct_atmosphere(); the intermediates are itshypso.io.product.INTERMEDIATES_NODEchild (2D variables such asLt_434).- Returns:
(l2a_tree, aux_tree or None): the L2A without the intermediates, and an L2A.AUX tree (l2a_quantityAUX, no cube) holding them with the L2A’s geometry, flags and metadata, or None when there are none.- Return type:
- hypso.processing.l2b.split_tool_products(tree)[source]#
Separate an L2A’s AC-tool products from its reflectance.
- Parameters:
tree (xarray.DataTree) – An L2A tree, e.g. from
hypso.processing.correct_atmosphere()or an L2A file written before the products moved to L2B.- Returns:
(l2a_tree, {group: l2b_tree}): the L2A without the products, and one L2B tree per group (hypso.io.naming.L2B_GROUPS), named after the AC tool (L2B.BGC.polymer). The tool’s flag variables are kept in the L2A and copied into each L2B.- Return type: