Changeset 255

Show
Ignore:
Timestamp:
09/22/09 13:45:05
Author:
dan
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • scout/trunk/GetLatestData.pl

    r246 r255  
    3232            "DirForObsKml:s",       #Optional. If we want the script to convert the netcdfs to obskml, this is the directory we store the obskml. 
    3333            "Delete:s",             #Optional. If we are converting to obsKML and want to get rid of the netcdfs afterwards, set this to yes. 
    34             "DownloadDir:s",        #Optional. Directory to store the downloaded netcdf files in. Default is ./latest_netcdf_files. 
     34            "NetCDFDir:s",          #Optional. Directory to store the downloaded netcdf files in. Default is ./latest_netcdf_files. 
    3535            "FetchLogDir:s",        #Optional. Directory for log files we use to determine what the new netcdf files are to download. Default is ./fetch_logs. 
    3636            "UseLastNTimeStamps:s",  #Optional. Integer representing the last N time entries to use when converting the data to obsKML. DWR v1.1.0.0 6/2/2008 
     
    5555              "--DirForObsKml provides the path to the store the ObsKML files created. This is an optional argument, if not provided no ObsKML files are written.\n".              
    5656              "--Delete specifies we delete the netcdf files after we write the ObsKML files. This is an optional argument.\n". 
    57               "--DownloadDir is the directory to store the downloaded files. Optional, default is ./latest_netcdf_files.\n". 
     57              "--NetCDFDir is the directory to store the downloaded files. Optional, default is ./latest_netcdf_files.\n". 
    5858              "--FetchLogDir is the directory were the file time stamps are stored. The script uses these files to determine which files are really the latest. Optional, default is ./fetch_logs.\n". 
    5959              "--UseLastNTimeStamps Integer representing the last N time entries to use when converting the data to obsKML. Optional.\n". 
     
    125125#Remove the conversion log. We do this since the log gets concatenated every run, so it will get huge fast. 
    126126#We just keep the log of the last run. 
    127 if( !MICROSOFT_PLATFORM ) 
    128 
    129   my $cmd = "rm /home/dramage/log/cdl_0master.log"; 
    130   print( "Remove Log: $cmd\n" ); 
    131   `$cmd`;       
    132   #Open up a new log file. 
    133   $cmd = "echo cdl_0master log opened >> /home/dramage/log/cdl_0master.log"; 
    134   `$cmd`; 
    135 
     127#if( !MICROSOFT_PLATFORM ) 
     128#
     129#  my $cmd = "rm /home/dramage/log/cdl_0master.log"; 
     130#  print( "Remove Log: $cmd\n" ); 
     131#  `$cmd`;       
     132#  #Open up a new log file. 
     133#  $cmd = "echo cdl_0master log opened >> /home/dramage/log/cdl_0master.log"; 
     134#  `$cmd`; 
     135#
    136136 
    137137my $bProcessNetCDF = 0; 
     
    260260          #DWR v1.1.0.0 6/2/2008  
    261261          #Added the passing of $strLastNTimeStamps onto the command line. 
    262           $cmd = "cd /home/dramage/netcdf; /usr/bin/perl /home/dramage/netcdf/cdl_0master.pl $strDestFile 1 $strDirForObsKml $strLastNTimeStamps \"$strLastNTimeStampsPerOrg\" >> /home/dramage/log/cdl_0master.log 2>&1"; 
     262          #$cmd = "cd /home/dramage/netcdf; /usr/bin/perl /home/dramage/netcdf/cdl_0master.pl $strDestFile 1 $strDirForObsKml $strLastNTimeStamps \"$strLastNTimeStampsPerOrg\" >> /home/dramage/log/cdl_0master.log 2>&1"; 
     263          $cmd = "/usr/bin/perl cdl_0master.pl $strDestFile 1 $strDirForObsKml $strLastNTimeStamps \"$strLastNTimeStampsPerOrg\""; 
    263264          print( "\tObsKML Script: $cmd\n" ); 
    264265          `$cmd`;       
     
    353354    # (0) Get html document 
    354355    my $doc = get($path); 
    355  
     356     
    356357    # (1) Screen scrape http for href lines 
    357358    my @all_href = $doc =~ m{href\s*=[\s|"]*(.*?)[\s|"]*>}gi; 
    358    
     359        
    359360    # (2) further limit with users pattern 
    360361    my @matched = grep /$pattern$/, @all_href;