komanawa.nz_depth_to_water.get_data#

created matt_dumont on: 11/30/24

Functions#

copy_geotifs(outdir)

copy the geotifs of distance to nearest [1|10] points and number of points within [1|5|10|20] km to the outdir.

export_dtw_to_csv(outdir[, source, ...])

Export the depth to water data to csv files.

get_distance_to_nearest(npoints) → (numpy.ndarray, ...)

Get the distance to the nearest [1|10] points for each point in the model grid.

get_metadata_string(→ str)

Get the metadata string for a key.

get_metdata_keys(→ list)

Get the metadata keys for the depth to water data for New Zealand.

get_nc_dataset(→ pathlib.Path)

Get the netcdf dataset for the depth to water data for New Zealand.

get_npoint_in_radius(distlim) → (numpy.ndarray, ...)

Get the number of points within [1000 | 5000 | 10,000 | 20,000] m of each point in the model grid.

get_nz_depth_to_water([source, convert_wl_dtw_flag, ...])

Get the depth to water data for New Zealand.

get_water_level_keys(→ list)

Get the water level keys for the depth to water data for New Zealand.

nz_depth_to_water_dump(→ str)

Get the metadata string for the depth to water data for New Zealand. equivalent to ncDump

Module Contents#

copy_geotifs(outdir)[source]#

copy the geotifs of distance to nearest [1|10] points and number of points within [1|5|10|20] km to the outdir.

Parameters:

outdir – directory to copy the geotifs to.

Returns:

export_dtw_to_csv(outdir, source=None, convert_wl_dtw_flag=False, wl_water_elev_flag=False)[source]#

Export the depth to water data to csv files.

Parameters:
  • outdir – str, the directory to save the csv files to.

  • source – None (get all data), str (get data from a specific source) see get_nz_depth_to_water for acceptable sources.

Returns:

get_distance_to_nearest(npoints)[source]#

Get the distance to the nearest [1|10] points for each point in the model grid.

Parameters:

npoints – int, the number of points to consider.

Returns:

distance(m), mx, my (np.ndarray, np.ndarray, np.ndarray) gridded output

get_metadata_string(key) str[source]#

Get the metadata string for a key.

Parameters:

key – str, the key to get the metadata string for. or None (dataset metadata)

Returns:

str, the metadata string.

get_metdata_keys() list[source]#

Get the metadata keys for the depth to water data for New Zealand.

Returns:

list, the metadata keys.

get_nc_dataset(to_path=None, rewrite=False) pathlib.Path[source]#

Get the netcdf dataset for the depth to water data for New Zealand.

Parameters:

to_path – str, optional, the path to save the dataset to. if None then saves to temp directory and returns the dataset path. This behavior prevents overwriting the original data.

Returns:

nc.Dataset

get_npoint_in_radius(distlim)[source]#

Get the number of points within [1000 | 5000 | 10,000 | 20,000] m of each point in the model grid.

Parameters:

distlim – int, the distance limit in meters.

Returns:

ndatapoints, mx, my (np.ndarray, np.ndarray, np.ndarray) gridded output

get_nz_depth_to_water(source=None, convert_wl_dtw_flag=False, wl_water_elev_flag=False, ncdataset_path=None)[source]#

Get the depth to water data for New Zealand.

acceptable_sources = (None, ‘auk’, ‘bop’, ‘gdc’, ‘hbrc’, ‘hrc’, ‘mdc’, ‘nrc’, ‘ncc’, ‘orc’, ‘src’, ‘trc’, ‘tdc’, ‘wc’, ‘gwrc’, ‘wcrc’, ‘nzgd’, ‘ecan’)

Parameters:
  • source – None (get all data), str (get data from a specific source)

  • convert_wl_dtw_flag – bool, if True then convert the wl_dtw_flag to a string.

  • wl_water_elev_flag – bool, if True then convert the wl_water_elev_flag to a string.

  • ncdataset_path – str, optional, the path to the netcdf dataset to use. if None then uses the default path stored in the repo. This provides a mechanism to access a higher precision dataset, which is available on request (it is too large to host in the github repo).

Returns:

metadata: pd.DataFrame, water_level_data: pd.DataFrame

get_water_level_keys() list[source]#

Get the water level keys for the depth to water data for New Zealand.

Returns:

list, the water level keys.

nz_depth_to_water_dump() str[source]#

Get the metadata string for the depth to water data for New Zealand. equivalent to ncDump

Returns:

str, the metadata string.