Changeset 7613


Ignore:
Timestamp:
18/10/10 10:59:49 (9 years ago)
Author:
astephen
Message:

removed keeping of non-zip outputs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cows_wps/trunk/process_modules/extract_uk_station_data.py

    r7105 r7613  
    104104            # In this case we set keep = True so that weather station file is accessible to downstream process 
    105105            # without unzipping. This is fine as files are small. 
    106             process_support.finishProcess(context, self.fileSet, self.startTime, keep = True) 
     106            process_support.finishProcess(context, self.fileSet, self.startTime, keep = False) 
    107107 
    108108        else: 
     
    137137        stationsFilePath = os.path.join(context.processDir, "outputs", stationsFile) 
    138138 
    139         if not dry_run: 
    140  
    141             if stationList == None: 
    142                 # Call code to get Weather Stations 
    143                 stationList = gws_utils.getStationList(a["Counties"], a["BBox"], a["DataTypes"], a["StartDateTime"], 
     139  #      if not dry_run: 
     140        if stationList == None: 
     141             # Call code to get Weather Stations 
     142            stationList = gws_utils.getStationList(a["Counties"], a["BBox"], a["DataTypes"], a["StartDateTime"], 
    144143                           a["EndDateTime"], stationsFilePath) 
    145144 
    146             # Write the file one per station id per line 
    147             stationList.sort() 
     145        # Write the file one per station id per line 
     146        stationList.sort() 
    148147 
    149             fout = open(stationsFilePath, "w") 
    150             fout.write("\r\n".join([str(station) for station in stationList])) 
    151             fout.close() 
     148        fout = open(stationsFilePath, "w") 
     149        fout.write("\r\n".join([str(station) for station in stationList])) 
     150        fout.close() 
    152151 
    153             # Add the stations list to the XML output section: ProcessSpecificContent 
    154             context.outputs['ProcessSpecificContent'] = {"WeatherStations": " ".join(stationList)} 
     152        # Add the stations list to the XML output section: ProcessSpecificContent 
     153        context.outputs['ProcessSpecificContent'] = {"WeatherStations": " ".join(stationList)} 
    155154 
    156             # Add file to outputs 
    157             self._addFileToOutputs(stationsFilePath, 'Weather Stations File') 
    158  
    159         else: 
    160  
    161             # Estimate size of outputs by estimating the number of stations 
    162             if len(a["Counties"]) > 0: 
    163                 nEstimatedStations = len(a["Counties"]) * 20  
    164             elif a["BBox"]: 
    165                 (w, s, e, n) = a["BBox"] 
    166                 lonExtent = abs(e - w) 
    167                 latExtent = n - s 
    168                 nEstimatedStations = int(lonExtent * latExtent * 100) 
    169             else: 
    170                 nEstimatedStations = len(stationList) 
    171  
    172             estimatedVolume = nEstimatedStations * 5 
    173             self._addFileToOutputs(stationsFilePath, 'Weather Stations File', size = estimatedVolume) 
    174  
    175             # Make up a station list 
    176             stationList = [-1] * nEstimatedStations 
     155        # Add file to outputs 
     156        self._addFileToOutputs(stationsFilePath, 'Weather Stations File') 
    177157 
    178158        return stationList 
Note: See TracChangeset for help on using the changeset viewer.