Exemplo n.º 1
0
    def _read_osi_2(self,dadate,basemap):

        day = self.day
        month = self.month
        year = self.year
        dadate2 = datetime.date(int(year),int(month),int(day))+datetime.timedelta(1)
        dadate2 = dadate2.strftime('%Y%m%d')
        # Read in OSI_SAF file
        outdir = '/work/timill/giacomo/osisaf_repo'
        ncfil = outdir+'/ice_conc_nh_polstere-100_multi_'+dadate2+'1200.nc'
        clon = 'lon'
        clat = 'lat'
        cconc = 'ice_conc'
        lonO = Mrdg.nc_get_var(ncfil,clon) # lon[:,:] is a numpy array
        latO = Mrdg.nc_get_var(ncfil,clat) # lat[:,:] is a numpy array
        conc = Mrdg.nc_get_var(ncfil,cconc,time_index=0)
        xc = Mrdg.nc_get_var(ncfil,'xc')
        yc = Mrdg.nc_get_var(ncfil,'yc')

        X2,Y2 = basemap(lonO[:,:],latO[:,:],inverse=False)
        XO = np.copy(X2)
        YO = np.copy(Y2)

        Z2 = conc[:,:]
        ZO = Z2/100

        self.lonO2 = lonO[:,:]
        self.latO2 = latO[:,:]
        self.XO2 = XO[:,:]
        self.YO2 = YO[:,:]
        self.ZCO2 = ZO

        print('OSI-SAF plus 1 day: lonO2,latO2,XO2,YO2,ZCO2')
        
        return()
Exemplo n.º 2
0
    def _read_osi_(self,dadate,basemap):
        day = self.day
        month = self.month
        year = self.year
        # Read in OSI_SAF file
        outdir = '/work/timill/giacomo/osisaf_repo'
        ncfil = outdir+'/ice_conc_nh_polstere-100_multi_'+dadate+'1200.nc'
        clon = 'lon'
        clat = 'lat'
        cconc = 'ice_conc'
        lonO = Mrdg.nc_get_var(ncfil,clon) # lon[:,:] is a numpy array
        latO = Mrdg.nc_get_var(ncfil,clat) # lat[:,:] is a numpy array
        conc = Mrdg.nc_get_var(ncfil,cconc,time_index=0)
        xc = Mrdg.nc_get_var(ncfil,'xc')
        yc = Mrdg.nc_get_var(ncfil,'yc')

        X2,Y2 = basemap(lonO[:,:],latO[:,:],inverse=False)
        XO = np.copy(X2)
        YO = np.copy(Y2)

        Z2 = conc[:,:]
        ZO = Z2/100

        self.lonO = lonO[:,:]
        self.latO = latO[:,:]
        self.XO = XO[:,:]
        self.YO = YO[:,:]
        self.ZO = ZO

        print('OSI-SAF: lonO,latO,XO,YO,ZO')
        
        return() 
Exemplo n.º 3
0
 def _read_mdl_(self,dadate,basemap):
 
     #TODO
     # work on the binary reader, for now *.nc will be used 
 
     # NetCDF reader 
     day = self.day
     month = self.month
     year = self.year
     # Read TP4arch_wav
     #outdir = '/work/timill/RealTime_Models/results/TP4a0.12/wavesice/work/'+dadate+'/netcdf/'
     outdir = './tmp/MDL'
     ncfil = outdir+'/TP4archv_wav_start'+str(dadate)+'_000000Z_dump'+str(dadate)+'_120000Z.nc'
     slon = 'longitude'
     slat = 'latitude'
     sconc = 'fice'
     sdmax = 'dmax'
     lonM = Mrdg.nc_get_var(ncfil,slon) # lon[:,:] is a numpy array
     latM = Mrdg.nc_get_var(ncfil,slat) # lat[:,:] is a numpy array
     conc = Mrdg.nc_get_var(ncfil,sconc,time_index=0)
     dmax = Mrdg.nc_get_var(ncfil,sdmax,time_index=0)
     X,Y = basemap(lonM[:,:],latM[:,:],inverse=False)
     ZD = dmax[:,:].data
     mask = dmax[:,:].mask
     ZD[mask] = np.NaN
     ZC = conc[:,:].data
     mask = conc[:,:].mask
     ZC[mask] = np.NaN
     
     return(lonM,latM,X,Y,ZC,ZD)
