LAST CHANGED : 2014/09/19 04:10:57 CRUISE NAME(S) : P16S_2014 (nbp1403) CRUISE DATES : 2014/03/24 to 2014/05/03 SHIP NAME : N.B. Palmer PORTS : Hobart, Tasmania, Australia to Papeete, Tahiti, French Polynesia CHIEF SCIENTIST : Lynne Talley DATABASE NAME : aship DATA FILES : np2014_078_36088.raw to np2014_124_50400.raw STATUS : to do done ------ ----------- averaged [ y ] loaded [ y ] NOTE: heading correction instrument exists NOTE: time-dependent heading corrections applied IN the ensembles (see cal/rotate/ens_hcorr.ang) check heading correction [ y ] calibration [ y ] NOTE: time-dependent scale factor determined with a combination of sound speed data and obvious deviations in scale factor. See below edited [ y ] re-check heading correction [ y ] check editing [ y ] figures [ y ] INSTRUMENT : nb150 ACQUISITION : PROGRAM : uhdas PROCESSING: : python LOGGING : PARAMETERS : BT : bottom track mode (on or off) SI : sampling interval or averaging period for ensemble (sec) NB : number of bins BL : bin length (m) TD : transducer depth (m) BK : blanking length (m) HO : heading offset applied by DAS (deg) HB : heading bias (deg) CRPH : compensation for roll-pitch-heading, 1:on, 0:off) yy/mm/dd hh:mm:ss BT SI NB BL TD BK HO HB CRPH 2014/03/20 10:06:28 on 300 50 8 7 8 45.58 0.00 0001 HEADING : PRIMARY : heading from gyro CORRECTION : heading correction from seapath1 NOTE: time-dependent heading corrections applied IN the ensembles (see cal/rotate/ens_hcorr.ang) POSITIONS : gps positions from gpsnav CALIBRATION : original transducer orientation: 45.58 transducer depth: 7.0 (check original processing parameters) additional rotation -0.039 final transducer angle is: (original transducer angle) - (rotate_angle) applied scale factor 1 additional scale factor (see comment 5 below) COMMENTS : 1) The data sources all behaved pretty reliably. There were no gaps in the gyro, GPS, or Seapath 200 used for heading correction. The ADCPs operated continuously without changes in sampling. In short, it should be relatively straightforward to set up processing. 2) In contrast, a large fraction of the ADCP data are compromised by rough seas and bubbles caused by the bow thruster when on station. Much of this is automatically edited away, but much had to be edited by hand. 3) We were in shallow water only for brief periods at the beginning and end. Bottom editing and previous ping interference were only im- portant for a very small fraction of the cruise. There was no bottom track data. 4) There were other sound sources aboard, which have some potential to cause interference. They include a multibeam, a Knudsen, and sources on the rosette, including a WH150, an altimeter (both pointing down) and a WH300 (pointed up) after station 68. 5) The NB150 was in a glycol-filled well behind a window. Thus, the sound speed correction is a bit different than usual (though normal for the Palmer). As shown below, after a sound speed correction, there was still a time-varying pattern in the water track scale factor. I used 5 day median scale factors to fabricate new sound speeds that suppressed the scale factor. That seemed fairly satisfactory through most of the cruise, but not during the transit at the beginning, where there were too few water calibrations to get a meaningful median. The first approximation showed a very large discrepancy compared to the OS38nb, so I used the scale factor correction from the start of the northward sample line. Some discrepancy still exists (in the direction of travel) but it seems illegitimate to set a scale factor just to get the two instruments to agree. 6) The NB150 did not appear to be badly influenced by scattering layers, but the bubbles may have caused some underway bias in the direction of motion. The effect is strongest near the surface, and the shallowest bin was often edited out, but subtle effects may remain. 7) Transitions between stations and transits were considerably better when quick_adcp.py was invoked with --refuv_source uvship . PROCESSOR : Steven Howell --- processing parameters ---------- ## (determined from "sonar"): model = nb ## (determined from "sonar"): frequency = 150 ## (determined from "sonar"): pingtype = nb ## (determined from "sonar"): instname = nb150 badbeam None beamangle 30 configtype python cruisename nbp1403 datatype uhdas dbname aship ens_len 300 fixfile aship.gps hcorr_inst seapath1 pgmin 50 proc_engine python ref_method refsm refuv_smoothwin 3 refuv_source nav sonar nb150 txy_file aship.agt xducer_dx 3 xducer_dy 19 yearbase 2014 # Set up the processing directory by typing: adcptree.py nb150_uvship_sf2 --datatype uhdas --cruisename nbp1403 cd nb150_uvship_sf2 # create a quick_adcp.py control file cat << EOF > q_py.cnt ####----- begin q_py.cnt------------ ## all lines after the first "#" sign are ignored ## python processing --yearbase 2014 --cruisename nbp1403 # used to identify configuration files # *must* match prefix of files in config dir --update_gbin ## NOTE: You should generally remake gbins ## - you are not sure ## - if parameters for averaging changed ## - various other reasons. ## ==> MAKE SURE you move the original gbin directory ## to another name first!! --configtype python ## <=== USE THE NEW FILE WE CREATED --sonar nb150 --dbname aship --datatype uhdas --ens_len 300 --ping_headcorr ## applies heading correction. ## settings found in config files --max_search_depth 1000 ## Added because this failed to work in config file --xducer_dx 3 ## Added because this failed to work in config file --xducer_dy 19 ## Added because this failed to work in config file --auto # Automatically answer yes to all questions EOF # Move gbins aside mv /home/data/nbp1403/gbin /home/data/nbp1403/gbin_uvship_sf # Then run quick_adcp.py quick_adcp.py --cntfile q_py.cnt catwt **watertrack** ------------ Number of edited points: 177 out of 185 amp = 1.0218 + -0.0007 (t - 107.2) phase = -0.02 + -0.0008 (t - 107.2) median mean std amplitude 1.0200 1.0218 0.0115 phase -0.0310 -0.0190 0.4880 ------------ # Now deal with sound speed. This has 3 parts: # 1: Determine the relationship between sound speed and temperature, # using the NB150 temperature data and the sound speed sensor in the # NB150 well. A quadratic is fit to the data, so the temperature at # the NB150 is what's actually used. This is a bit sketchy, as the # sound speed sensor is located far up the well, so if the well is # stratified (and there is no active mixing) the sound speed could # be different at the sensor and at the transducer faces. # # This adds a line to sspd_coefs.txt with the cruise name and # coefficients. I this case, it turns out to be # nbp1403 -0.034 3.355 1494.795 PATH=/media/sf_codas/P16S_2014/sadcp_postproc/nbp_sndspd/:$PATH cd edit fix_sspd2.py nbp1403 aship.tem get # 2: Apply that relationship to get soundspeed vs time. This # creates a file with new sound speeds (fit_sndspd.dat) and # a control file for fix_temp (fix_temp.cnt) fix_sspd2.py nbp1403 aship.tem write # 3: At this point, one would normally run fix_temp to apply the new # sound speeds to the database. However, the watertrack calibration # and comparisons with the OS38nb revealed that there were still # systematic problems with the scale factor, indicating that the # soundspeed correction wasn't quite right. I wound up using the # time-dependent deviations in the scale factor from the watertrack # calculations to come up with an artificial correction in the # sound speed to remove the time dependence from the watertrack # calibrations. # # The tricky part here is that one cannot easily apply two sound # speed corrections; fix_temp has to know the previously applied # sound speed but has options only for a constant or a speed # calculated by the NB150 itself from transducer temperature and # an assumed salinity of 35 PSU. Therefore, I had to run the # processing up to this point, apply the sound speed correction # with # # fix_temp fix_temp.tmp # gautoedit.py # cd .. # quick_adcp.py --steps2rerun apply_edit:navsteps:calib --auto # # # and then determine how to do the # correction. Then I redid the processing from the start in a new # directory using the commands below. cat << EOF > fudge_soundspeed.py #!/usr/bin/env python ''' There was a clear time dependence in the water track calibration scale factor for the NB150 during nbp1403. It is not clear why, but differences between sound speed at the sensor and at the ADCP paces might be different. (By 4 degrees? That's what makes this a bit fishy.) At any rate, the only way to implement a changing scale factor is through the sound speed. The optimal algorithm for determining the correction is not obvious, so this procedure is a bit of a jury-rigged mess. The procedure is 1) Plot the edited water track calibration points vs time. 2) Use binstats to get a median-filtered version over 5 day periods. 3) Multiply the soundspeeds by that ratio, interpolating as needed. 1) and 2) were done by running WT = Wtplot() in nb150_uvship/cal/watertrk/ and looking at plt.plot(WT.caldat_ma['t'],WT.caldat_ma['amp']) med5 = sc.binstats(WT.caldat_ma['t'],WT.caldat_ma['amp'], segends=np.arange(85,130,5),avgtype='median') which gave [1.006 1.003 1.0065 1.002 0.999 0.9955 0.995 1.0015] It seems reasonable to use those as a basis to interpolate new sound speeds. I'll use constants beyond the range. ''' from numpy import arange from scipy.interpolate import interp1d if __name__=='__main__': times = arange(77.5,128,5) scalef = (1.003,1.003,1.003,1.003,1.0065,1.002,0.999,0.9955,0.995,1.0015,1.0015) ifun = interp1d(times,scalef,kind='linear') src = open('fit_sndspd.dat','r') dest = open('fudged_sndspd.dat','w') for line in src : ll = line.split() dest.write("{0} {1:f}\n".format(ll[0], float(ll[1])*ifun(float(ll[0])))) EOF # Create a file with modified soundspeeds to flatten the scale factor pattern fudge_soundspeed.py # This uses fit_sndspd.dat to generate a new file of soundspeeds, # fudged_sndspd.dat # now need to change fix_temp.tmp (the control file for fix_temp) # to use fudged_sndspd.dat sed s/fit/fudged/ fix_temp.tmp >fudged_temp.tmp # and finally enter this into the database fix_temp fudged_temp.tmp cd .. # combine new fake soundspeed with uvship quick_adcp.py --steps2rerun navsteps:calib --refuv_source uvship --auto #check again catwt **watertrack** ------------ Number of edited points: 182 out of 189 amp = 1.0006 + -0.0000 (t - 107.0) phase = -0.04 + 0.0016 (t - 107.0) median mean std amplitude 1.0005 1.0006 0.0086 phase -0.0340 -0.0351 0.4698 ------------ # Now reapply the editing. According to the documentation, there could # be up to 3 types of files for this: abottom.asc, abadprf.asc, and # abadbin.asc. gautoedit.py apparently makes these files. When "apply # editing" is chosen, the edits are applied and the files are replaced # by identical? versions named *.asclog. The thing to do then is to # remove "log" then run quickadcp.py cd edit cp ../../nb150_uvship/edit/*.asclog . mv abadbin.asclog abadbin.asc mv abadprf.asclog abadprf.asc cd .. quick_adcp.py --steps2rerun apply_edit:navsteps:calib --auto catwt **watertrack** ------------ Number of edited points: 178 out of 185 amp = 1.0001 + 0.0001 (t - 107.3) phase = -0.04 + 0.0025 (t - 107.3) median mean std amplitude 1.0000 1.0001 0.0081 phase -0.0375 -0.0403 0.4701 ------------ # The phase difference is small, but consistent, so I'll do that too. quick_adcp.py --steps2rerun rotate:apply_edit:navsteps:calib --rotate_angle -0.039 --auto catwt **watertrack** ------------ Number of edited points: 178 out of 185 amp = 1.0001 + 0.0001 (t - 107.3) phase = -0.00 + 0.0026 (t - 107.3) median mean std amplitude 1.0000 1.0001 0.0082 phase 0.0000 -0.0015 0.4701 ------------ cd .. plot_reflayer.py --zrange 104:178 --plotfp nb150 os38nb # I think I'll leave it at that. The comparison with the os38nb still # looks fishy; it appears that my correction was roughly twice as big # as it should have been. But, it seems more justifiable to correct # the nb150 strictly on the basis of its water track cals than to # assume that the two instruments ought to agree perfectly. # Now remake the web plots mkdir webpy cp ../nb150_uvship/webpy/sectinfo.txt webpy quick_web.py --redo # netCDF file adcp_nc.py adcpdb contour/nb150 nbp1403 nb150 # Matlab file (for LADCP processing, I guess) quick_adcp.py --steps2rerun matfiles --auto