Home > reduc > period_reduce.m

period_reduce

PURPOSE ^

SYNOPSIS ^

function period_reduce(date_start,date_end,output_stub,path_to_redscript,sched_to_reduce,runhealth)

DESCRIPTION ^

  

 Example use period_reduce('02-Nov-2010','09-Nov-2010','my-survey')
 Code will  generate intervening date strings between date_start, date_end

 JL

 MAS 23-Feb-2012 - added a parameter "runhealth" to allow antenna health
 to be run optionally.  Run antenna health by default.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function period_reduce(date_start,date_end,output_stub,path_to_redscript,sched_to_reduce,runhealth)
0002 %
0003 %
0004 % Example use period_reduce('02-Nov-2010','09-Nov-2010','my-survey')
0005 % Code will  generate intervening date strings between date_start, date_end
0006 %
0007 % JL
0008 %
0009 % MAS 23-Feb-2012 - added a parameter "runhealth" to allow antenna health
0010 % to be run optionally.  Run antenna health by default.
0011 %
0012 
0013 if(~exist('path_to_redscript','var'))
0014   path_to_redscript='reduc/redScript.red';
0015 end
0016 if(~exist('runhealth','var'))
0017   runhealth=1;
0018 end
0019 
0020 start_date_num = datenum(date_start);
0021 end_date_num = datenum(date_end);
0022 
0023 for i=0:(end_date_num - start_date_num)
0024     
0025     d_string = datestr(start_date_num + i);
0026     
0027     
0028     
0029     %try
0030     if (exist('sched_to_reduce','var'))
0031         disp(['period_reduce:: Will reduce ',d_string, ' ',output_stub,' ',path_to_redscript,' ',sched_to_reduce]);
0032         day_reduce(d_string,output_stub,path_to_redscript,sched_to_reduce,runhealth);
0033     else
0034         disp(['period_reduce:: Will reduce ',d_string, ' ',output_stub,' ',path_to_redscript]);
0035         day_reduce(d_string,output_stub,path_to_redscript);
0036     end;
0037     %catch exception
0038     %disp(['period_reduce:: FAILED TO REDUCE reduce ',d_string]);
0039     
0040     %end
0041     
0042 end;

Generated on Sun 14-Jun-2015 17:12:45 by m2html © 2005