def test_indices(): assert 'TG' in indices.indices()
def __init__(self): WPSProcess.__init__( self, identifier="indices_simple", title="Climate indices -- Simple", version="0.9", abstract="Climate indices based on one single input variable.", metadata=[ {'title': 'Documentation', 'href': 'http://flyingpigeon.readthedocs.io/en/latest/descriptions/index.html#climate-indices'}, {"title": "ICCLIM" , "href": "http://icclim.readthedocs.io/en/latest/"}, {"title": "Simple Indices", "href": "http://flyingpigeon.readthedocs.io/en/latest/descriptions/indices.html"} ], statusSupported=True, storeSupported=True ) self.resource = self.addComplexInput( identifier="resource", title="Resouce", abstract="NetCDF File", minOccurs=1, maxOccurs=100, maxmegabites=5000, formats=[{"mimeType": "application/x-netcdf"}], ) self.groupings = self.addLiteralInput( identifier="groupings", title="Grouping", abstract="Select an time grouping (time aggregation)", default='yr', type=type(''), minOccurs=1, maxOccurs=len(GROUPING), allowedValues=GROUPING ) self.indices = self.addLiteralInput( identifier="indices", title="Index", abstract=indices_description(), default='SU', type=type(''), minOccurs=1, maxOccurs=len(indices()), allowedValues=indices() ) self.polygons = self.addLiteralInput( identifier="polygons", title="Country subset", abstract=str(countries_longname()), type=type(''), minOccurs=0, maxOccurs=len(countries()), allowedValues=countries() ) self.mosaic = self.addLiteralInput( identifier="mosaic", title="Mosaic", abstract="If Mosaic is checked, selected polygons be clipped as a mosaic for each input file", default=False, type=type(False), minOccurs=0, maxOccurs=1, ) # complex output # ------------- self.output = self.addComplexOutput( identifier="output", title="Index", abstract="Calculated index as NetCDF file", metadata=[], formats=[{"mimeType": "application/x-tar"}], asReference=True ) self.output_netcdf = self.addComplexOutput( title="one dataset as example", abstract="NetCDF file to be dispayed on WMS", formats=[{"mimeType":"application/x-netcdf"}], asReference=True, identifier="ncout", )
def __init__(self): inputs = [ ComplexInput('resource', 'Resource', abstract="NetCDF Files or archive (tar/zip) containing netCDF files.", min_occurs=1, max_occurs=1000, # maxmegabites=5000, supported_formats=[ Format('application/x-netcdf'), Format('application/x-tar'), Format('application/zip'), ]), LiteralInput("indices", "Index", abstract='Climate index code.', default='TG', data_type='string', min_occurs=1, max_occurs=1, allowed_values=indices() ), LiteralInput("grouping", "Grouping", abstract="Temporal group over which the index is computed.", default='yr', data_type='string', min_occurs=1, max_occurs=1, # len(GROUPING), allowed_values=GROUPING ), LiteralInput('region', 'Region', data_type='string', # abstract= countries_longname(), # need to handle special non-ascii char in countries. abstract="Country code, see ISO-3166-3:\ https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3#Officially_assigned_code_elements", min_occurs=0, max_occurs=len(countries()), # default='DEU', allowed_values=countries()), # REGION_EUROPE #COUNTRIES LiteralInput("mosaic", "Mosaic", abstract="If Mosaic is checked, selected polygons be clipped as a mosaic for each input file", default='0', data_type='boolean', min_occurs=0, max_occurs=1, ), ] outputs = [ ComplexOutput("output_archive", "Tar archive", abstract="Tar archive of the netCDF files storing the index values.", supported_formats=[Format("application/x-tar")], as_reference=True, ), ComplexOutput('ncout', 'Example netCDF file', abstract="NetCDF file storing the index computed over one dataset.", as_reference=True, supported_formats=[Format('application/x-netcdf')] ), ComplexOutput('output_log', 'Logging information', abstract="Collected logs during process run.", as_reference=True, supported_formats=[Format("text/plain")]) ] super(IndicessingleProcess, self).__init__( self._handler, identifier="indices_single", title="Climate indices (Single variable)", version="0.10", abstract="Climate index calculated from one daily input variable.", metadata=[ {'title': 'Doc', 'href': 'http://flyingpigeon.readthedocs.io/en/latest/descriptions/\ index.html#climate-indices'}, {"title": "ICCLIM", "href": "http://icclim.readthedocs.io/en/latest/"}, {"title": "Percentile-based indices", "href": "http://flyingpigeon.readthedocs.io/en/\ latest/descriptions/indices.html#percentile-based-indices"}, ], inputs=inputs, outputs=outputs, status_supported=True, store_supported=True )
def test_indices(self): nose.tools.ok_( 'TG' in indices.indices(), indices.indices() )
def __init__(self): WPSProcess.__init__( self, identifier = "indices_single", title="Calculation of climate indice (single variable)", version = "0.3", abstract="This process calculates climate indices based on one single variable.", statusSupported=True, storeSupported=True ) self.resource = self.addComplexInput( identifier="resource", title="Resouce", abstract="NetCDF File", minOccurs=1, maxOccurs=100, maxmegabites=5000, formats=[{"mimeType":"application/x-netcdf"}], ) self.groupings = self.addLiteralInput( identifier="groupings", title="Grouping", abstract="Select an time grouping (time aggregation)", default='yr', type=type(''), minOccurs=1, maxOccurs=len(GROUPING), allowedValues=GROUPING ) self.indices = self.addLiteralInput( identifier="indices", title="Indice", abstract=indices_description(), default='SU', type=type(''), minOccurs=1, maxOccurs=len(indices()), allowedValues=indices() ) self.polygons = self.addLiteralInput( identifier="polygons", title="Country subset", abstract= countries_longname(), #default='FRA', type=type(''), minOccurs=0, maxOccurs=len(countries()), allowedValues=countries() ) # complex output # ------------- self.output = self.addComplexOutput( identifier="output", title="Indice", abstract="Calculated indice as NetCDF file", metadata=[], formats=[{"mimeType":"application/x-netcdf"}], asReference=True )