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
42 stars 25 forks source link

edit suggested for assigning dat['range'] for AD2CP data #61

Closed mcfogarty closed 2 years ago

mcfogarty commented 5 years ago

in nortek2.py data['range'] = (np.arange(data['vel'].shape[1]) data['config']['cell_size'] + data['config']['blanking']) if 'vel_b5' in data: data['range_b5'] = (np.arange(data['vel_b5'].shape[1]) data['config']['cell_size_b5'] + data['config']['blanking_b5'])

But, np.arange(data['vel'].shape[1]) yields an array with first entry as 0

if cell_size = 1.0 m and blanking = 0.5 m, dat.range[0] = 0 * cell_size + blanking = 0 + 0.5 = 0.5, when based on N3015-025-Principles-of-Operation_Signature document from Nortek,

dat.range[0] should be

center of nth cell = blanking + n cell_size = 0.5 m + (1)1 m = 1.5 m

Suggested edit to nortek2.py: data['range'] = (np.arange(data['vel'].shape[1]) + 1 data['config']['cell_size'] + data['config']['blanking']) if 'vel_b5' in data: data['range_b5'] = (np.arange(data['vel_b5'].shape[1]) + 1 data['config']['cell_size_b5'] + data['config']['blanking_b5'])

Note the rdi.py read file assigns dat['range'] differently and is okay. dat['range'] = (self.cfg['bin1_dist_m'] + np.arange(self.cfg['n_cells']) * self.cfg['cell_size_m'])

lkilcher commented 2 years ago

@jmcvey3 I beleive you've resolved this in #67, right?

jmcvey3 commented 2 years ago

@jmcvey3 I beleive you've resolved this in #67, right?

That is correct.

lkilcher commented 2 years ago

Closing since this will be resolved with #67.