Difference between revisions of "Process COPS"
Jump to navigation
Jump to search
(Created page with "back to C-OPS/CERBERUS Mfiles") |
|||
| Line 1: | Line 1: | ||
| + | <pre> | ||
| + | function process_COPS(pb) | ||
| + | %created by Erik Stassinos 6-11-2013 | ||
| + | %This is the global script which calls all COPS processing scripts | ||
| + | |||
| + | |||
| + | % % %============= | ||
| + | % check if files have already been generated | ||
| + | starttime = tic; | ||
| + | |||
| + | ml = fopen('mpblist_prr.txt'); | ||
| + | if ml ~= -1 | ||
| + | disp('most processing has already been started') | ||
| + | disp('remove all files other than P*.lcd files to restart') | ||
| + | disp('this will be changed to adapt to processing steps already implemented') | ||
| + | yorn = input('Do you want to remove files and start over? y or n ','s') | ||
| + | yn = lower(yorn) | ||
| + | if strncmp(yn,'n',1) == 1 | ||
| + | fclose(ml); | ||
| + | return | ||
| + | end | ||
| + | if strncmp(yn,'y',1) == 1 | ||
| + | delete a* | ||
| + | delete A* | ||
| + | delete b* | ||
| + | delete r* | ||
| + | delete t* | ||
| + | delete m* | ||
| + | delete K* | ||
| + | delete l* | ||
| + | pause(3) | ||
| + | end | ||
| + | |||
| + | end | ||
| + | |||
| + | prrfile('p') %changed from P list 6/24/2013 | ||
| + | movefile('plist_prr.txt','list_prr.txt') %changed from P list 6/24/2013 | ||
| + | %========================= | ||
| + | % % %CPSbt_E | ||
| + | %========================= | ||
| + | num =1; | ||
| + | %domath('bsakrmP101216B.lcd.1','r','1Lu412','1Ed412',0,'rrs412') | ||
| + | |||
| + | |||
| + | prrfile('p'); %creates list of prr files "P" %changed from P list 6/24/2013 | ||
| + | %changed back to lowercase p list 9-18-2013 | ||
| + | |||
| + | prlist = fopen('plist_prr.txt');%changed from P list 6/24/2013 | ||
| + | %changed back to lowercase p list | ||
| + | %9-18-2013 | ||
| + | |||
| + | |||
| + | |||
| + | %=========first math sequence | ||
| + | while ~feof(prlist) | ||
| + | newl(num,:) = fgets(prlist); | ||
| + | num = num +1; | ||
| + | end | ||
| + | frewind(prlist) | ||
| + | for i = 1:num -1 | ||
| + | filename = newl(i,:); | ||
| + | %domath(filename,'s','LuZDepth',0,0.486,'depth_Lu') %changed 6-24-13 | ||
| + | domath (filename,'s','LuZDepth',0,0.4,'depth_ed') | ||
| + | end | ||
| + | |||
| + | |||
| + | |||
| + | cpsfile('mpb') | ||
| + | mlist = fopen('mpblist_prr.txt'); | ||
| + | |||
| + | num =1; | ||
| + | %==============radQC sequence | ||
| + | %compares data to limits specified in Copsrqclist.txt | ||
| + | while ~feof(mlist) | ||
| + | newl2(num,:) = fgets(mlist); | ||
| + | num = num +1; | ||
| + | end | ||
| + | %disp('Copy rqclist.txtfrom a previous processing example and update to this folder') | ||
| + | %disp('Press return to continue') | ||
| + | %pause | ||
| + | for i = 1:num -1 | ||
| + | filename = newl2(i,:); | ||
| + | %path = '/home/data65/pb/REPROCESS_2010/PRR/rqclist.txt'; | ||
| + | path = '/home/oceancolor/Plumes_and_Blooms/workspace/eriks/C-OPS/Copsrqclist.txt'; | ||
| + | COPSradQC(filename,path); | ||
| + | end | ||
| + | |||
| + | cpsfile('rqcm') | ||
| + | rlist = fopen('rqclist_prr.txt'); | ||
| + | num =1; | ||
| + | %============doKQ sequence | ||
| + | while ~feof(rlist) | ||
| + | newl3(num,:) = fgets(rlist); | ||
| + | num = num +1; | ||
| + | end | ||
| + | for i = 1:num -1 | ||
| + | infile = newl3(i,:); | ||
| + | infile = strtrim(infile); | ||
| + | CPSdoKQ(infile,'m','EdZ412',10,0.005,0.02) %-m 2Es412 10 0.005 0.02 | ||
| + | end | ||
| + | |||
| + | cpsfile('Krqc') | ||
| + | Klist = fopen('Krqlist_prr.txt'); | ||
| + | num =1; | ||
| + | %============angQ sequence | ||
| + | while ~feof(Klist) | ||
| + | newl4(num,:) = fgets(Klist); | ||
| + | num = num +1; | ||
| + | end | ||
| + | for i = 1:num -1 | ||
| + | infile = newl4(i,:); | ||
| + | infile = strtrim(infile); | ||
| + | CPSangQ(infile,'EdZPitch','EdZRoll','EdZ443','LuZ443'); %hard coded range is 10 deg, flag is "2" changed 12-3-12 | ||
| + | %keyboard | ||
| + | CPSangQ(strcat('an',infile),'EdZPitch','Ed0Roll','EdZ443','LuZ443'); | ||
| + | end | ||
| + | cpsfile('anKr'); | ||
| + | |||
| + | movefile('anKlist_prr.txt','list_prr.txt') | ||
| + | |||
| + | |||
| + | % | ||
| + | % | ||
| + | pause(5) | ||
| + | |||
| + | %=======split cast and binning | ||
| + | %prr_split %takes list_prr.txt %==========replaced with split file | ||
| + | |||
| + | splist = fopen('list_prr.txt'); | ||
| + | num =1; | ||
| + | while ~feof(splist) | ||
| + | newlA(num,:) = fgets(splist); | ||
| + | num = num +1; | ||
| + | end | ||
| + | for i = 1:num -1 | ||
| + | infile = newlA(i,:); | ||
| + | infile = strtrim(infile); | ||
| + | prr_split_file(infile); | ||
| + | |||
| + | end | ||
| + | |||
| + | |||
| + | list_file = 'slist.txt'; | ||
| + | bincolnum =2; %COPS depth column | ||
| + | |||
| + | %%%%prr_binner(list_file,bincolnum) | ||
| + | % % %prr_bincheat(list_file,bincolnum); | ||
| + | |||
| + | % % %cpsfile('banK'); | ||
| + | % % %banlist = fopen('banlist_prr.txt'); %binned list | ||
| + | |||
| + | banlist = fopen('slist.txt'); | ||
| + | |||
| + | num =1; | ||
| + | |||
| + | while ~feof(banlist) | ||
| + | var = strtrim(fgets(banlist)); | ||
| + | newl5(num,:) = var;% fgets(banlist) | ||
| + | num = num +1; | ||
| + | end | ||
| + | for i = 1:num -1 | ||
| + | infile = newl5(i,:); | ||
| + | infile = strtrim(infile); | ||
| + | %doKQ(infile,'m','2Es412',10,0.005,0.02) %-m 2Es412 10 0.005 0.02 | ||
| + | %========bscalc sequence | ||
| + | COPSbscalcloop(infile) %calls bscalc | ||
| + | |||
| + | end | ||
| + | |||
| + | %%movefile('banlist_prr.txt','list_prr.txt') | ||
| + | |||
| + | cpsfile('bsanK') | ||
| + | %bsmlist = fopen('list_prr.txt'); %binned list | ||
| + | bsmlist = fopen('bsalist_prr.txt'); %binned list | ||
| + | num =1; | ||
| + | %==========mathloop squence | ||
| + | while ~feof(bsmlist) | ||
| + | newl6(num,:) = fgets(bsmlist); | ||
| + | num = num +1; | ||
| + | end | ||
| + | |||
| + | for i = 1:num -1 | ||
| + | infile = newl6(i,:); | ||
| + | infile = strtrim(infile); | ||
| + | %mathloop('bsbanKrqcmP101216E.lcd.1') | ||
| + | COPSmathloop(infile) | ||
| + | |||
| + | end | ||
| + | |||
| + | |||
| + | cpsfile('mbs') | ||
| + | movefile('mbslist_prr.txt','list_prr.txt') | ||
| + | |||
| + | mblist = fopen('list_prr.txt'); %binned list | ||
| + | num =1; | ||
| + | |||
| + | while ~feof(mblist) | ||
| + | newl7(num,:) = fgets(mblist); | ||
| + | num = num +1; | ||
| + | end | ||
| + | for i = 1:num -1 | ||
| + | infi = newl7(i,:); | ||
| + | infi = strtrim(infi); | ||
| + | %kcloop('mbsbanKrqcmP101216E.lcd.1') | ||
| + | COPSkcloop(infi) %used to be bbopkc | ||
| + | |||
| + | end | ||
| + | |||
| + | mkdir final | ||
| + | movefile('kcmbs*',[pwd,'/final']) | ||
| + | % % % % % % % % % % % | ||
| + | elapsed = toc(starttime) | ||
| + | |||
| + | </pre> | ||
| + | |||
| + | |||
back to [[C-OPS/CERBERUS Mfiles]] | back to [[C-OPS/CERBERUS Mfiles]] | ||
Latest revision as of 17:22, 13 February 2014
function process_COPS(pb)
%created by Erik Stassinos 6-11-2013
%This is the global script which calls all COPS processing scripts
% % %=============
% check if files have already been generated
starttime = tic;
ml = fopen('mpblist_prr.txt');
if ml ~= -1
disp('most processing has already been started')
disp('remove all files other than P*.lcd files to restart')
disp('this will be changed to adapt to processing steps already implemented')
yorn = input('Do you want to remove files and start over? y or n ','s')
yn = lower(yorn)
if strncmp(yn,'n',1) == 1
fclose(ml);
return
end
if strncmp(yn,'y',1) == 1
delete a*
delete A*
delete b*
delete r*
delete t*
delete m*
delete K*
delete l*
pause(3)
end
end
prrfile('p') %changed from P list 6/24/2013
movefile('plist_prr.txt','list_prr.txt') %changed from P list 6/24/2013
%=========================
% % %CPSbt_E
%=========================
num =1;
%domath('bsakrmP101216B.lcd.1','r','1Lu412','1Ed412',0,'rrs412')
prrfile('p'); %creates list of prr files "P" %changed from P list 6/24/2013
%changed back to lowercase p list 9-18-2013
prlist = fopen('plist_prr.txt');%changed from P list 6/24/2013
%changed back to lowercase p list
%9-18-2013
%=========first math sequence
while ~feof(prlist)
newl(num,:) = fgets(prlist);
num = num +1;
end
frewind(prlist)
for i = 1:num -1
filename = newl(i,:);
%domath(filename,'s','LuZDepth',0,0.486,'depth_Lu') %changed 6-24-13
domath (filename,'s','LuZDepth',0,0.4,'depth_ed')
end
cpsfile('mpb')
mlist = fopen('mpblist_prr.txt');
num =1;
%==============radQC sequence
%compares data to limits specified in Copsrqclist.txt
while ~feof(mlist)
newl2(num,:) = fgets(mlist);
num = num +1;
end
%disp('Copy rqclist.txtfrom a previous processing example and update to this folder')
%disp('Press return to continue')
%pause
for i = 1:num -1
filename = newl2(i,:);
%path = '/home/data65/pb/REPROCESS_2010/PRR/rqclist.txt';
path = '/home/oceancolor/Plumes_and_Blooms/workspace/eriks/C-OPS/Copsrqclist.txt';
COPSradQC(filename,path);
end
cpsfile('rqcm')
rlist = fopen('rqclist_prr.txt');
num =1;
%============doKQ sequence
while ~feof(rlist)
newl3(num,:) = fgets(rlist);
num = num +1;
end
for i = 1:num -1
infile = newl3(i,:);
infile = strtrim(infile);
CPSdoKQ(infile,'m','EdZ412',10,0.005,0.02) %-m 2Es412 10 0.005 0.02
end
cpsfile('Krqc')
Klist = fopen('Krqlist_prr.txt');
num =1;
%============angQ sequence
while ~feof(Klist)
newl4(num,:) = fgets(Klist);
num = num +1;
end
for i = 1:num -1
infile = newl4(i,:);
infile = strtrim(infile);
CPSangQ(infile,'EdZPitch','EdZRoll','EdZ443','LuZ443'); %hard coded range is 10 deg, flag is "2" changed 12-3-12
%keyboard
CPSangQ(strcat('an',infile),'EdZPitch','Ed0Roll','EdZ443','LuZ443');
end
cpsfile('anKr');
movefile('anKlist_prr.txt','list_prr.txt')
%
%
pause(5)
%=======split cast and binning
%prr_split %takes list_prr.txt %==========replaced with split file
splist = fopen('list_prr.txt');
num =1;
while ~feof(splist)
newlA(num,:) = fgets(splist);
num = num +1;
end
for i = 1:num -1
infile = newlA(i,:);
infile = strtrim(infile);
prr_split_file(infile);
end
list_file = 'slist.txt';
bincolnum =2; %COPS depth column
%%%%prr_binner(list_file,bincolnum)
% % %prr_bincheat(list_file,bincolnum);
% % %cpsfile('banK');
% % %banlist = fopen('banlist_prr.txt'); %binned list
banlist = fopen('slist.txt');
num =1;
while ~feof(banlist)
var = strtrim(fgets(banlist));
newl5(num,:) = var;% fgets(banlist)
num = num +1;
end
for i = 1:num -1
infile = newl5(i,:);
infile = strtrim(infile);
%doKQ(infile,'m','2Es412',10,0.005,0.02) %-m 2Es412 10 0.005 0.02
%========bscalc sequence
COPSbscalcloop(infile) %calls bscalc
end
%%movefile('banlist_prr.txt','list_prr.txt')
cpsfile('bsanK')
%bsmlist = fopen('list_prr.txt'); %binned list
bsmlist = fopen('bsalist_prr.txt'); %binned list
num =1;
%==========mathloop squence
while ~feof(bsmlist)
newl6(num,:) = fgets(bsmlist);
num = num +1;
end
for i = 1:num -1
infile = newl6(i,:);
infile = strtrim(infile);
%mathloop('bsbanKrqcmP101216E.lcd.1')
COPSmathloop(infile)
end
cpsfile('mbs')
movefile('mbslist_prr.txt','list_prr.txt')
mblist = fopen('list_prr.txt'); %binned list
num =1;
while ~feof(mblist)
newl7(num,:) = fgets(mblist);
num = num +1;
end
for i = 1:num -1
infi = newl7(i,:);
infi = strtrim(infi);
%kcloop('mbsbanKrqcmP101216E.lcd.1')
COPSkcloop(infi) %used to be bbopkc
end
mkdir final
movefile('kcmbs*',[pwd,'/final'])
% % % % % % % % % % %
elapsed = toc(starttime)
back to C-OPS/CERBERUS Mfiles