示例#1
0
indexes, weights = TL.select(req)
nFrames = len(indexes)
SAT_3D = np.zeros((nFrames, jpj, jpi), np.float32)

for iFrame, k in enumerate(indexes):
    t = TL.Timelist[k]
    inputfile = INPUTDIR + t.strftime("%Y%m%d") + "_d-OC_CNR-L4-CHL-MedOC4_SAM_7KM-MED-REP-v02.nc"
    CHL = Sat.readfromfile(inputfile, "lchlm")
    SAT_3D[iFrame, :, :] = CHL

Sat2d = Sat.averager(SAT_3D)

masknan = TheMask.mask_at_level(0)
Sat2d[~masknan] = np.NaN
var = "SATchl"
layer = Layer(0, 10)

fig, ax = mapplot(
    {"varname": var, "clim": [0, 0.4], "layer": layer, "data": Sat2d, "date": "annual"},
    fig=None,
    ax=None,
    mask=TheMask,
    coastline_lon=clon,
    coastline_lat=clat,
)
ax.set_xlim([-5, 36])
ax.set_ylim([30, 46])
ax.set_xlabel("Lon").set_fontsize(12)
ax.set_ylabel("Lat").set_fontsize(12)
ax.ticklabel_format(fontsize=10)
ax.text(
示例#2
0
文件: preproc.py 项目: gbolzon/ogstm
print idate1

idate2 = timerequestors.Daily_req(year, month, day)
print idate2

# Variable name
VARLIST = ['P_l']  #'N3n','O2o']
read_adjusted = [True]  #,False,False]

# MASK of the domain
TheMask = Mask(
    "/pico/home/usera07ogs/a07ogs00/OPA/V2C/etc/static-data/MED1672_cut/MASK/meshmask.nc"
)
nav_lev = TheMask.zlevels

layer = Layer(0, 200)  #layer of the Float profile????
# new depth from 0 to 200 meters with 1 meter of resolution
NewPres = np.linspace(0, 200, 201)
dimnewpress = len(NewPres)  # data interpolated on the vertical Z

f = open(idate0 + "." + VARLIST[0] + "_arg_mis.dat", "w")  # OUTPUT x il 3DVAR

iniz = "     \n"
f.writelines(iniz)

# LIST of profiles for the selected variable in VARLIST
# in the interval idate1.time_interval in the mediterranean area
Profilelist_1 = bio_float.FloatSelector(LOVFLOATVARS[VARLIST[0]],
                                        idate1.time_interval, OGS.med)
TL = TimeList.fromfilenames(idate2.time_interval,
                            INPUTDIR,
示例#3
0
    iFrame = 0
    for k in indexes:
        t = TL.Timelist[k]
        inputfile = INPUTDIR + t.strftime("%Y%m%d") + \
                    "_d-OC_CNR-L4-CHL-MedOC4_SAM_7KM-MED-REP-v02.nc"
        print inputfile
        CHL = Sat.readfromfile(inputfile,'lchlm')
        SAT_3D[iFrame,:,:] = CHL
        iFrame +=1

    Sat2d=Sat.averager(SAT_3D)

    masknan=TheMask.mask_at_level(0)
    Sat2d[~masknan] = np.NaN
    var = 'SATchl'
    layer = Layer(0,10)

    fig,ax = mapplot({'varname':var, 'clim':[0,0.4], \
                      'layer':layer, 'data':Sat2d, 'date':'annual'}, \
                     fig=None,ax=None, \
                     mask=TheMask, \
                     coastline_lon=clon, \
                     coastline_lat=clat)
    ax.set_xlim([-5,36])
    ax.set_ylim([30,46])
    ax.set_xlabel('Lon').set_fontsize(12)
    ax.set_ylabel('Lat').set_fontsize(12)
    ax.ticklabel_format(fontsize=10)
    ax.text(-4,44.5,var + ' [mg /m^3]', \
            horizontalalignment='left', \
            verticalalignment='center', \