reprocess_sounding_selection¶
- HSTB.kluster.fqpr_convenience.reprocess_sounding_selection(fqpr_inst, new_xyzrph=None, subset_time=None, return_soundings=False, georeference=False, turn_off_dask=True, turn_dask_back_on=False, override_datum=None, override_vertical_reference=None, isolate_head=None, vdatum_directory=None, cast_selection_method='nearest_in_time')¶
Designed to feed a patch test tool. This function will reprocess all the soundings within the given subset time and return the xyz values without writing to disk. If a new xyzrph (dictionary that holds the offsets and mounting angles information) is provided, the reprocessing will use those offsets/angles. Presumably after many iterations, the patch test tool would provide good offsets/angles that make this sounding selection look good and the full dataset can be reprocessed.
Soundings returned as a list of numpy arrays, with xyz plus the timestamp that you can use to figure out which installation parameters entry applies.
I’ve found that you can get up to a 6x speed increase by disabling dask.distributed for small datasets, which is huge for something like this that might require many iterations with small time ranges. I’ve yet to see a way to skip the client/scheduler, so we brute force destroy it for now. This takes a couple seconds, but shouldn’t be a big deal.
- Parameters
fqpr_inst (
Fqpr) – instance of fqpr_generation.Fqpr class containing processed xyz soundingsnew_xyzrph (
Optional[dict]) – keys are translated entries, vals are dicts with timestamps:valuessubset_time (
Optional[list]) –List of utc timestamps in seconds, used as ranges for times that you want to process.
ex: subset_time=[1531317999, 1531321000] means only process times that are from 1531317999 to 1531321000
ex: subset_time=[[1531317999, 1531318885], [1531318886, 1531321000]] means only process times that are
from either 1531317999 to 1531318885 or 1531318886 to 1531321000
return_soundings (
bool) – if True, will compute and return the soundings as wellgeoreference (
bool) – if True, will georeference the soundings, else will return the vessel coordinate system aligned sv corrected offsets (forward, starboard, down)turn_off_dask (
bool) – if True, close the client and destroy it. Just closing doesn’t work, as it retains the scheduler, which will try and find workers that don’t exist when you run a processturn_dask_back_on (
bool) – if True, will restart the client by reloading data if the client does not existoverride_datum (
Optional[str]) – datum identifier if soundings does not exist, will prefer this over the soundings informationoverride_vertical_reference (
Optional[str]) – vertical reference identifier, will prefer this over the soundings informationisolate_head (
Optional[int]) – only used with return_soundings, if provided will only return soundings corresponding to this head index, 0 = port, 1 = starboardvdatum_directory (
Optional[str]) – path to the vdatum directory, required for georeferencing with NOAA MLLW or MHW vertical referencescast_selection_method (
str) – the method used to select the cast that goes with each chunk of the dataset, one of [‘nearest_in_time’, ‘nearest_in_time_four_hours’, ‘nearest_in_distance’, ‘nearest_in_distance_four_hours’]
- Returns
Fqpr – instance or list of instances of fqpr_generation.Fqpr class that contains generated soundings data in the intermediate_data attribute, see Fqpr.intermediate_dat
list – list of numpy arrays, [x (easting in meters), y (northing in meters), z (depth pos down in meters), tstmp (xyzrph timestamp for each sounding)