Skip to content
Snippets Groups Projects
Commit ae552d37 authored by pierre.rousselot_ird.fr's avatar pierre.rousselot_ird.fr
Browse files

Merge branch 'master' of https://github.com/US191/ADCP_mooring_data_processing

# Conflicts:
#	moored_adcp_proc/adcp_check_surface.m
#	moored_adcp_proc/adcp_filt_sub.m
#	template_get_adcp_data.m
parents dbe953e4 3eb3a949
No related branches found
No related tags found
No related merge requests found
File deleted
......@@ -90,17 +90,14 @@ vtid_baro=0;
% uintfilt = uintfilt-utid_baro;
% vintfilt = vintfilt-vtid_baro;
hf=figure('position', [0, 0, 1400, 1000]);
subplot 121;
hf=figure('position', [0, 0, 1400, 1000]);subplot 121;
imagesc(data.time,intdepvec,ui(intdepvec,:),[-1 1]);
%set(gca,'YLim',[min(intdepvec)-10 max(intdepvec)+10]);
gregtick;
ylabel('Bins');
title('U field - data raw');
subplot 122;
title('U field - data raw');subplot 122;
imagesc(inttim,intdepvec,uintfilt,[-1 1]);
%set(gca,'YLim',[min(intdepvec)-10 max(intdepvec)+10]);
gregtick;
%set(gca,'YLim',[min(intdepvec)-10 max(intdepvec)+10]);gregtick;
ylabel('Bins');
title('U field - data interpolated, filtered and subsampled');
......@@ -116,4 +113,4 @@ imagesc(inttim,intdepvec,vintfilt,[-1 1]);
%set(gca,'YLim',[min(intdepvec)-10 max(intdepvec)+10]);
gregtick;
ylabel('Bins');
title('V field - data interpolated, filtered and subsampled');
title('V field - data interpolated, filtered and subsampled');
\ No newline at end of file
......@@ -16,34 +16,26 @@ addpath(genpath('C:\Users\proussel\Documents\outils\ADCP\ADCP_mooring_data_proce
close all
clear all
%% META information:
% Path
addpath('.\moored_adcp_proc'); % ou par exemple ('C:\Users\IRD_US_IMAGO\TRAITEMENTS\ADCP_MOUILLAGE\01_DATA_PROCESSING\moored_adcp_proc');
addpath('.\backscatter'); % (Optionnel) / ou par exemple ('C:\Users\IRD_US_IMAGO\TRAITEMENTS\ADCP_MOUILLAGE\01_DATA_PROCESSING\backscatter');
% Location rawfile
fpath = '';
rawfile='.\FR27_000.000'; % binary file with .000 extension
rawfile='.\FR27_000.000'; % binary file with .000 extension
% Directory for outputs
fpath_output = '.\FR29_bis\';
% Cruise/mooring info
cruise.name = 'PIRATA-FR29';
mooring.name = '0N10W'; % 0N10W par exemple
mooring.lat = 00+00.15/60; %latitude en degrs dcimaux
mooring.lon = -09-53.15/60; %longitude en degrs dcimaux
clock_drift = 208/3600; % convert into hrs
% ADCP info
adcp.sn = 15258;
adcp.type = '150 khz Quartermaster'; % Type : Quartermaster, longranger
adcp.direction = 'up'; % upward-looking 'up', downward-looking 'dn'
adcp.instr_depth = 300; % nominal instrument depth
instr = 1; % this is just for name convention and sorting of all mooring instruments
% If ADCP was not set up to correct for magnetic deviation internally
adcp.instr_depth = 300; % nominal instrument depth% If ADCP was not set up to correct for magnetic deviation internally
% ("EA0" code in configuration file), use http://www.ngdc.noaa.gov/geomag-web/#declination
% Magnetic deviation: Mean of deviations at time of deployment and time of recovery
......@@ -51,11 +43,11 @@ instr = 1; % this is just for name convention and
magnetic_deviation_ini = -9;
magnetic_deviation_end = -8.77;
rot = (magnetic_deviation_ini+magnetic_deviation_end)/2;
% Read rawfile
fprintf('Read %s\n', rawfile);
raw = read_os3(rawfile,'all');
% Correct clock drift
time0 = julian(raw.juliandate);
clockd = linspace(0, clock_drift, length(time0));
......@@ -91,13 +83,11 @@ saveas(gcf,[fpath_output,mooring.name,'_',num2str(adcp.sn),'_instr_',num2str(ins
% If upward looking: range of surface bins used for instrument depth correction below!
sbins = 32:39;%30:35; % here a range of bins is given which cover the surface reflection
% Exclude data with percent good below prct_good
prct_good = 20;
%% Read data
freq = raw.config.sysconfig.frequency;
u2 = squeeze(raw.vel(:,1,first:last));
v2 = squeeze(raw.vel(:,2,first:last));
w = squeeze(raw.vel(:,3,first:last));
......@@ -153,8 +143,7 @@ binmat = repmat((1:nbin)',1,length(dpt1));
if strcmp(adcp.direction,'up')
[z,dpt1,offset,xnull] = adcp_surface_fit(dpt,ea,sbins,blen,blnk,nbin);
elseif strcmp(adcp.direction,'dn')
z = dpt1+(binmat-0.5)*blen+blnk;
else
z = dpt1+(binmat-0.5)*blen+blnk;else
error('Bin depth calculation: unknown direction!');
end
......@@ -241,6 +230,8 @@ end
[uintfilt,vintfilt,uifilt,vifilt,inttim,utid_baro,vtid_baro] = adcp_filt_sub(data,u_interp',v_interp',1:length(Z),40);
saveas(figure(5),[fpath_output,mooring.name,'_',num2str(adcp.sn),'_instr_',num2str(instr),'_','data_raw_filt_subsampled_1'],'fig')
saveas(figure(6),[fpath_output,mooring.name,'_',num2str(adcp.sn),'_instr_',num2str(instr),'_','data_raw_filt_subsampled_2'],'fig')
saveas(figure(5),[fpath_output,mooring.name,'_',num2str(adcp.sn),'_instr_',num2str(instr),'_','data_raw_filt_subsampled_1'],'fig')
saveas(figure(6),[fpath_output,mooring.name,'_',num2str(adcp.sn),'_instr_',num2str(instr),'_','data_raw_filt_subsampled_2'],'fig')
save([fpath_output, mooring.name '_' num2str(adcp.sn) '_instr_' sprintf('%02d',instr) '_int_filt.mat'],'uifilt','vifilt','data');
......@@ -250,8 +241,7 @@ bin_end = length(Z);
data.uintfilt = uintfilt(bin_start:bin_end,:);
data.vintfilt = vintfilt(bin_start:bin_end,:);
data.Z = Z(bin_start:bin_end);
data.inttim = inttim;
save([fpath_output, mooring.name '_' num2str(adcp.sn) '_instr_' sprintf('%02d',instr) '_int_filt_sub.mat'],'adcp','mooring','data','raw');
data.inttim = inttim;save([fpath_output, mooring.name '_' num2str(adcp.sn) '_instr_' sprintf('%02d',instr) '_int_filt_sub.mat'],'adcp','mooring','data','raw');
%% Figure
niv_u = (-1:0.05:1);
......@@ -275,8 +265,7 @@ title({[mooring.name, ' - ZONAL VELOCITY - RDI ',num2str(freq),' kHz']});
%v
subplot(2,1,2);
[C,h] = contourf(inttim,Z(bin_start:bin_end),vintfilt(bin_start:bin_end,:),niv_v);
set(h,'LineColor','none');
[C,h] = contourf(inttim,Z(bin_start:bin_end),vintfilt(bin_start:bin_end,:),niv_v); set(h,'LineColor','none');
caxis(niv_v([1 end]));
h = colorbar;
ylabel(h,'V [m s^-^1]');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment