lkilcher / dolfyn

A library for oceanographic doppler instruments such as Acoustic Doppler Profilers (ADPs, ADCPs) and Acoustic Doppler Velocimeters (ADVs).
BSD 3-Clause "New" or "Revised" License
41 stars 25 forks source link

Rotate-variables list #81

Open lkilcher opened 2 years ago

lkilcher commented 2 years ago

We should probably change from the list ds.attrs['rotate_vars'] to a DataArray attribute flag (e.g., ds['vel'].attrs['rotate_me']=True). Then we loop over all of the variables to identify which ones should be rotated.

The advantage of this is that when we do things like ds.drop_vars('accel_echo'), we don't later get an error when we do ds.velds.rotate2(...).

lkilcher commented 2 years ago

We may want to make these attrs look like:

ds['vel'].attrs['rotate_with'] = 'orientmat'
...
ds['accel_b5'].attrs['rotate_with'] = 'orientmat_b5'
...
ds['accel_echo'].attrs['rotate_with'] = 'orientmat_echo'
...

But obviously that will also require implementing orientmat_b5 (etc) when we only have pitch_b5, roll_b5, and heading_b5.

lkilcher commented 2 years ago

We should make this change at the same time as fixing #96 .