Exemplo n.º 4
0
    def _read_mdl_waves_ice(self,data_date,basemap):
    
        # NetCDF reader 
        day = self.day
        month = self.month
        year = self.year
        jdaystart = self.jdaystart

        # TIME INDEX
        tidx = self.tidx_w

        # Read TP4arch_wav
        if jdaystart < 100:
           outdir = '/work/timill/RealTime_Models/results_hindcasts/TP4a0.12/'+\
                   'wavesice/2015_GOOD/2015_0'+str(jdaystart)+'/final_output'
        else:
           outdir = '/work/timill/RealTime_Models/results_hindcasts/TP4a0.12/'+\
                   'wavesice/2015_GOOD/2015_'+str(jdaystart)+'/final_output'

        ncfil = outdir+'/SWARP_hindcast_wavesice_start'+data_date+'T000000Z.nc'
        self.wavesice = ncfil
        slon = 'longitude'
        slat = 'latitude'
        sconc = 'icec'
        sthic = 'icetk'
        sdmax = 'dmax'
        sswh = 'swh'
        staux = 'taux_wav'
        stauy = 'tauy_wav'
        smwd = 'mwd'
        lonM = Mrdg.nc_get_var(ncfil,slon) # lon[:,:] is a numpy array
        lonM = lonM[:,:]
        latM = Mrdg.nc_get_var(ncfil,slat) # lat[:,:] is a numpy array
        latM = latM[:,:]
        X,Y = basemap(lonM[:,:],latM[:,:],inverse=False)
        self.lonM,self.latM,self.XM,self.YM = lonM,latM,X,Y
        conc = Mrdg.nc_get_var(ncfil,sconc,time_index=tidx)
        conc = conc[:,:]
        thic = Mrdg.nc_get_var(ncfil,sthic,time_index=tidx)
        thic = thic[:,:]
        dmax = Mrdg.nc_get_var(ncfil,sdmax,time_index=tidx)
        dmax = dmax[:,:]
        swh = Mrdg.nc_get_var(ncfil,sswh,time_index=tidx)
        swh = swh[:,:]
        taux = Mrdg.nc_get_var(ncfil,staux,time_index=tidx)
        taux = taux[:,:]
        tauy = Mrdg.nc_get_var(ncfil,stauy,time_index=tidx)
        tauy = tauy[:,:]
        mwd = Mrdg.nc_get_var(ncfil,smwd,time_index=tidx)
        mwd = mwd[:,:]
        self.ZCW,self.ZTW,self.ZDW,self.SWHW,self.MWDW,self.TXW,self.TYW =\
                conc,thic,dmax,swh,mwd,taux,tauy

        print('Wave Ice: lonM,latM,X,Y,ZC,ZT,ZD,swh,mwd,taux,tauy')
       
        return()
Exemplo n.º 5
0
    def _read_mdl_DAILY(self,data_date,dadate,basemap):
        
        # NetCDF reader 
        day = self.day
        month = self.month
        year = self.year
        jdaystart = self.jdaystart

        if jdaystart < 100:
           outdir = '/work/timill/RealTime_Models/results_hindcasts/TP4a0.12/'+\
                 'wavesice/2015_GOOD/2015_0'+str(jdaystart)+'/netcdf/DAILY/'
        else:
           outdir = '/work/timill/RealTime_Models/results_hindcasts/TP4a0.12/'+\
                 'wavesice/2015_GOOD/2015_'+str(jdaystart)+'/netcdf/DAILY/'

        outdir = '/work/timill/giacomo/DAILY_WIM_2015_melting'
        ncfil = outdir+'/TP4DAILY_start'+data_date+'_dump'+dadate+'.nc'
        slon = 'longitude'
        slat = 'latitude'
        sconc = 'fice'
        sthic = 'hice'
        lonM = Mrdg.nc_get_var(ncfil,slon) # lon[:,:] is a numpy array
        lonM = lonM[:,:]
        latM = Mrdg.nc_get_var(ncfil,slat) # lat[:,:] is a numpy array
        latM = latM[:,:]
        X,Y = basemap(lonM[:,:],latM[:,:],inverse=False)
        self.lonM,self.latM,self.XM,self.YM = lonM,latM,X,Y
        conc = Mrdg.nc_get_var(ncfil,sconc,time_index=0)
        conc = conc[:,:]
        thic = Mrdg.nc_get_var(ncfil,sthic,time_index=0)
        thic = thic[:,:]

        self.ZM,self.ZT = conc,thic
        
        print('DAILY: lonM,latM,X,Y,ZC,ZT')

        return()
Exemplo n.º 6
0
 def _read_osi_(self,dadate,basemap):
     day = self.day
     month = self.month
     year = self.year
     # Read in OSI_SAF file
     #outdir = '/work/shared/nersc/msc/OSI-SAF/'+str(year)+'_nh_polstere/'
     outdir = './tmp/OSI'
     ncfil = outdir+'/ice_conc_nh_polstere-100_multi_'+dadate+'1200.nc'
     clon = 'lon'
     clat = 'lat'
     cconc = 'ice_conc'
     lonO = Mrdg.nc_get_var(ncfil,clon) # lon[:,:] is a numpy array
     latO = Mrdg.nc_get_var(ncfil,clat) # lat[:,:] is a numpy array
     conc = Mrdg.nc_get_var(ncfil,cconc,time_index=0)
     xc = Mrdg.nc_get_var(ncfil,'xc')
     yc = Mrdg.nc_get_var(ncfil,'yc')
     X2,Y2 = basemap(lonO[:,:],latO[:,:],inverse=False)
     XO = np.copy(X2)
     YO = np.copy(Y2)
     Z2 = conc[:,:].data
     mask2 = conc[:,:].mask
     Z2[mask2] = np.NaN
     ZO = Z2/100
     return(lonO,latO,XO,YO,ZO) 
