Environmental Data¶
Functions to help integrate environmental data processing. Includes kadlu integration.
- range_driver.data_prep.environment.add_custom_env_data(axes_to_interpolate, variable_file_map, detection_df)[source]¶
Loads the specified custom environmental data. The loaded data is interpolated across space (2D or 3D) and time before being merged into a new version of detection_df.
- Parameters
axes_to_interpolate (list) – List of axes to interpolate over. The axes correspond to (1) latitude, (2) longitude, (3) time, and (4) depth. The axes must be provided in this order. The first 3 axes are mandatory, depth is optional.
variable_file_map (sklearn.utils.Bunch) – A bunch dictionary specifying which files should be used to load environmental data. Keys are the names of variables to load while values are the paths to the files containing the data.
detection_df (pandas.DataFrame) – Dataframe containing detection data.
- Returns
A copy of detection_df where the interpolated custom environment data has been added.
- Return type
pandas.DataFrame
- range_driver.data_prep.environment.add_kadlu_env_data(bounds, sources, detection_df)[source]¶
Fetches the requested environmental data for the given region & time. The data is interpolated across space (2D or 3D) and time before being merged into a new version of detection_df.
- Parameters
bounds (dict) – Dictionary containing the boundaries (space & time) which will be used to fetch data from kadlu. Must include north, south, east, west, start, end, top, and bottom.
sources (dict.) – Dictionary containing a variable -> source mapping.
detection_df (pandas.DataFrame) – Dataframe containing detection data.
- Returns
detection_df_env (pandas.DataFrame) - A copy of detection_df where interpolated environment data has been added.
kadlu_result (numpy.array) - The raw result from kadlu (not interpolated)