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

Changeset 509

Show
Ignore:
Timestamp:
08/04/13 19:19:35
Author:
cbc
Message:

Add Harvey's CTD QA code for Pelagia.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gliderproc/trunk/gliderCTD_Generate_L1_Data.m

    r508 r509  
    2323%   June 2013, implemented some QC procedures for ramses, HES 
    2424%   20130703 - Iterate throuth gliders and deployments. - CBC 
     25%   20130725 - Implemented some QC procedures for pelagia. - HES 
    2526% 
    2627%////////////////////////////////////////////////////////////////////////// 
     
    308309            ptime = ptime(i);  temp = temp(i);  pres = pres(i);  cond = cond(i);  
    309310            ctd_time = ctd_time(i); 
     311        elseif(gliderIndex == 1) 
     312            ib=find(abs(diff(temp))>1.5); 
     313            ib2=find(abs(diff(cond))>0.1); 
     314            ibb=union(ib,ib2); 
     315            temp(ibb+1)=NaN; 
     316            cond(ibb+1)=NaN; 
     317            i=find(~isnan(temp)); 
     318            ptime = ptime(i);  temp = temp(i);  pres = pres(i);  cond = cond(i);  
     319            ctd_time = ctd_time(i); 
    310320        end 
    311321 
     
    352362        avgDepthRate = avgDepthRate(i); glideAngle = glideAngle(i);  
    353363        ptime = ptime(i); temp = temp(i); cond = cond(i); pres = pres(i);  
    354         ctd_time = ctd_time(i); 
     364        ctd_time = ctd_time(i); hv = hv(i); 
    355365 
    356366        % scale up the pressure... 
     
    392402        % top or bottom of profiles.  Use original velocity measure (hv) and pitch 
    393403        % to identify points for exclusion 
    394         % these values set by look at ramses; may need alternate set for pelagia 
     404        % these values set by look at ramses; may need alternate set for 
     405        % pelagia (now set based on deployment 1) 
    395406 
    396407        if(gliderIndex == 2) 
     
    399410            ib = union(iv,ip); 
    400411            salinCorrected(ib) = NaN; 
    401  
     412        elseif(gliderIndex == 1) 
     413            iv = find(hv<0.1); 
     414            ip = find(pitch>5 & pitch < 15); 
     415            ib = union(iv,ip); 
     416            salinCorrected(ib) = NaN; 
     417        end 
     418             
    402419            % the step above likely removes many points, need to make sure that dataset 
    403420            % is consistent, so use salinity to ID valid times going forward 
    404421 
    405             i = find(~isnan(salinCorrected)); 
    406             ptime=ptime(i);  temp=temp(i);  tempCorrected=tempCorrected(i); salin=salin(i); 
    407             salinCorrected=salinCorrected(i); pres=pres(i); dens=dens(i); 
    408         end 
     422        i = find(~isnan(salinCorrected)); 
     423        ptime=ptime(i);  temp=temp(i);  tempCorrected=tempCorrected(i); salin=salin(i); 
     424        salinCorrected=salinCorrected(i); pres=pres(i); dens=dens(i); 
     425         
    409426 
    410427        % calculate density...should this use temp corrected?? HES - no, now have