Пример #1
0
    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)
    dtfmt = "%Y%m%dT%H%M%S"

    mars = MARS3D()
    if options.cfgfile:
        mars.load_default_config(options.cfgfile, nested=True)
        mars.load_config(options.cfgfile, nested=True)

    for varname in variables:
        log.notice("Variable %s", varname)

        for itv in Intervals((tmin, tmax, tbb), (tstep, ustep)):
            log.notice("Interval %s", itv)
            select = dict(time=itv[:2])
            if options.level:
                select["level"] = slice(*map(int, options.level.split(",")))
            if options.bbox:
                select.update(dict(latitude=(latmin, latmax), longitude=(lonmin, lonmax)))
            pylab.figure()
            try:
                sec = mars.plot_section(
                    varname=varname,
                    select=select,
                    xmin=xmin,
                    ymin=ymin,
Пример #2
0
 dtfmt = '%Y%m%dT%H%M%S'
 
 mars = MARS3D()
 profiles = ProfilesDataset()
 if options.cfgfile: 
     mars.load_default_config(options.cfgfile, nested=True)
     profiles.load_default_config(options.cfgfile, nested=True)
     mars.load_config(options.cfgfile, nested=True)
     profiles.load_config(options.cfgfile, nested=True)
 if not options.bbox:
     #mars_grid = mars.get_grid()
     lat, lon = mars.get_latitude(), mars.get_longitude()
     lonmin, latmin, lonmax, latmax = min(lon), min(lat), max(lon), max(lat)
 
 for varname in variables:
     log.notice('Variable %s', varname)
     
     for depth in depths:
     
         for itv in Intervals((tmin, tmax, tbb),(tstep, ustep)):
             log.notice('Interval %s', itv)
             
             plotkw = dict(plot_show=False)
             select = dict(time=itv[:2], latitude=(latmin,latmax,'ccb'), longitude=(lonmin,lonmax,'ccb'))
             
             if not options.coloc:
             
                 pylab.figure()
                 try:
                     mp = mars.plot_layer(varname=varname, depth=depth, select=select, **plotkw)
                     plotkw['map'] = mp
Пример #3
0
 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()
 if options.cfgfile:
     mars.load_default_config(options.cfgfile, nested=True)
     sat.load_default_config(options.cfgfile, nested=True)
     mars.load_config(options.cfgfile, nested=True)
     sat.load_config(options.cfgfile, nested=True)
 
 for varname in variables:
     log.notice('Variable %s', varname)
     
     for itv in Intervals((tmin, tmax, tbb),(tstep, ustep)):
         log.notice('Interval %s', itv)
         
         select = dict(time=itv[:2])
         if options.bbox: select.update(dict(latitude=(latmin,latmax), longitude=(lonmin,lonmax)))
         datakw = dict(
             varname=('temperature', 'TEMP'),
             select=select,
             xorymin=xymin, xorymax=xymax, xory=xy, meridonal=options.meridional,
             cur_axes_rect=[0.1, 0.1, 0.6, 0.7], map_axes_rect=[0.75, 0.1, 0.2, 0.3],
             plot_show=False)
         
         if options.meridional:
             lat = ([xymin], [xymax])
Пример #4
0
    dtfmt = '%Y%m%dT%H%M%S'

    mars = MARS3D()
    profiles = ProfilesDataset()
    if options.cfgfile:
        mars.load_default_config(options.cfgfile, nested=True)
        profiles.load_default_config(options.cfgfile, nested=True)
        mars.load_config(options.cfgfile, nested=True)
        profiles.load_config(options.cfgfile, nested=True)
    if not options.bbox:
        #mars_grid = mars.get_grid()
        lat, lon = mars.get_latitude(), mars.get_longitude()
        lonmin, latmin, lonmax, latmax = min(lon), min(lat), max(lon), max(lat)

    for varname in variables:
        log.notice('Variable %s', varname)

        for depth in depths:

            for itv in Intervals((tmin, tmax, tbb), (tstep, ustep)):
                log.notice('Interval %s', itv)

                plotkw = dict(plot_show=False)
                select = dict(time=itv[:2],
                              latitude=(latmin, latmax, 'ccb'),
                              longitude=(lonmin, lonmax, 'ccb'))

                if not options.coloc:

                    pylab.figure()
                    try:
Пример #5
0
    select = dict()

    mars = MARS3D()
    profiles = ProfilesDataset()
    if options.cfgfile:
        mars.load_default_config(options.cfgfile, nested=True)
        profiles.load_default_config(options.cfgfile, nested=True)
        mars.load_config(options.cfgfile, nested=True)
        profiles.load_config(options.cfgfile, nested=True)
    if not options.bbox:
        #mars_grid = mars.get_grid()
        lat, lon = mars.get_latitude(), mars.get_longitude()
        lonmin, latmin, lonmax, latmax = min(lon), min(lat), max(lon), max(lat)

    for itv in Intervals((tmin, tmax, tbb), (tstep, ustep)):
        log.notice('Interval %s', itv)

        select = dict(time=itv,
                      latitude=(latmin, latmax, 'ccb'),
                      longitude=(lonmin, lonmax, 'ccb'))
        plotkw = dict(plot_show=False)

        # ==========
        # Methode 1. Tracé des observations (points) sur fond 2D grillés de champs de modèles moyennés sur la période choisie.
        if not options.coloc:

            if 'mld' in options.plots:
                pylab.figure()
                kw = plotkw.copy()
                m = c = None
                try:
Пример #6
0
 select=dict()
 
 mars = MARS3D()
 profiles = ProfilesDataset()
 if options.cfgfile: 
     mars.load_default_config(options.cfgfile, nested=True)
     profiles.load_default_config(options.cfgfile, nested=True)
     mars.load_config(options.cfgfile, nested=True)
     profiles.load_config(options.cfgfile, nested=True)
 if not options.bbox:
     #mars_grid = mars.get_grid()
     lat, lon = mars.get_latitude(), mars.get_longitude()
     lonmin, latmin, lonmax, latmax = min(lon), min(lat), max(lon), max(lat)
 
 for itv in Intervals((tmin, tmax, tbb),(tstep, ustep)):
     log.notice('Interval %s', itv)
     
     select = dict(time=itv, latitude=(latmin,latmax,'ccb'), longitude=(lonmin,lonmax,'ccb'))
     plotkw = dict(plot_show=False)
     
     # ==========
     # Methode 1. Tracé des observations (points) sur fond 2D grillés de champs de modèles moyennés sur la période choisie.
     if not options.coloc:
         
         if 'mld' in options.plots:
             pylab.figure()
             kw = plotkw.copy()
             m = c = None
             try: m,c = mars.plot_mld(select, **kw)
             except: log.exception('Cannot plot mars mld')
             kw.update(map=m, cmap=c)