sat_archive="/gss/gss_work/DRES_OGS_BiGe/Observations/TIME_RAW_DATA/ONLINE/SAT/MODIS/DAILY/CHECKED/" DAILY_SAT_LIST=TS.get_daily_sat(forecasts_sublist,sat_archive) # float aggregator already done by others day=0 surf_layer=Layer(0,10) for time,archived_file,satfile in DAILY_SAT_LIST: avefile=INPUTDIR + os.path.basename(archived_file)[:-3] day=day+1 outfile=OUTDIR + "misfit+%dh.nc" % (day*24) print avefile continue Sat16 = Sat.convertinV4format( Sat.readfromfile(satfile) ) De = DataExtractor(TheMask,filename=avefile, varname='P_i') Model = MapBuilder.get_layer_average(De, surf_layer) Misfit = Sat16-Model cloudsLand = (np.isnan(Sat16)) #| (Sat16 > 1.e19) | (Sat16<0) modelLand = np.isnan(Model) #lands are nan nodata = cloudsLand | modelLand selection = ~nodata # & TheMask.mask_at_level(200.0) Misfit[nodata] = np.NaN netcdf3.write_2d_file(Misfit, 'chl_misfit', outfile, TheMask)
VARCONV=CONVERSION_DICT[var] # setting up filelist for requested period ----------------- filelist=[] for k in indexes: t = TL.Timelist[k] filename = INPUTDIR + "ave." + t.strftime("%Y%m%d-%H:%M:%S") + ".nc" print filename filelist.append(filename) # ---------------------------------------------------------- M3d = TimeAverager3D(filelist, weights, var, TheMask) for il,layer in enumerate(LAYERLIST): De = DataExtractor(TheMask,rawdata=M3d) if args.optype=='integral': integrated = MapBuilder.get_layer_integral(De, layer) else: integrated = MapBuilder.get_layer_average(De, layer) integrated=integrated * VARCONV # mask200=TheMask.mask_at_level(200) mask200=TheMask.mask_at_level(LIMIT_PER_MASK[il]) # clim = [M3d[TheMask.mask].min(), M3d[TheMask.mask].max()] clim=CLIM_DICT[var] integrated200=integrated*mask200 # taglio il costiero integrated200[integrated200==0]=np.nan # sostituisco gli 0 con i NAN #pl.set_cmap('gray_r') #changes the colormap fig,ax = mapplot({'varname':var, 'clim':clim, 'layer':layer, 'data':integrated200, 'date':''},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)