Data Processing
Binning
- profiler.binning.bin_profilerdata(pdata: ProfilerData, pmin: float = 10, pstep: float = 10, pmax: float = 200.0, pd: str = 'd', exclude='bad')[source]
Bins oceanographic data in pressure or depth on the grid [pmin:pstep:pmax].
Parameters:
- pdataprofilerdata.ProfilerData
Object containing oceanographic data with fields like time, lat, lon, etc.
- pminfloat
Minimum pressure/depth value
- pstepfloat
Step size for pressure/depth bins
- pmaxfloat
Maximum pressure/depth value
- pdstr
‘p’ for pressure or ‘d’ for depth binning
- excludestr, optional
‘none’, ‘bad’, or ‘questionable’ to specify which points to exclude
Returns:
bData : ProfilerData object
Key Functions
- profiler.binning.bin_profilerdata(pdata: ProfilerData, pmin: float = 10, pstep: float = 10, pmax: float = 200.0, pd: str = 'd', exclude='bad')[source]
Bins oceanographic data in pressure or depth on the grid [pmin:pstep:pmax].
Parameters:
- pdataprofilerdata.ProfilerData
Object containing oceanographic data with fields like time, lat, lon, etc.
- pminfloat
Minimum pressure/depth value
- pstepfloat
Step size for pressure/depth bins
- pmaxfloat
Maximum pressure/depth value
- pdstr
‘p’ for pressure or ‘d’ for depth binning
- excludestr, optional
‘none’, ‘bad’, or ‘questionable’ to specify which points to exclude
Returns:
bData : ProfilerData object
GSW Processing
Geographic Calculations
Python functions for calculating offsets and distances from a line
- profiler.utils.offsets.calc_dist_offset(lons: ndarray, lats: ndarray, endpoints: tuple, debug: bool = False)[source]
- Calculate the distnace from shore and offset from a line
for a given line
- Parameters:
- Returns:
- dist, offset
dist = distance from the start of the line offset = offset from the line (normal)
- Return type:
- profiler.utils.offsets.jsonify(obj, debug=False)[source]
Recursively process an object so it can be serialised in json format. Taken from linetools.
WARNING - the input object may be modified if it’s a dictionary or list!
- Parameters:
obj (any object)
debug (bool, optional)
- Returns:
obj - the same obj is json_friendly format (arrays turned to
lists, np.int64 converted to int, np.float64 to float, and so on).
- profiler.utils.offsets.savejson(filename: str, obj: dict, overwrite=False, indent=None, easy_to_read=False, **kwargs)[source]
Save a python object to filename using the JSON encoder.
- profiler.utils.offsets.loadjson(filename)[source]
Load a python object saved with savejson.
- Parameters:
filename (str) – The path to the JSON file.
- Returns:
The loaded Python object.
- Return type:
obj
- profiler.utils.offsets.match_ids(IDs, match_IDs, require_in_match=True)[source]
Match input IDs to another array of IDs (usually in a table) Return the rows aligned with input IDs
- Parameters:
IDs (ndarray) – IDs that are to be found in match_IDs
match_IDs (ndarray) – IDs to be searched
require_in_match (bool, optional) – Require that each of the input IDs occurs within the match_IDs
- Returns:
rows – Rows in match_IDs that match to IDs, aligned -1 if there is no match
- Return type:
ndarray
Key Functions
- profiler.utils.offsets.calc_dist_offset(lons: ndarray, lats: ndarray, endpoints: tuple, debug: bool = False)[source]
- Calculate the distnace from shore and offset from a line
for a given line
- Parameters:
- Returns:
- dist, offset
dist = distance from the start of the line offset = offset from the line (normal)
- Return type: