示例#1
0
文件: sat.py 项目: inogs/bit.sea
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)
    
    
    


示例#2
0
文件: averager.py 项目: inogs/bit.sea
        filelist=[]
        for k in indexes:
            t = TL.Timelist[k]
            filename = INPUTDIR + "ave." + t.strftime("%Y%m%d-%H:%M:%S") + "." + var + ".nc"
            filelist.append(filename)
        # ----------------------------------------------------------

        M3d = TimeAverager3D(filelist, weights, var, TheMask)
        for layer in LAYERLIST:
            print layer
            De         = DataExtractor(TheMask,rawdata=M3d)
            integrated = MapBuilder.get_layer_average(De, layer)
            clim = [M3d[TheMask.mask].min(), M3d[TheMask.mask].max()]
            fig,ax     = mapplot({'varname':var, 'clim':clim, 'layer':layer, 'data':integrated, 'date':req.string},fig=None,ax=None,mask=TheMask)
            outfile    = OUTPUTDIR + prefix + '.' +  var + "." + layer.longname() +  ".nc"
            netcdf3.write_2d_file(integrated,var,outfile,TheMask)
            outfile    = OUTPUTDIR + var + "." + prefix  +  "." + layer.longname() +  ".png"
            fig.savefig(outfile)
            pl.close(fig)







# Now, the whole year
import commons.timerequestors as requestors
MY_YEAR = TimeInterval('20140401','20150401',"%Y%m%d")
req = requestors.Generic_req(MY_YEAR)
indexes,weights = TL.select(req)