Ignore:
Timestamp:
19/06/07 09:26:37 (12 years ago)
Author:
domlowe
Message:

adding option to publish netcdf file in public directory, off by default

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/trunk/ows_server/ows_server/lib/csml_util.py

    r2599 r2603  
    3939 
    4040         
    41 def extractToNetCDF(feature, sel): 
     41def extractToNetCDF(feature, sel, publish=False): 
    4242    """ 
    4343       performs the CSML subset and returns a filename of the netcdf extract 
     44       publish flag is used to indicate that the netcdf file should be made available to the webserver (for asynchronous delivery) 
    4445    """ 
    4546    # Get temporary extract dir 
     
    5051    feature.subsetToGridSeries(ncname=os.path.basename(filename), 
    5152                               outputdir=os.path.dirname(filename) ,**sel) 
     53     
     54    #if publishing to download directory is required, do so and return publishable file name 
     55    #used e.g. in WCS when "STORE = true" 
     56    if publish !=False: 
     57        publish_dir=request.environ['paste.config']['app_conf']['publish_dir'] 
     58        #copy file from tmp_dir to publish directory 
     59        publishedName=publish_dir +'/'+os.path.basename(filename) 
     60        os.system ("cp %s %s" % (filename, publishedName)) 
     61        return publishedName 
    5262    return filename 
    5363         
Note: See TracChangeset for help on using the changeset viewer.