Exemplo n.º 1
0
    options, args = parser.parse_args()

    if options.variables is None:
        parser.error("Missing variables parameter")
    if options.time is None:
        parser.error("Missing time parameter")
    if options.coords is None:
        parser.error("Missing coords parameter")
    if options.bbox:
        bbox = options.bbox.split(",")
        if len(bbox) != 4:
            parser.error("Invalid bbox parameter: %s", options.bbox)
        lonmin, latmin, lonmax, latmax = map(float, bbox)
    if options.cfgfile:
        Object.load_default_config(options.cfgfile, nested=True)
        MARS3D.load_default_config(Object.get_default_config())

    variables = map(lambda v: v.split(","), options.variables)
    time = options.time.split(",")
    if len(time) == 4:
        tmin, tmax, tstep, ustep = time
        tbb = "co"
    elif len(time) == 5:
        tmin, tmax, tbb, tstep, ustep = time
    else:
        parser.error("Invalid time parameter")
    tstep = int(tstep)
    coords = options.coords.split(",")
    if len(coords) != 4:
        parser.error("Invalid coords parameter: %s", options.coords)
    xmin, ymin, xmax, ymax = map(float, coords)
Exemplo n.º 2
0
 colocs = ('nearest','interp')#colocs = (None,'nearest','interp')
 parser.add_option('--coloc', action='store', dest='coloc', default=None, choices=colocs, help='Use colocation method, one of %s, default is %%default)'%(colocs,))
 parser.add_option('-o', '--output', action='store', dest='output', default='layer-%(var)s-%(depth)s-%(tmin)s-%(tmax)s.png', metavar='pattern',  help='Output files pattern (default: %default)')
 parser.add_option('--show', action='store_true', dest='show', default=None, help='Show figures')
 options, args = parser.parse_args()
 
 if options.variables is None: parser.error('Missing variables parameter')
 if options.time is None: parser.error('Missing time parameter')
 if options.depth is None: parser.error('Missing depth parameter')
 if options.bbox:
     bbox = options.bbox.split(',')
     if len(bbox) != 4: parser.error('Invalid bbox parameter: %s', options.bbox)
     lonmin, latmin, lonmax, latmax = map(float, bbox)
 if options.cfgfile:
     Object.load_default_config(options.cfgfile, nested=True)
     MARS3D.load_default_config(Object.get_default_config())
     ProfilesDataset.load_default_config(Object.get_default_config())
 
 variables = map(lambda v:v.split(','), options.variables)
 depths = []
 for d in options.depth: depths.extend(d.split(','))
 time = options.time.split(',')
 if len(time) == 4: tmin, tmax, tstep, ustep = time; tbb = 'co'
 elif len(time) == 5: tmin, tmax, tbb, tstep, ustep = time
 else: parser.error('Invalid time parameter')
 tstep = int(tstep)
 # Force negative depth value
 print depths
 depths = map(lambda d: -abs(float(d)), depths)
 dtfmt = '%Y%m%dT%H%M%S'
 
Exemplo n.º 3
0
                      dest='show',
                      default=None,
                      help='Show figures')
    options, args = parser.parse_args()

    if options.variables is None: parser.error('Missing variables parameter')
    if options.time is None: parser.error('Missing time parameter')
    if options.depth is None: parser.error('Missing depth parameter')
    if options.bbox:
        bbox = options.bbox.split(',')
        if len(bbox) != 4:
            parser.error('Invalid bbox parameter: %s', options.bbox)
        lonmin, latmin, lonmax, latmax = map(float, bbox)
    if options.cfgfile:
        Object.load_default_config(options.cfgfile, nested=True)
        MARS3D.load_default_config(Object.get_default_config())
        ProfilesDataset.load_default_config(Object.get_default_config())

    variables = map(lambda v: v.split(','), options.variables)
    depths = []
    for d in options.depth:
        depths.extend(d.split(','))
    time = options.time.split(',')
    if len(time) == 4:
        tmin, tmax, tstep, ustep = time
        tbb = 'co'
    elif len(time) == 5:
        tmin, tmax, tbb, tstep, ustep = time
    else:
        parser.error('Invalid time parameter')
    tstep = int(tstep)
Exemplo n.º 4
0
 if options.variables is None: parser.error('Missing variables parameter')
 if options.time is None: parser.error('Missing time parameter')
 if options.coords is None: parser.error('Missing coords parameter')
 if options.bbox:
     bbox = options.bbox.split(',')
     if len(bbox) != 4: parser.error('Invalid bbox parameter: %s', options.bbox)
     lonmin, latmin, lonmax, latmax = map(float, bbox)
 if options.operations is None:
     options.operations = ops
     #parser.error('You must specify at least one operation command')
 if options.plots is None:
     #parser.error('You must specify at least one plot command')
     options.plots = plots
 if options.cfgfile:
     Object.load_default_config(options.cfgfile, nested=True)
     MARS3D.load_default_config(Object.get_default_config())
     Satellite.load_default_config(Object.get_default_config())
 
 variables = map(lambda v:v.split(','), options.variables)
 time = options.time.split(',')
 if len(time) == 4: tmin, tmax, tstep, ustep = time; tbb = 'co'
 elif len(time) == 5: tmin, tmax, tbb, tstep, ustep = time
 else: parser.error('Invalid time parameter')
 tstep = int(tstep)
 coords = options.coords.split(',')
 if len(coords) != 3: parser.error('Invalid coords parameter: %s', options.coords)
 xymin, xymax, xy = map(float, coords)
 dtfmt = '%Y%m%dT%H%M%S'
 
 mars = MARS3D()
 sat = Satellite()
Exemplo n.º 5
0
                      dest='show',
                      default=None,
                      help='Show figures')
    options, args = parser.parse_args()

    if options.variables is None: parser.error('Missing variables parameter')
    if options.time is None: parser.error('Missing time parameter')
    if options.coords is None: parser.error('Missing coords parameter')
    if options.bbox:
        bbox = options.bbox.split(',')
        if len(bbox) != 4:
            parser.error('Invalid bbox parameter: %s', options.bbox)
        lonmin, latmin, lonmax, latmax = map(float, bbox)
    if options.cfgfile:
        Object.load_default_config(options.cfgfile, nested=True)
        Mars3D.load_default_config(Object.get_default_config())

    variables = map(lambda v: v.split(','), options.variables)
    time = options.time.split(',')
    if len(time) == 4:
        tmin, tmax, tstep, ustep = time
        tbb = 'co'
    elif len(time) == 5:
        tmin, tmax, tbb, tstep, ustep = time
    else:
        parser.error('Invalid time parameter')
    tstep = int(tstep)
    coords = options.coords.split(',')
    if len(coords) != 3:
        parser.error('Invalid coords parameter: %s', options.coords)
    xymin, xymax, xy = map(float, coords)