Ignore:
Timestamp:
16/08/10 14:35:38 (10 years ago)
Author:
astephen
Message:

Created new process that subsets pp files. Needs time and level and
forecast time added to the filtering. Then it also needs a clever way of
using the outputs of one process to populate the UI contents for another
process.

File:
1 edited

Legend:

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

    r7328 r7329  
    1616import process_modules.process_base 
    1717 
     18import process_modules.lib_subset_pp_file.utils as ppf_utils 
     19 
    1820# Import process-specific modules 
    19 sys.path.append("/usr/local/cwps/swarv/lib/python") 
    20 import pypp.pp_file 
     21#sys.path.append("/usr/local/cwps/swarv/lib/python") 
     22#import pypp.pp_file 
    2123 
    2224 
     
    6769            # Really generate output 
    6870            outputStashCodes = a["StashCodes"] 
     71            """ 
    6972            ppf = pypp.pp_file.PP_File(a["FilePath"]) 
    7073            fieldsToKeep = [] 
     
    7780                    fieldsToKeep.appends(h.stashcode) 
    7881                     
     82            """ 
    7983 
    80             size = os.path.getsize(outputFilePath) 
     84            nFields = ppf_utils.subsetPPFile(a["FilePath"], outputFilePath, a["StashCodes"]) 
    8185 
    8286            # Add the output list to the XML output section: ProcessSpecificContent 
    83             context.outputs['ProcessSpecificContent'] = {"PPFields": " ".join([str(f) for f in fieldsToKeep])} 
    84  
    85             fout = open(outputFilePath, "w") 
    86             fout.write("\n".join([str(i) for i in outputStashCodes])) 
    87             fout.close() 
     87            context.outputs['ProcessSpecificContent'] = {"NumberOfPPRecordMatches": nFields} 
    8888 
    8989            size = os.path.getsize(outputFilePath) 
Note: See TracChangeset for help on using the changeset viewer.