API reference
earthcarekit.read
earthcarekit.read
Reading utilities for EarthCARE product data.
FileAgency
Bases: FileInfoEnum
Source code in earthcarekit/utils/read/product/file_info/agency.py
from_input
classmethod
Infers the EarthCARE product agency (i.e. ESA or JAXA) from a given file or dataset.
Source code in earthcarekit/utils/read/product/file_info/agency.py
FileLatency
Bases: FileInfoEnum
Source code in earthcarekit/utils/read/product/file_info/latency.py
from_input
classmethod
Infers the EarthCARE product latency indicator (i.e. N for Near-real time, O for Offline, X for not applicable) from a given name, file or dataset.
Source code in earthcarekit/utils/read/product/file_info/latency.py
FileType
Bases: FileInfoEnum
Source code in earthcarekit/utils/read/product/file_info/type.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | |
from_input
classmethod
Infers the EarthCARE product type from a given file or dataset.
Source code in earthcarekit/utils/read/product/file_info/type.py
ProductInfo
dataclass
Class storing all info gathered from a EarthCARE product's file path.
Attributes:
| Name | Type | Description |
|---|---|---|
mission_id |
FileMissionID
|
Mission ID (ECA = EarthCARE). |
agency |
FileAgency
|
Agency that generated the file (E = ESA, J = JAXA). |
latency |
FileLatency
|
Latency indicator (X = not applicable, N = near real-time, O = offline). |
baseline |
str
|
Two-letter product/processor version string (e.g., "BA"). |
file_type |
FileType
|
Full product name (10 characters, e.g., "ATL_EBD_2A"). |
start_sensing_time |
Timestamp
|
Start-time of data collection (i.e., time of first available data in the product). |
start_processing_time |
Timestamp
|
Start-time of processing (i.e., time at which creation of the product started). |
orbit_number |
int
|
Number of the orbit. |
frame_id |
str
|
Single letter identifier between A and H, indication the orbit segment (A,B,H = night frames; D,E,F = day frames; C,G = polar day/night frames). |
orbit_and_frame |
str
|
Six-character string with leading zeros combining orbit number and frame ID. |
name |
str
|
Full name of the product without file extension. |
filepath |
str
|
Local file path or empty string if not available. |
hdr_filepath |
str
|
Local header file path or empty string if not available. |
Source code in earthcarekit/utils/read/product/file_info/product_info.py
to_dataframe
add_depol_ratio
add_depol_ratio(
ds_anom,
rolling_w=20,
near_zero_tolerance=2e-07,
smooth=True,
skip_height_above_elevation=300,
cpol_var="mie_attenuated_backscatter",
xpol_var="crosspolar_attenuated_backscatter",
elevation_var=ELEVATION_VAR,
height_var=HEIGHT_VAR,
height_dim=VERTICAL_DIM,
)
Compute depolarization ratio (DPOL = XPOL/CPOL) from attenuated backscatter signals.
This function derives the depol. ratio from cross-polarized (XPOL) and co-polarized (CPOL) attenuated backscatter signals.
Signals below the surface are masked, by default with a vertical margin on 300 meters above elevation to remove potential surface return.
Also, signals are smoothed (or "cleaned") with a rolling mean, and near-zero divisions are suppressed and set to NaN instead.
In the resulting dataset, the ratio curtain and a ratio profile calculated from mean profiles of the full dataset (e.g., mean(XPOL)/mean(CPOL)).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ds_anom
|
Dataset
|
ATL_NOM_1B dataset containing cross- and co-polar attenuated backscatter. |
required |
rolling_w
|
int
|
Window size for rolling mean smoothing. Defaults to 20. |
20
|
near_zero_tolerance
|
float
|
Tolerance for masking near-zero |
2e-07
|
smooth
|
bool
|
Whether to apply rolling mean smoothing. Defaults to True. |
True
|
skip_height_above_elevation
|
int
|
Vertical margin above surface elevation to mask in meters. Defaults to 300. |
300
|
cpol_var
|
str
|
Input co-polar variable name. Defaults to "mie_attenuated_backscatter". |
'mie_attenuated_backscatter'
|
xpol_var
|
str
|
Input cross-polar variable name. Defaults to "crosspolar_attenuated_backscatter". |
'crosspolar_attenuated_backscatter'
|
elevation_var
|
str
|
Elevation variable name. Defaults to ELEVATION_VAR. |
ELEVATION_VAR
|
height_var
|
str
|
Height variable name. Defaults to HEIGHT_VAR. |
HEIGHT_VAR
|
height_dim
|
str
|
Height dimension name. Defaults to VERTICAL_DIM. |
VERTICAL_DIM
|
Returns:
| Type | Description |
|---|---|
Dataset
|
xr.Dataset: Dataset with added depol. ratio, cleaned signals, and depol. ratio profile from mean profiles. |
Source code in earthcarekit/utils/read/product/level1/atl_nom_1b.py
add_isccp_cloud_type
add_isccp_cloud_type(
ds,
new_var="isccp_cloud_type",
cot_var="cloud_optical_thickness",
cth_var="cloud_top_height",
along_track_dim=ALONG_TRACK_DIM,
across_track_dim=ACROSS_TRACK_DIM,
)
Adds a variable to the dataset containing ISCCP cloud types calculated from cloud optical thickness (COT) and cloud top height (CTH).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ds
|
Dataset
|
A MSI_COP_2A dataset. |
required |
new_var
|
str
|
Name of the new ISCCP cloud type variable. Defaults to "isccp_cloud_type". |
'isccp_cloud_type'
|
cot_var
|
str
|
Name of the COT variable in |
'cloud_optical_thickness'
|
cth_var
|
str
|
Name of the CTH variable in |
'cloud_top_height'
|
along_track_dim
|
str
|
Name of the along-track dimension in |
ALONG_TRACK_DIM
|
across_track_dim
|
str
|
Name of the across-track dimension in |
ACROSS_TRACK_DIM
|
Returns:
| Type | Description |
|---|---|
Dataset
|
xr.Dataset: The input dataset with added ISCCP cloud type variable. |
References
- International Satellite Cloud Climatology Project (ISCCP). ISCCP Definition of Cloud Types. Retrieved September 25, 2025. https://isccp.giss.nasa.gov/cloudtypes.html
Source code in earthcarekit/utils/read/product/level2a/msi_cop_2a.py
add_potential_temperature
add_potential_temperature(
ds,
temperature_var="temperature_kelvin",
pressure_var="pressure",
new_var="potential_temperature",
)
Computes potential temperature from temperature [K] and pressure [Pa] and adds it as a variable to the dataset (source: https://en.wikipedia.org/wiki/Potential_temperature, accessed: 2026-02-06).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ds
|
Dataset
|
Dataset (e.g., AUX_MET_1D) containing temperature [K] and pressure [Pa] data. |
required |
temperature_var
|
str
|
Input temperature variable name. Defaults to "temperature_kelvin". |
'temperature_kelvin'
|
pressure_var
|
str
|
Input pressure variable name. Defaults to "pressure". |
'pressure'
|
new_var
|
str
|
New variable name for potential temperature. Defaults to "potential_temperature". |
'potential_temperature'
|
Returns:
| Type | Description |
|---|---|
Dataset
|
xr.Dataset: Dataset with 2 new variables for potential temperature profiles added (kelvin and celsius). |
Source code in earthcarekit/utils/read/product/auxiliary/aux_met_1d.py
add_scattering_ratio
add_scattering_ratio(
ds_anom,
formula,
rolling_w=20,
near_zero_tolerance=2e-07,
smooth=True,
skip_height_above_elevation=300,
cpol_var="mie_attenuated_backscatter",
xpol_var="crosspolar_attenuated_backscatter",
ray_var="rayleigh_attenuated_backscatter",
elevation_var=ELEVATION_VAR,
height_var=HEIGHT_VAR,
height_dim=VERTICAL_DIM,
)
Compute scattering ratio from attenuated backscatter signals given a formula: "x/c", "(c+x)/r", or "(c+x+r)/r".
This function derives the scattering ratio from cross-polarized (XPOL), co-polarized (CPOL) and rayleigh (RAY) attenuated backscatter signals.
Signals below the surface are masked, by default with a vertical margin on 300 meters above elevation to remove potential surface return.
Also, signals are smoothed (or "cleaned") with a rolling mean, and near-zero divisions are suppressed and set to NaN instead.
In the resulting dataset, the ratio curtain and a ratio profile calculated from mean profiles of the full dataset (e.g., mean(XPOL)/mean(CPOL)).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ds_anom
|
Dataset
|
ATL_NOM_1B dataset containing the attenuated backscatter signals. |
required |
formula
|
Literal['x/c', '(c+x)/r', '(c+x+r)/r']
|
Formula used to calculate the scattering ratio. |
required |
rolling_w
|
int
|
Window size for rolling mean smoothing. Defaults to 20. |
20
|
near_zero_tolerance
|
float
|
Tolerance for masking near-zero denominators. Defaults to 2e-7. |
2e-07
|
smooth
|
bool
|
Whether to apply rolling mean smoothing. Defaults to True. |
True
|
skip_height_above_elevation
|
int
|
Vertical margin above surface elevation to mask in meters. Defaults to 300. |
300
|
cpol_var
|
str
|
Input co-polar variable name. Defaults to "mie_attenuated_backscatter". |
'mie_attenuated_backscatter'
|
xpol_var
|
str
|
Input cross-polar variable name. Defaults to "crosspolar_attenuated_backscatter". |
'crosspolar_attenuated_backscatter'
|
ray_var
|
str
|
Input rayleigh variable name. Defaults to "rayleigh_attenuated_backscatter". |
'rayleigh_attenuated_backscatter'
|
elevation_var
|
str
|
Elevation variable name. Defaults to ELEVATION_VAR. |
ELEVATION_VAR
|
height_var
|
str
|
Height variable name. Defaults to HEIGHT_VAR. |
HEIGHT_VAR
|
height_dim
|
str
|
Height dimension name. Defaults to VERTICAL_DIM. |
VERTICAL_DIM
|
Returns:
| Type | Description |
|---|---|
Dataset
|
xr.Dataset: xr.Dataset: Dataset with added ratio curtain and ratio profile from mean profiles. |
Source code in earthcarekit/utils/read/product/level1/atl_nom_1b.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 | |
get_product_info
Gather all info contained in the EarthCARE product's file path.
Source code in earthcarekit/utils/read/product/file_info/product_info.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | |
get_product_infos
Extracts product metadata from EarthCARE product file paths (e.g. file_type, orbit_number, frame_id, baseline, ...).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepaths
|
str | list[str] | NDArray | DataFrame | Dataset
|
Input sources for EarthCARE product files. Can be one of
- |
required |
**kwargs
|
Additional arguments passed to |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ProductDataFrame |
ProductDataFrame
|
A dataframe containing extracted product information. |
Source code in earthcarekit/utils/read/product/file_info/product_info.py
read_any
Reads various input types and returns an xarray.Dataset.
This function can read
- EarthCARE product files (
.h5) - NetCDF files (
.nc) - Manually processed PollyXT output files (
.txt)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
str | Dataset
|
File path or existing Dataset. |
required |
**kwargs
|
Additional keyword arguments for specific readers. |
{}
|
Returns:
| Type | Description |
|---|---|
Dataset
|
xr.Dataset: Opened dataset. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the file type is not supported. |
TypeError
|
If the input type is invalid. |
Source code in earthcarekit/utils/read/_read_any.py
read_header_data
Opens the product header groups of a EarthCARE file as a xarray.Dataset.
Source code in earthcarekit/utils/read/product/header_group.py
read_nc
Returns an xarray.Dataset from a Dataset or NetCDF file path, optionally loaded into memory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
Dataset or str
|
Path to a NetCDF file. If a already opened |
required |
modify
|
bool
|
If True, default modifications to the opened dataset will be applied (e.g., converting heights in Polly data from height a.g.l. to height above mean sea level). |
True
|
in_memory
|
bool
|
If True, ensures the dataset is fully loaded into memory. Defaults to False. |
False
|
**kwargs
|
Key-word arguments passed to |
{}
|
Returns:
| Type | Description |
|---|---|
Dataset
|
xarray.Dataset: The resulting dataset. |
Raises:
| Type | Description |
|---|---|
TypeError
|
If input is not a Dataset or string. |
Source code in earthcarekit/utils/read/_read_nc.py
read_polly
Reads manually processed PollyXT output text files as xarray.Dataset or returns an already open one.
Source code in earthcarekit/utils/read/_read_polly.py
read_product
read_product(
input,
trim_to_frame=True,
modify=DEFAULT_READ_EC_PRODUCT_MODIFY,
header=DEFAULT_READ_EC_PRODUCT_HEADER,
meta=DEFAULT_READ_EC_PRODUCT_META,
ensure_nans=DEFAULT_READ_EC_PRODUCT_ENSURE_NANS,
in_memory=False,
**kwargs
)
Returns an xarray.Dataset from a Dataset or EarthCARE file path, optionally loaded into memory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input
|
str or Dataset
|
Path to a EarthCARE file. If a |
required |
trim_to_frame
|
bool
|
Whether to trim the dataset to latitude frame bounds. Defaults to True. |
True
|
modify
|
bool
|
If True, default modifications to the opened dataset will be applied (e.g., renaming dimension corresponding to height to "vertical"). Defaults to True. |
DEFAULT_READ_EC_PRODUCT_MODIFY
|
header
|
bool
|
If True, all header data will be included in the dataframe. Defaults to False. |
DEFAULT_READ_EC_PRODUCT_HEADER
|
meta
|
bool
|
If True, select meta data from header (like orbit number and frame ID) will be included in the dataframe. Defaults to True. |
DEFAULT_READ_EC_PRODUCT_META
|
ensure_nans
|
bool
|
If True, ensures that _FillValues are set to NaNs even if encoding of _FillValues or dtype is missing. Be aware, if True increases reading time. Defaults to False. |
DEFAULT_READ_EC_PRODUCT_ENSURE_NANS
|
in_memory
|
bool
|
If True, ensures the dataset is fully loaded into memory. Defaults to False. |
False
|
Returns:
| Type | Description |
|---|---|
Dataset
|
xarray.Dataset: The resulting dataset. |
Raises:
| Type | Description |
|---|---|
TypeError
|
If input is not a Dataset or string. |
Source code in earthcarekit/utils/read/product/_generic.py
read_products
read_products(
filepaths,
zoom_at=None,
along_track_dim=ALONG_TRACK_DIM,
func=None,
func_inputs=None,
max_num_files=8,
coarsen=True,
)
Read and concatenate a sequence of EarthCARE frames into a single xarray Dataset.
By default, the dataset is coarsened according to the number of input frames (e.g.,
combining 3 products averages every 3 profiles, so the along-track dimension remains
comparable to a single product). Optionally applies a processing function to each
frame and zooms in on a specific region (defined by zoom_at) without coarsening.
Coarsening can also be turned of but might case memory issues.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepaths
|
Sequence[str] or DataFrame
|
EarthCARE product file paths as a list or a DataFrame with metadata
including |
required |
zoom_at
|
float
|
If set, selects only a zoomed-in portion of the frames around this fractional index. Defaults to None. |
None
|
along_track_dim
|
str
|
Name of the dimension to concatenate along. Defaults to ALONG_TRACK_DIM. |
ALONG_TRACK_DIM
|
func
|
Callable
|
Function to apply to each frame after loading. Defaults to None. |
None
|
func_inputs
|
Sequence[dict]
|
Optional per-frame arguments to pass to |
None
|
max_num_files
|
int
|
Max. number of files that are allowed to be loaded at once.
A |
8
|
coarsen
|
bool
|
If Ture, read data sets are coarened depending on the number given of files. Only aplicable when not zooming. Defaults to Ture. |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
Dataset |
Dataset
|
Concatenated dataset with all frames along |
Source code in earthcarekit/utils/read/product/_concat.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | |
read_science_data
Opens the science data of a EarthCARE file as a xarray.Dataset.
Source code in earthcarekit/utils/read/product/science_group.py
rebin_msi_to_jsg
rebin_msi_to_jsg(
ds_msi,
ds_xjsg,
vars=None,
k=4,
eps=1e-12,
lat_var=SWATH_LAT_VAR,
lon_var=SWATH_LON_VAR,
time_var=TIME_VAR,
along_track_dim=ALONG_TRACK_DIM,
across_track_dim=ACROSS_TRACK_DIM,
lat_var_xjsg=SWATH_LAT_VAR,
lon_var_xjsg=SWATH_LON_VAR,
time_var_xjsg=TIME_VAR,
along_track_dim_xjsg=ALONG_TRACK_DIM,
across_track_dim_xjsg=ACROSS_TRACK_DIM,
)
Rebins variables from an MSI product dataset onto the geo-spacial lat/lon grid given by the related AUX_JSG_1D dataset.
This function interpolates selected variables from ds_msi onto the JSG grid from ds_xjsg
using quick kd-tree nearest-neighbor search with scipy.spatial.cKDTree followed
by averaging the k-nearest points using inverse distance weighting. The resulting dataframe
matches the along- and across-track resolution of ds_xjsg.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ds_msi
|
Dataset | str
|
The source MSI dataset (e.g., MSI_RGR_1C, MSI_COP_2A, ...). |
required |
ds_xjsg
|
Dataset | str
|
The target XJSG dataset. |
required |
vars
|
list[str] | None
|
List of variable names from |
None
|
k
|
int
|
Number of nearest geo-spacial neighbors to include in the kd-tree search. Defaults to 4. |
4
|
eps
|
float
|
Numerical threshold to avoid division by zero in distance calculations during the kd-tree search. Defaults to 1e-12. |
1e-12
|
Returns:
| Type | Description |
|---|---|
Dataset
|
xr.Dataset: The MSI dataset with variables rebinned to the JSG grid. |
Source code in earthcarekit/utils/read/product/_rebin_msi_to_jsg.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | |
rebin_xmet_to_vertical_track
rebin_xmet_to_vertical_track(
ds_xmet,
ds_vert,
vars=None,
k=4,
eps=1e-12,
lat_var=TRACK_LAT_VAR,
lon_var=TRACK_LON_VAR,
time_var=TIME_VAR,
height_var=HEIGHT_VAR,
along_track_dim=ALONG_TRACK_DIM,
height_dim=VERTICAL_DIM,
xmet_lat_var="latitude",
xmet_lon_var="longitude",
xmet_height_var="geometrical_height",
xmet_height_dim="height",
xmet_horizontal_grid_dim="horizontal_grid",
)
Rebins variables from an AUX_MET_1D (XMET) dataset onto the vertical curtain track of given by another dataset (e.g. ATL_EBD_2A).
This function interpolates selected variables from ds_xmet onto a EarthCARE
vertical track given in ds_vert, using quick horizontal kd-tree nearest-neighbor search with scipy.spatial.cKDTree followed
by averaging the k-nearest vertical XMET profiles using inverse distance weighting. The resulting
profiles are then interpolated in the vertical to match the height resolution of ds_vert.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ds_xmet
|
Dataset | str
|
The source XMET dataset from which vertical curtain along track will be interpolated. |
required |
ds_vert
|
Dataset | str
|
The target dataset containing the vertical curtain track. |
required |
vars
|
list[str] | None
|
List of variable names from |
None
|
k
|
int
|
Number of nearest horizontal neighbors to include in the kd-tree search. Defaults to 4. |
4
|
eps
|
float
|
Numerical threshold to avoid division by zero in distance calculations during the kd-tree search. Defaults to 1e-12. |
1e-12
|
lat_var
|
str
|
Name of the latitude variable in |
TRACK_LAT_VAR
|
lon_var
|
str
|
Name of the longitude variable in |
TRACK_LON_VAR
|
time_var
|
str
|
Name of the time variable in |
TIME_VAR
|
height_var
|
str
|
Name of the height variable in |
HEIGHT_VAR
|
along_track_dim
|
str
|
Name of the along-track dimension in |
ALONG_TRACK_DIM
|
height_dim
|
str
|
Name of the vertical or height dimension in |
VERTICAL_DIM
|
xmet_lat_var
|
str
|
Name of the latitude variable in |
'latitude'
|
xmet_lon_var
|
str
|
Name of the longitude variable in |
'longitude'
|
xmet_height_var
|
str
|
Name of the height variable in |
'geometrical_height'
|
xmet_height_dim
|
str
|
Name of the vertical dimension in |
'height'
|
xmet_horizontal_grid_dim
|
str
|
Name of the horizontal grid dimension in |
'horizontal_grid'
|
Returns:
| Type | Description |
|---|---|
Dataset
|
xr.Dataset: A new dataset containing the selected XMET variables interpolated to the grid of the
vertical curtain given in |
Raises:
| Type | Description |
|---|---|
KeyError
|
If any specified variable or coordinate name is not found in |
Source code in earthcarekit/utils/read/product/_rebin_xmet_to_vertical_track.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | |
search_files_by_regex
Recursively searches for files in a directory that match a given regex pattern.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root_dirpath
|
str
|
The root directory to start the search from. |
required |
regex_pattern
|
str
|
A regular expression pattern to match file names against. |
required |
Return
list[str]: A list of absolute file paths that point to files with matching names.
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the root directory does not exist. |
error
|
If the given pattern is not a valid regular expression. |
Source code in earthcarekit/utils/read/search.py
search_product
search_product(
root_dirpath=None,
config=None,
file_type=None,
agency=None,
latency=None,
timestamp=None,
baseline=None,
orbit_and_frame=None,
orbit_number=None,
frame_id=None,
filename=None,
start_time=None,
end_time=None,
mode="exhaustive",
)
Searches for EarthCARE product files matching given metadata filters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root_dirpath
|
str
|
Root directory to search. Defaults to directory given in a configuration file. |
None
|
config
|
str | ECKConfig | None
|
Path to a |
None
|
file_type
|
str | Sequence[str]
|
Product file type(s) to match. |
None
|
agency
|
str | Sequence[str]
|
Producing agency or agencies (e.g. "ESA" or "JAXA"). |
None
|
latency
|
str | Sequence[str]
|
Data latency level(s). |
None
|
timestamp
|
TimestampLike | Sequence
|
Timestamp(s) included in the product's time coverage. |
None
|
baseline
|
str | Sequence[str]
|
Baseline version(s). |
None
|
orbit_and_frame
|
str | Sequence[str]
|
Orbit and frame identifiers. |
None
|
orbit_number
|
int, str, | Sequence
|
Orbit number(s). |
None
|
frame_id
|
str | Sequence[str]
|
Frame identifier(s). |
None
|
filename
|
str | Sequence[str]
|
Specific filename(s) or regular expression patterns to match. |
None
|
start_time
|
TimestampLike
|
First timestamp included in the product's time coverage. |
None
|
end_time
|
TimestampLike
|
Last timestamp included in the product's time coverage. |
None
|
mode
|
Literal['exhaustive', 'fast']
|
Search strategy controlling completeness vs performance; the "exhaustive" mode
recursivly scans all files under the |
'exhaustive'
|
Returns:
| Name | Type | Description |
|---|---|---|
ProductDataFrame |
ProductDataFrame
|
Filtered list of matching product files as a |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If root directory does not exist. |
Source code in earthcarekit/utils/read/product/_search.py
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 | |
trim_to_latitude_frame_bounds
trim_to_latitude_frame_bounds(
ds,
along_track_dim=ALONG_TRACK_DIM,
lat_var=TRACK_LAT_VAR,
frame_id=None,
add_trim_index_offset_var=True,
trim_index_offset_var="trim_index_offset",
)
Trims the dataset to the region within the latitude frame bounds.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ds
|
Dataset
|
Input dataset to be trimmed. |
required |
along_track_dim
|
str
|
Dimension along which to trim. Defaults to ALONG_TRACK_DIM. |
ALONG_TRACK_DIM
|
lat_var
|
str
|
Name of the latitude variable. Defaults to TRACK_LAT_VAR. |
TRACK_LAT_VAR
|
frame_id
|
str | None
|
EarthCARE frame ID (single character between "A" and "H"). If given, speeds up trimming. Defaults to None. |
None
|
add_trim_index_offset_var
|
bool
|
Whether the index offset between the original and trimmed dataset is stored in the trimmed dataset (variable: "trim_index_offset"). Defaults to True. |
True
|
Returns:
| Type | Description |
|---|---|
Dataset
|
xarray.Dataset: Trimmed dataset. |