SoundSpeedProfile¶
- class HSTB.kluster.modules.svcorrect.SoundSpeedProfile(raw_profile, z_val, ss_sound_speed, prof_name=None, prof_time=None, prof_location=None, prof_type='raw_ping')¶
Bases:
objectDEPRECATED - See run_ray_trace_v2. This was my old way of raytracing beams by building these static lookuptables for every beam from 0 to 90deg at 0.02deg increments. I thought this would be a faster way of doing it. But the more variation in surface sv you have, the more tables you need, so it explodes the user memory.
Take in a processed sound velocity profile, and generate ray traced offsets using surface sound speed, beam angles beam azimuths and two way travel time.
Will read from input data and generate profile dict for looking up soundspeed at depth, as well as other cast metadata
Methods Summary
self.profile contains the sound velocity data as seen by the profiler.
generate_lookup_table([max_pointing_angle, ...])Compute a lookup table for all possible launch angles to get acrosstrack/alongtrack distance and travel time.
interpolate_extended_casts([...])Take max distance parameter, interpolate layers with depth differences greater than that.
Uses prof_type to run correct load function, returns cast data
Xarray dataset from xarray_conversion BatchRead class stores profile in json so it can be serialized.
run_sv_correct(beam_angle, ...)Convenience function for run_ray_trace on self.
Methods Documentation
- adjust_for_z()¶
self.profile contains the sound velocity data as seen by the profiler. We need a table that starts at the depth of the sonar relative to the waterline. Also need to insert a snapback soundspeed layer equal to the data seen by the surface sound velocimeter. This method will generate a list of lookup tables that equal in length to the length of the unique surface soundvelocity entries.
- generate_lookup_table(max_pointing_angle=90.0, beam_inc=0.02)¶
Compute a lookup table for all possible launch angles to get acrosstrack/alongtrack distance and travel time. Build look up table around approximate launch angles, something like .02 deg increments. When using table, find nearest launch angle that applies. Error should be within unc of the attitude sensor (plus patch uncertainty) Table dims look something like 70 * 50 (launch angle * beam increment) by 50 (sound speed layers) Table is indexed by time. Knowing two-way-travel-time, search table for final x, y. Table would be from the waterline, when using it in practice, have to offset by the transducer vertical position relative to the waterline.
- Parameters
max_pointing_angle (
float) – max angle of the swathbeam_inc (
float) – beam angle increments you want to generate entries for
- interpolate_extended_casts(max_allowable_depth_distance=100.0)¶
Take max distance parameter, interpolate layers with depth differences greater than that. This is super important as extending a cast from 100m to 1200m to satisfy Kongsberg might result in a change in tens of m/s between layers. This results in steering angles with a huge change across that boundary.
- Parameters
max_allowable_depth_distance (
float) – max allowable distance in meters between layer entries.
- load_from_profile()¶
Uses prof_type to run correct load function, returns cast data
- Returns
keys are depth and values are soundspeed
- Return type
dict
- load_from_xarray()¶
Xarray dataset from xarray_conversion BatchRead class stores profile in json so it can be serialized. We want a dictionary where we can look up the depth and get a soundspeed. Convert it here.
- Returns
keys are depth in meters and values are soundspeed in m/s
- Return type
dict
- run_sv_correct(beam_angle, two_way_travel_time, beam_azimuth)¶
Convenience function for run_ray_trace on self. See run_ray_trace for more info.
- Parameters
beam_angle (
DataArray) – 2d array of time/beam angle. Assumes the second dim contains the actual angles, ex: (time, angle)two_way_travel_time (
DataArray) – 2d array of time/two_way_travel_time. Assumes the second dim contains the actual traveltime, ex: (time, twtt)beam_azimuth (
DataArray) – 2d array of time/beam azimuth. Assumes the second dim contains the actual beam azimuth data, ex: (time, azimuth)