NCCOOS Trac Projects: Top | Web | Platforms | Processing | Viz | Sprints | Sandbox | (Wind)

Changeset 217

Show
Ignore:
Timestamp:
12/18/08 11:47:50
Author:
gdusek
Message:

updated a few things in adcp processing

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • DPWavesProc/trunk/DPWavesProc/adcp_matlab/radialtouvw.m

    r215 r217  
    2222 
    2323%whats the magnetic variation 
    24 magvar=9.63
     24magvar=-10
    2525 
    2626%set up sysinfo file 
  • DPWavesProc/trunk/DPWavesProc/adcp_matlab/specmultiplot.m

    r215 r217  
    1 function [Winfo]=specmultiplot(dateinfo1,dateinfo2,timestep);  
     1function [Winfo,spec2d,fd,thetad,td]=specmultiplot(dateinfo1,dateinfo2,timestep);  
    22%where dateinfo1 and 2 are the strings of the first and last date extension 
    33%of the pressure,range,etc files and timestep is the time in hours between 
     
    2828end 
    2929             
    30        
     30%Make a directory for the data 
     31mkdir('tempdir'); 
     32 
    3133%set up time, which is Winfo.time as date str in the yymmddHHMM format 
    3234time=datestr(Winfo.time, 'yymmddHHMM'); 
    3335 
    3436%set up data structure for wave info 
    35 Winfo.setup={'EMEP UVW','IMLM UVW','EMEP range','IMLM range','EMEP radial','IMLM radial','wavesmon'}'
     37Winfo.setup={'EMEP radial'}
    3638Winfo.hsig=[]; 
    3739Winfo.hconf=[]; 
     
    3941Winfo.dirP=[]; 
    4042Winfo.Ddir=[]; 
    41 Winfo.Spectrum.EMEPuvw=[]; 
    42 Winfo.Spectrum.IMLMuvw=[]; 
    43 Winfo.Spectrum.EMEPrange=[]; 
    44 Winfo.Spectrum.IMLMrange=[]; 
    4543Winfo.Spectrum.EMEPradial=[]; 
    46 Winfo.Spectrum.IMLMradial=[]; 
    47 Winfo.Spectrum.wavesmon=[]; 
    4844 
    4945%Load the data and run the script 
     
    5551    orbit=strcat('orbit_',dateinfo,'.txt'); 
    5652    sysinfo=strcat('sysinfo_',dateinfo,'.txt'); 
    57     spec=strcat('DSpec',dateinfo,'.txt'); 
     53  
    5854 
    5955    pressure=load(pressure); 
     
    6157    orbit=load(orbit); 
    6258    sysinfo=load(sysinfo); 
    63     spec=load(spec); 
    64  
    65     %set up data with uvw and pressure, freq at 0.01 and dir at 2 
    66     [ID,SM,EP]=radialtouvw(pressure,range,orbit,sysinfo,1); 
    67  
    68     %run diwasp to generate this spectrum 
    69     [E_uvw_F01_D2, EPout]=dirspec(ID,SM,EP,{'PLOTTYPE',0,'MESSAGE',0}); 
    70  
    71     %now for IMLM 
    72     EP.method='IMLM'; 
    73     EP.iter=3; 
    74     [I_uvw_F01_D2, EPout]=dirspec(ID,SM,EP,{'PLOTTYPE',0,'MESSAGE',0}); 
    75  
    76     %set up data with ranges, freq and dir at default 
    77     [ID,SM,EP]=radialtouvw(pressure,range,orbit,sysinfo,2); 
    78  
    79     % run diwasp to generate this spectrum with EMEP 
    80     [E_range_F01_D2, EPout]=dirspec(ID,SM,EP,{'PLOTTYPE',0,'MESSAGE',0}); 
    81  
    82     %now with IMLM 
    83     EP.method='IMLM'; 
    84     EP.iter=3; 
    85     [I_range_F01_D2, EPout]=dirspec(ID,SM,EP,{'PLOTTYPE',0,'MESSAGE',0}); 
     59    
    8660 
    8761    %set up data with radial velocities, freq and dir at default 
     
    8963 
    9064    % run diwasp to generate this spectrum with EMEP 
    91     [E_radial_F01_D2, EPout]=dirspec(ID,SM,EP,{'PLOTTYPE',0,'MESSAGE',0}); 
    92  
    93     %now with IMLM 
    94     EP.method='IMLM'; 
    95     EP.iter=3; 
    96     [I_radial_F01_D2, EPout]=dirspec(ID,SM,EP,{'PLOTTYPE',0,'MESSAGE',0}); 
     65    [radialE, EPout]=dirspec(ID,SM,EP,{'PLOTTYPE',0,'MESSAGE',0}); 
    9766 
    9867    %Use waveplot to plot the polar, freq and dir plots of the spectra 
    9968 
    100     [E_UVW_WI,I_UVW_WI,E_range_WI,I_range_WI,wmon_WI,fig1,fig2]=waveplot(E_uvw_F01_D2,I_uvw_F01_D2,E_range_F01_D2,I_range_F01_D2,spec,sysinfo); 
     69    [E_radial_WI,fig1,fig2]=waveplottest1(radialE,sysinfo);  
    10170     
    10271    saveas(fig1,['polar1_' dateinfo '.fig']); 
    10372    saveas(fig2,['dirfreq1_' dateinfo '.fig']); 
    104     
    105     [E_radial_WI,I_radial_WI,fig5,fig6]=radialwaveplot(E_radial_F01_D2,I_radial_F01_D2,spec,sysinfo); 
    106  
    107     saveas(fig5,['polar3_' dateinfo '.fig']); 
    108     saveas(fig6,['dirfreq3_' dateinfo '.fig']); 
    10973     
     74    movefile(['polar1_' dateinfo '.fig'],'tempdir'); 
     75    movefile(['dirfreq1_' dateinfo '.fig'],'tempdir'); 
    11076    close all; 
    11177     
    112     %Make sure wavesmon spectrum is formatted right before outputting, change to m^2/Hz/deg 
    113     wmon.S=spec/(360*1000*1000); 
    11478     
    11579    %Fill up the Winfo data structure 
    11680 
    117     hsig=[vertcat(E_UVW_WI.hsig,I_UVW_WI.hsig,E_range_WI.hsig,I_range_WI.hsig,E_radial_WI.hsig,I_radial_WI.hsig,wmon_WI.hsig)]; 
    118     hconf=[vertcat(E_UVW_WI.hconf,I_UVW_WI.hconf,E_range_WI.hconf,I_range_WI.hconf,E_radial_WI.hconf,I_radial_WI.hconf,[NaN NaN])]; 
    119     peakP=[vertcat(E_UVW_WI.tp,I_UVW_WI.tp,E_range_WI.tp,I_range_WI.tp,E_radial_WI.tp,I_radial_WI.tp,wmon_WI.tp)]; 
    120     dirP=[vertcat(E_UVW_WI.dtp,I_UVW_WI.dtp,E_range_WI.dtp,I_range_WI.dtp,E_radial_WI.dtp,I_radial_WI.dtp,wmon_WI.dtp)]; 
    121     Ddir=[vertcat(E_UVW_WI.dp,I_UVW_WI.dp,E_range_WI.dp,I_range_WI.dp,E_radial_WI.dp,I_radial_WI.dp,wmon_WI.dp)]; 
     81    hsig=[vertcat(E_radial_WI.hsig)]; 
     82    hconf=[vertcat(E_radial_WI.hconf)]; 
     83    peakP=[vertcat(E_radial_WI.tp)]; 
     84    dirP=[vertcat(E_radial_WI.dtp)]; 
     85    Ddir=[vertcat(E_radial_WI.dp)]; 
    12286     
    12387     
     
    12791    Winfo.dirP=[horzcat(Winfo.dirP,dirP)]; 
    12892    Winfo.Ddir=[horzcat(Winfo.Ddir,Ddir)]; 
    129     Winfo.Spectrum.EMEPuvw=[cat(3,Winfo.Spectrum.EMEPuvw,E_uvw_F01_D2.S)]; 
    130     Winfo.Spectrum.IMLMuvw=[cat(3,Winfo.Spectrum.IMLMuvw,I_uvw_F01_D2.S)]; 
    131     Winfo.Spectrum.EMEPrange=[cat(3,Winfo.Spectrum.EMEPrange,E_range_F01_D2.S)]; 
    132     Winfo.Spectrum.IMLMrange=[cat(3,Winfo.Spectrum.IMLMrange,I_range_F01_D2.S)]; 
    133     Winfo.Spectrum.EMEPradial=[cat(3,Winfo.Spectrum.EMEPradial,E_radial_F01_D2.S)]; 
    134     Winfo.Spectrum.IMLMradial=[cat(3,Winfo.Spectrum.IMLMradial,I_radial_F01_D2.S)]; 
    135     Winfo.Spectrum.wavesmon=[cat(3,Winfo.Spectrum.wavesmon,wmon.S)]; 
    136      
     93    Winfo.Spectrum.EMEPradial=[cat(3,Winfo.Spectrum.EMEPradial,radialE.S)]; 
    13794end 
    13895 
     96Winfo.Spectrum.EMEPradial=permute(Winfo.Spectrum.EMEPradial,[3,1,2]); 
     97 
     98spec2d=Winfo.Spectrum.EMEPradial; 
     99spec2d=spec2d(:,:,1:180); 
     100spec2d=spec2d*(360/(2*pi)); 
     101 
     102%this changes the coordinates from axis to compass 
     103newspec2d=zeros(size(spec2d)); 
     104for i= 1:size(spec2d,1) 
     105    oldspec=squeeze(spec2d(i,:,:)); 
     106 
     107    newspec=zeros(size(oldspec)); 
     108 
     109    for j = 1:46 
     110        newspec(:,j)=oldspec(:,47-j); 
     111    end 
     112    for j = 47:180 
     113        newspec(:,j)=oldspec(:,181-(j-46)); 
     114    end 
     115     
     116    %firstspec=newspec(:,91:180); 
     117    %secondspec=newspec(:,1:90); 
     118    %newspec=cat(2,firstspec,secondspec); 
     119     
     120    newspec2d(i,:,:)=newspec;     
     121end 
     122 
     123Winfo.Spectrum.EMEPradial=newspec2d; 
     124 
     125%************************************************************************* 
     126%these following variables can be output if you wish to continue to process the data through 
     127%the XWAVES software. 
     128 
     129spec2d=newspec2d; 
     130fd=[0.01:0.01:0.4]; 
     131thetad=[0:2:358]; 
     132date1=datevec(Winfo.time); 
     133td=date1(:,1:5); 
     134 
     135save(['specdata_' dateinfo],'Winfo','spec2d','fd','thetad','td'); 
     136movefile(['specdata_' dateinfo '.mat'],'tempdir'); 
     137 
     138%************************************************************************** 
     139 
    139140%now create the time series plots of the wave info 
    140 [fig_sigh,fig_pp,fig_dp,fig_dd]=Winfo_plot(Winfo); 
     141[fig_sigh,fig_pp,fig_dp,fig_dd]=Winfo_plot1(Winfo); 
    141142 
    142143saveas(fig_sigh,['sigh_' dateinfo '.fig']); 
     
    145146saveas(fig_dd,['domdir_' dateinfo '.fig']); 
    146147 
     148movefile(['sigh_' dateinfo '.fig'],'tempdir'); 
     149movefile(['peakp_' dateinfo '.fig'],'tempdir'); 
     150movefile(['dirpeak_' dateinfo '.fig'],'tempdir'); 
     151movefile(['domdir_' dateinfo '.fig'],'tempdir'); 
     152 
     153movefile('tempdir',strcat('procdata_',dateinfo)); 
     154 
    147155close all; 
    148156 
  • DPWavesProc/trunk/DPWavesProc/nortek/nortek_radialtouvw.m

    r168 r217  
    2222 
    2323%whats the magnetic variation 
    24 magvar=9.63
     24magvar=-10
    2525 
    2626%set up pressure 
  • DPWavesProc/trunk/DPWavesProc/nortek/nortek_specmultiplot.m

    r215 r217  
    3636 
    3737%set up data structure for wave info 
    38 Winfo.setup={'EMEP','IMLM' 'nortek'}'; 
     38Winfo.setup={'IMLM'}'; 
    3939Winfo.hsig=[]; 
    4040Winfo.hconf=[]; 
     
    4242Winfo.dirP=[]; 
    4343Winfo.Ddir=[]; 
    44 Winfo.Spectrum.EMEP=[]; 
    4544Winfo.Spectrum.IMLM=[]; 
    46 Winfo.Spectrum.nortek=[]; 
    4745 
    4846%load the wave data from the nortek quick wave software 
     
    6866    [ID,SM,EP]=nortek_radialtouvw(pressure,range,orbit,sysinfo,1); 
    6967 
    70     %run diwasp to generate this spectrum 
    71     [E_F01_D2, EPout]=dirspec(ID,SM,EP,{'PLOTTYPE',0,'MESSAGE',0}); 
    72  
    73     %now for IMLM 
     68    %For IMLM 
    7469    EP.method='IMLM'; 
    7570    EP.iter=3; 
     
    8883    %Fill up the Winfo data structure 
    8984 
    90     hsig=[vertcat(E_WI.hsig,I_WI.hsig,nortek_WI.hsig)]; 
    91     hconf=[vertcat(E_WI.hconf,I_WI.hconf,nortek_WI.hconf)]; 
    92     peakP=[vertcat(E_WI.tp,I_WI.tp,nortek_WI.tp)]; 
    93     dirP=[vertcat(E_WI.dtp,I_WI.dtp,nortek_WI.dtp)]; 
    94     Ddir=[vertcat(E_WI.dp,I_WI.dp,nortek_WI.dp)]; 
     85    hsig=[I_WI.hsig]; 
     86    hconf=[I_WI.hconf]; 
     87    peakP=[I_WI.tp]; 
     88    dirP=[I_WI.dtp]; 
     89    Ddir=[I_WI.dp]; 
    9590     
    9691    Winfo.hsig=[horzcat(Winfo.hsig,hsig)]; 
     
    9994    Winfo.dirP=[horzcat(Winfo.dirP,dirP)]; 
    10095    Winfo.Ddir=[horzcat(Winfo.Ddir,Ddir)]; 
    101     Winfo.Spectrum.EMEP=[cat(3,Winfo.Spectrum.EMEP,E_F01_D2.S)]; 
    102     Winfo.Spectrum.IMLM=[cat(3,Winfo.Spectrum.IMLM,I_F01_D2.S)]; 
    103     Winfo.Spectrum.nortek=[cat(3,Winfo.Spectrum.nortek,nortekspec)]; 
    104      
     96    Winfo.Spectrum.IMLM=[cat(3,Winfo.Spectrum.IMLM,I_F01_D2.S)];     
    10597end 
    10698