Utilities API Reference
This section documents the utility functions available in canyonbpy.
Some functions are not fully implemented in the current release. Please consult the log history of the version provided on pip.
canyonbpy.utils
adjust_arctic_latitude(lat, lon)
Adjust latitude for Arctic basin calculations.
Args: lat: Latitudes to be adjusted lon: Corresponding longitudes
Returns: np.ndarray: Ajusted latitudes
Source code in canyonbpy/utils.py
calculate_decimal_year(gtime)
Convert datetime to decimal year. If gtime is already a float, return it as it is, assuming it is in decimal year.
Args: gtime: Time to convert to decimal year
Returns: np.ndarray: Time converted in decimal year
Source code in canyonbpy/utils.py
calculate_pco2_corrections(ct_pred, temp, psal)
create_output_array(data, coords)
load_weight_file(weights_dir, param_name)
Load neural network weights from file.
Args: weights_dir: Optional custom directory path for weights. If None, uses package's data directory param_name: Name of the parameter whose weights to load
Returns: np.ndarray: Loaded weights