panache.utils#
Functions
|
Align bathymetric data to the resolution of the input dataset. |
|
|
|
|
|
Define region-specific parameters based on the selected zone. |
|
Create a DataFrame from the Cartesian product of input arrays. |
Efficiently extract all DataFrames from a nested dictionary using an iterative approach. |
|
|
|
|
Flatten a nested list into a single list. |
|
|
|
|
|
Resolve named search strategy presets into relative pixel directions. |
|
- panache.utils.align_bathymetry(dataset, path_to_bathy_data)[source]#
Align bathymetric data to the resolution of the input dataset.
- Parameters:
dataset (xarray.DataArray) – The input dataset to which the bathymetry should be aligned.
parameters (dict) – Configuration parameters for plume detection.
path_to_bathy_data (str) – Path to the raw bathymetric map of the Zone (e.g. f’{work_dir}/RESULTS/{Zone}/Bathy_data.pkl’).
- Returns:
The bathymetric data aligned to the input dataset’s resolution.
- Return type:
xarray.DataArray
- panache.utils.define_parameters(Zone)[source]#
Define region-specific parameters based on the selected zone.
- Parameters:
Zone (str) – Name of the geographic zone (e.g., “BAY_OF_SEINE”, “BAY_OF_BISCAY”).
- Returns:
A dictionary containing the parameters for the specified zone.
- Return type:
dict
- panache.utils.expand_grid(**kwargs)[source]#
Create a DataFrame from the Cartesian product of input arrays.
- Parameters:
**kwargs (dict) – Keyword arguments where keys are column names and values are arrays.
- Returns:
DataFrame representing the Cartesian product of input arrays.
- Return type:
pandas.DataFrame
- panache.utils.extract_dataframes_iterative(data)[source]#
Efficiently extract all DataFrames from a nested dictionary using an iterative approach.
- panache.utils.flatten_a_list(lst)[source]#
Flatten a nested list into a single list.
- Parameters:
lst (list) – A potentially nested list of elements.
- Returns:
A flattened list containing all elements from the nested list.
- Return type:
list
- panache.utils.load_bathymetric_data(path_to_bathy_data, min_lon, max_lon, min_lat, max_lat)[source]#
- panache.utils.resolve_preset_directions(searching_strategies)[source]#
Resolve named search strategy presets into relative pixel directions.
- Parameters:
searching_strategies (Mapping[str, str]) – A mapping from plume name to one of the available preset names.
- Returns:
A dictionary where each plume name maps to the relative pixel directions used by the plume algorithm.
- Return type:
dict