Exemplo n.º 1
0
 def _registerAccessClasses(self):
     SeasonalProjectFactory._registerAccessClasses(self)
     self._registerTempsFileAccessClasses()
Exemplo n.º 2
0
 def __init__(self, config=CONFIG, registry=REGISTRY, alt_server_url=None):
     SeasonalProjectFactory.__init__(self, config, registry)
     if alt_server_url is None: self.initNDFD()
     else: self.initNDFD(alt_server_url)
Exemplo n.º 3
0
from optparse import OptionParser
parser = OptionParser()

parser.add_option('-r', action='store', dest='region', default=None)
parser.add_option('-s', action='store', dest='source', default=None)
parser.add_option('-v', action='store_true', dest='verbose', default=False)
parser.add_option('-z', action='store_true', dest='debug', default=False)

options, args = parser.parse_args()

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

debug = options.debug
verbose = options.verbose

factory = SeasonalProjectFactory()
project = factory.getProjectConfig()

region = options.region
if region is None: region = project.region
if len(region) == 2: region = region.upper()

source = options.source
if source is None: source = project.source

if len(args) == 0: target_year = BUILD_START_TIME.year
elif len(args) > 0: target_year = int(args[0])

# filter annoying numpy warnings
warnings.filterwarnings('ignore', "All-NaN axis encountered")
warnings.filterwarnings('ignore', "All-NaN slice encountered")
Exemplo n.º 4
0
 def _registerAccessClasses(self):
     SeasonalProjectFactory._registerAccessClasses(self)
Exemplo n.º 5
0
 def __init__(self, config=CONFIG, registry=REGISTRY):
     SeasonalProjectFactory.__init__(self, config, registry)
     self._initTurfFactory_()
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

from optparse import OptionParser
parser = OptionParser()

parser.add_option('-v', action='store_true', dest='verbose', default=False)
parser.add_option('-z', action='store_true', dest='debug', default=False)

options, args = parser.parse_args()

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #

debug = options.debug
verbose = options.verbose

factory = SeasonalProjectFactory()
project = factory.getProjectConfig()
if verbose:
    print 'project :\n', project

source_key = args[0]
source = factory.getSourceConfig(source_key)

region_key = args[1]
if len(region_key) == 2: region_key = region_key.upper()
region = factory.getRegionConfig(region_key)
bbox = region.data
if verbose:
    print '\nregion :\n', region
    print '\nbbox', bbox