Changeset 241
- Timestamp:
- 10/03/08 15:15:09
- Files:
-
- scout/trunk/cdl_0master.pl (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
scout/trunk/cdl_0master.pl
r233 r241 1 1 ############################################################################### 2 2 # Revisions 3 # Rev: 1.2.0.0 4 # Author: DWR 5 # Changes: Added fixed-profiler processing via cdl_profiler_adcp.pl. 3 6 # Rev: 1.1.2.0 4 7 # Author: DWR … … 42 45 use Time::Local; 43 46 use obsKMLSubRoutines; 47 use Math::Trig; 44 48 45 49 use constant USE_DEBUG_PRINTS => 1; … … 59 63 do 'cdl_grid_jpl.pl'; 60 64 do 'cdl_fixed_map.pl'; 65 do 'cdl_fixed_profile_adcp.pl'; 66 do 'cdl_profiler_adcp.pl'; 61 67 62 68 # oldest incoming time stamp tolerated (14 days) … … 90 96 "Parameter 1 is an optional parameter. Valid values are: 0 Write only SQL files, 1 Write only obsKML file, or 2 Write both SQL files and obsKML file. Default value is 0.\n". 91 97 "Parameter 2 is the directory where the obsKML file is stored. If not provided the default directory is the current directory.\n". 92 "Parameter 3 is the optional number of last N time stamps to use.\n" 98 "Parameter 3 is the optional number of last N time stamps to use.\n" . 99 "Parameter 4 is the option organization/last N time stamps to use for organization. Format is \"Org1;NTimes,Org2,NTimes\"\n" 93 100 ); 94 101 } … … 113 120 $iLastNTimeStamps = @ARGV[3]; 114 121 } 115 } 122 #DWR v1.2.0.0 9/17/2008 123 if( @ARGV >= 5 ) 124 { 125 $strLastNTimeStampsPerOrg = @ARGV[4]; 126 } 127 } 128 129 #DWR v1.2.0.0 9/17/2008 130 my %UpdatePerOrg; 131 my $refUpdatePerOrg = \%UpdatePerOrg; 132 if( length( $strLastNTimeStampsPerOrg ) ) 133 { 134 my @OrgList = split( /\,/, $strLastNTimeStampsPerOrg ); 135 foreach my $Org (@OrgList) 136 { 137 my @Data = split( /\;/, $Org ); 138 $refUpdatePerOrg->{@Data[0]} = @Data[1]; 139 print( "Org: @Data[0] LastNUpdates: @Data[1]\n" ); 140 } 141 } 142 116 143 print( "---------------------------------------------------------------------------------------------------------\n" ); 117 print( "Command Line Args: net_cdf_file: $net_cdf_file FileType=$FileCreationOption ObsKMLPath=$strObsKMLFilePath LastNTimes=$iLastNTimeStamps\n" ); 144 print( "Command Line Args: net_cdf_file: $net_cdf_file FileType=$FileCreationOption ObsKMLPath=$strObsKMLFilePath LastNTimes=$iLastNTimeStamps LastNTimeStampsPerOrg=$strLastNTimeStampsPerOrg LastNTimeStampsPerOrg=$strLastNTimeStampsPerOrg\n" ); 145 my $strStartTime = `date +%s`; 146 print( "Start Time: $strStartTime\n" ); 118 147 # 119 148 # Turn off fatal error aborts. We need to allow some attributes to error out w/o crashing. … … 203 232 && !($format_category_value eq 'Seacoos_grid') 204 233 && !($format_category_value eq 'jpl_grid') 205 && !($format_category_value eq 'fixed-map')) {die "ABORT! $format_category_value is not a supported format.\n";} 234 && !($format_category_value eq 'fixed-map') 235 && !($format_category_value eq 'fixed-profiler')) {die "ABORT! $format_category_value is not a supported format.\n";} 206 236 207 237 # get latest timestamp for this station_id if there is one … … 234 264 } 235 265 } 236 # Added parameters $FileCreationOption and $strObsKMLFilePath. 237 #DWR v1.1.0.0 6/2/2008 238 #Added use of $iLastNTimeStamps. 239 #fixed_point_1($this_station_id_top_ts, $FileCreationOption, $strObsKMLDir, $iLastNTimeStamps ); 266 267 #DWR v1.2.0.0 9/17/2008 268 #Are we using per organization last N time stamps? If so see if this org is in the list. 269 if( length( $strLastNTimeStampsPerOrg ) ) 270 { 271 print( "Org code: $institution_code_value\n" ); 272 my $iNTimeStamps = -1; 273 if( exists $refUpdatePerOrg->{$institution_code_value} ) 274 { 275 $iNTimeStamps = $refUpdatePerOrg->{$institution_code_value}; 276 $iLastNTimeStamps = $iNTimeStamps; 277 print( "LastNTimeStamps: $iLastNTimeStamps\n" ); 278 } 279 } 240 280 fixed_point($this_station_id_top_ts, $FileCreationOption, $strObsKMLDir, $iLastNTimeStamps ); 281 } 282 elsif( $format_category_value eq 'fixed-profiler') 283 { 284 #Check to see if the institution specific directory exists. 285 my $strObsKMLDir = "$strObsKMLFilePath/profiler"; 286 if( ( -d "$strObsKMLDir" ) == 0 ) 287 { 288 if( mkdir( "$strObsKMLDir", 0777 ) == 0 ) 289 { 290 print( "ERROR::Unable to create directory: $strObsKMLDir.\n" ); 291 $strObsKMLDir = $strObsKMLFilePath; 292 } 293 else 294 { 295 print( "Created directory: $strObsKMLDir\n" ); 296 } 297 } 298 #Are we using per organization last N time stamps? If so see if this org is in the list. 299 if( length( $strLastNTimeStampsPerOrg ) ) 300 { 301 print( "Org code: $institution_code_value\n" ); 302 my $iNTimeStamps = -1; 303 if( exists $refUpdatePerOrg->{$institution_code_value} ) 304 { 305 $iNTimeStamps = $refUpdatePerOrg->{$institution_code_value}; 306 $iLastNTimeStamps = $iNTimeStamps; 307 print( "LastNTimeStamps: $iLastNTimeStamps\n" ); 308 } 309 } 310 fixed_profiler($this_station_id_top_ts, $FileCreationOption, $strObsKMLDir, $iLastNTimeStamps ); 241 311 } 242 312 elsif ($format_category_value eq 'moving-point-2D') { … … 252 322 fixed_map(); 253 323 } 324 325 my $strEndTime = `date +%s`; 326 print( "End Time: $strEndTime\n" );
