Ignore:
Timestamp:
20/05/10 10:45:21 (10 years ago)
Author:
astephen
Message:

Added and updated various code to match security, download URLs that are
secured and chunking of MIDAS outputs.

File:
1 edited

Legend:

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

    r6124 r6873  
    1515from cows_wps.process_handler.context.process_status import STATUS 
    1616 
     17#sys.path.append("/usr/local/cwps/cows_wps") 
     18import process_modules.lib_get_weather_stations.utils as gws_utils 
     19 
    1720# Import local modules 
    18 sys.path.append("/home/badc/software/datasets/ukmo-midas/scripts/extract") 
     21#sys.path.append("/home/badc/software/datasets/ukmo-midas/scripts/extract") 
    1922# MIDAS Station search code 
    20 import getStations 
     23#import getStations 
    2124 
    2225log = logging.getLogger(__name__) 
     
    4043        DataTypes = context.inputs.get("DataTypes", []) 
    4144        StartDateTime = context.inputs['StartDateTime'] 
    42         StartDateTime = self._revertDateTimeToLongString(StartDateTime) 
     45        StartDateTime = gws_utils.revertDateTimeToLongString(StartDateTime) 
    4346        log.warn("DATE TIME: %s, type = %s" % (StartDateTime, type(StartDateTime))) 
    4447        EndDateTime = context.inputs['EndDateTime'] 
    45         EndDateTime = self._revertDateTimeToLongString(EndDateTime) 
     48        EndDateTime = gws_utils.revertDateTimeToLongString(EndDateTime) 
    4649         
    4750        context.setStatus(STATUS.STARTED, 'Job is now running', 0) 
     
    5558 
    5659        # Call code to get Weather Stations 
    57         st_getter = getStations.StationIDGetter(Counties, bbox=BBox, dataTypes=DataTypes,  
    58                        startTime=StartDateTime, endTime=EndDateTime, outputFile=MyFilePath, noprint=1)  
     60        station_list = gws_utils.getStationList(Counties, BBox, DataTypes, StartDateTime, 
     61                           EndDateTime, MyFilePath) 
     62#        st_getter = getStations.StationIDGetter(Counties, bbox=BBox, dataTypes=DataTypes,  
     63#                       startTime=StartDateTime, endTime=EndDateTime, outputFile=MyFilePath, noprint=1)  
    5964 
    6065        context.outputs['ProcessSpecificContent'] = { 
    61                                     "WeatherStations": " ".join(st_getter.stList)}  
     66                                    "WeatherStations": " ".join(station_list)}  
    6267 
    6368        context.log.info('Written output file: %s' % WFile) 
     
    7277        ddp_process_support.updateJobDetailsAfterCompletion(context, startTime, completionTime) 
    7378 
    74     def _revertDateTimeToLongString(self, dt): 
    75         """ 
    76         Turns a date/time into a long string as needed by midas code. 
    77         """ 
    78         return str(dt).replace("-", "").replace(" ", "").replace("T", "").replace(":", "")  
    7979 
    8080    def dryRun(self, context): 
Note: See TracChangeset for help on using the changeset viewer.