Exemplo n.º 7
0
    def _read_mdl_ice_only(self,data_date,basemap):
        
        # NetCDF reader 
        day = self.day
        month = self.month
        year = self.year
        jdaystart = self.jdaystart

        # TIME INDEX
        tidx = self.tidx_i

        # Read TP4arch
        if jdaystart < 100:
           outdir = '/work/timill/RealTime_Models/results_hindcasts/TP4a0.12/'+\
                   'ice_only/2015_GOOD/2015_0'+str(jdaystart)+'/final_output'
        else:
           outdir = '/work/timill/RealTime_Models/results_hindcasts/TP4a0.12/'+\
                   'ice_only/2015_GOOD/2015_'+str(jdaystart)+'/final_output'
        ncfil = outdir+'/SWARP_hindcast_ice_only_start'+data_date+'T000000Z.nc'
        self.ice_only = ncfil
        slon = 'longitude'
        slat = 'latitude'
        sconc = 'icec'
        sthic = 'icetk'
        shsnow = 'hsnow'
        sqtot = 'qtot'
        sqcool = 'flx_cool'
        sqother = 'flx_itop'
        sqatm = 'flx_ow'
        sconc_old = 'fi_old'
        sthic_old = 'hi_old'
        shsnow_old = 'hs_old'
        shsnow_diff = 'hs_int'
        sconc_diff = 'dfice'
        sthic_diff = 'dhice'
        staux = 'taux'
        stauy = 'tauy'
        lonM = Mrdg.nc_get_var(ncfil,slon) # lon[:,:] is a numpy array
        lonM = lonM[:,:]
        latM = Mrdg.nc_get_var(ncfil,slat) # lat[:,:] is a numpy array
        latM = latM[:,:]
        X,Y = basemap(lonM[:,:],latM[:,:],inverse=False)
        self.lonM,self.latM,self.X,self.Y = lonM,latM,X,Y
        conc = Mrdg.nc_get_var(ncfil,sconc,time_index=tidx)
        conc = conc[:,:]
        thic = Mrdg.nc_get_var(ncfil,sthic,time_index=tidx)
        thic = thic[:,:]
        hsnow = Mrdg.nc_get_var(ncfil,shsnow,time_index=tidx)
        hsnow = hsnow[:,:]
        qtot = Mrdg.nc_get_var(ncfil,sqtot,time_index=tidx)
        qtot = qtot[:,:]
        qcool = Mrdg.nc_get_var(ncfil,sqcool,time_index=tidx)
        qcool = qcool[:,:]
        qother = Mrdg.nc_get_var(ncfil,sqother,time_index=tidx)
        qother = qother[:,:]
        qatm = Mrdg.nc_get_var(ncfil,sqatm,time_index=tidx)
        qatm = qatm[:,:]
        conc_old = Mrdg.nc_get_var(ncfil,sconc_old,time_index=tidx)
        conc_old = conc_old[:,:]
        thic_old = Mrdg.nc_get_var(ncfil,sthic_old,time_index=tidx)
        thic_old = thic_old[:,:]
        hsnow_old = Mrdg.nc_get_var(ncfil,shsnow_old,time_index=tidx)
        hsnow_old = hsnow_old[:,:]
        hsnow_diff = Mrdg.nc_get_var(ncfil,shsnow_diff,time_index=tidx)
        hsnow_diff = hsnow_diff[:,:]
        conc_diff = Mrdg.nc_get_var(ncfil,sconc_diff,time_index=tidx)
        conc_diff = conc_diff[:,:]
        thic_diff = Mrdg.nc_get_var(ncfil,sthic_diff,time_index=tidx)
        thic_diff = thic_diff[:,:]
        taux = Mrdg.nc_get_var(ncfil,staux,time_index=tidx)
        taux = taux[:,:]
        tauy = Mrdg.nc_get_var(ncfil,stauy,time_index=tidx)
        tauy = tauy[:,:]

        self.ZMi,self.ZTI,self.HSI,self.QT,self.QC,self.QO,self.QA,self.FOI,\
                self.TOI,self.HSO,self.HSD,self.FDI,self.TDI,self.TXI,self.TYI =\
                conc,thic,shsnow,qtot,qcool,qother,qatm,conc_old,thic_old,hsnow_old,\
                hsnow_diff,conc_diff,thic_diff,taux,tauy
        
        print('Ice Only: lonM,latM,X,Y,ZC,ZT,hsnow,qtot,qcool,qother,qatm,conc_old,thic_old,'+\
                'hsnow_old,hsnow_diff,conc_diff,thic_diff,taux,tauy')

        return()