Beispiel #1
0
    def __init__(self):
##
## Parameters defining the input grid and file structure
##
        self.nXIn = 162
        self.x0In = -10.375
##        self.x0In = -9.875        
        self.nYIn = 100
        self.y0In = 35.125
        self.nTimesIn = 1826
        self.startYear = 2007
        self.endYear = 2011 + 1
        self.months = monthsAsNumbers()
        self.years = yearsAsStrList( self.startYear, self.endYear )
        self.rootDir =\
                     '/users/global/cmt/SWELTER/lst/SWELTER_terra_025deg_files/'
##                     '/users/global/cmt/SWELTER/lst/SWELTER_aqua_025deg_files/'


        self.averageInput = False
## Parameters defining the output grid and netcdf file
##
        if self.averageInput:
## Half degree grid
            self.nXOut = 81
            self.nYOut = 50
            self.x0Out = -10.375
            self.y0Out = 35.125
        else:
            self.nXOut = 162
            self.nYOut = 100
            self.x0Out = -10.375
            self.y0Out = 35.125
Beispiel #2
0
    def __init__(self):

        self.lambd = 2.45E6
        self.mwr=0.622
        self.cp=1004.0
        self.tcrit=373.15
        self.psyco=0.0004

        self.precip = 0.0
        
        self.wfdEIDir = \
                      "/prj/nceo/WFD-EI-Forcing/"
        self.pointsFile = \
                        "euroPoints2839.dat"


        self.years = yearsAsStrList( 2000, 2010)

        self.months = monthsAsNumbers()



        self.nYears = float( len( self.years))

        self.nY = 50
        self.nX = 81


        self.fromScratch = True
Beispiel #3
0
    def __init__(self):
##
## Parameters defining the input grid and file structure
##
        self.nXIn = 1440
        self.x0In = -179.75
        self.nYIn = 720
        self.y0In = -89.75
        self.nTimesIn = 1826
##        self.nTimesIn = 365        
        self.startYear = 2007
        self.endYear = 2011 + 1

        self.years = yearsAsStrList(  self.startYear, self.endYear )

        self.months = monthsAsNumbers()
        self.years = yearsAsStrList( self.startYear, self.endYear )
        self.rootDir =\
                     "/prj/nceo/aatsrLstP25Deg/"

##
        self.nXOut = 162
        self.x0Out = -9.875
        self.nYOut = 100
        self.y0Out = 35.125
Beispiel #4
0
    def __init__(self):
##define the output grid
        self.x0Out = -10.25
        self.y0Out = 59.75
        self.nXOut = 81
        self.nYOut = 50
        self.dxyOut = 0.5
##
## Only use True on first go as it adds to the time taken to run
##        
        self.fromScratch = False
        self.pickleFile = "mappingPickle.pl"
##
## Directory where we get the mapping file from        
        self.wfdEIRoot = "/prj/nceo/WFD-EI-Forcing/"
##
## Directory where we get the tAir data from        
        self.dataRoot = "../EIHDEC-land/"
## Years of interest
        self.years = yearsAsStrList( 2007, 2011)
##        self.years = yearsAsStrList( 2003, 2004)        
        self.months = monthsAsNumbers()
##
## this list will contain all the arrays to be written out at the end
        self.griddedData = {}
Beispiel #5
0
    def __init__(self):
##
## Parameters defining the input grid and file structure
##
        self.nXIn = 1440
        self.x0In = -179.875
        self.nYIn = 480
        self.y0In = -59.875
##        self.y0In = 60.125        
        self.dXYIn = 0.25
        self.nTimesIn = 1826
        self.startYear = 2007
##        self.endYear = 2007 + 1
        self.endYear = 20011 + 1        
        self.months = monthsAsNumbers()
        self.years = yearsAsStrList( self.startYear, self.endYear )
        self.rootDir = '/users/global/cmt/ASCAT/archive/global/'
##
## Parameters defining the output grid and netcdf file
##
        self.averageOutput = False
        if self.averageOutput:
            self.nXOut = 81
            self.nYOut = 50
            self.x0Out = -10.25
            self.y0Out = 59.75
            self.dXYOut = 0.5
        else:
            self.nXOut = 162
            self.nYOut = 100
            self.x0Out = -10.375
            self.y0Out = 35.125
##            self.y0Out = 59.825            
            self.dXYOut = 0.25            
##
## This defines the output grid as a portion of the input grid
##
        self.startXPoint = ( self.x0Out - ( self.x0In ) ) / self.dXYIn
        self.endXPoint = self.startXPoint + self.nXOut * self.dXYOut / self.dXYIn

        self.startYPoint = ( self.y0Out - self.y0In) / self.dXYIn
##        self.startYPoint = ( self.y0In - self.y0Out ) / self.dXYIn
        self.endYPoint = self.startYPoint + self.nYOut * self.dXYOut / self.dXYIn

##        print( self.startYPoint, self.endYPoint )
##        print( self.y0In + self.nYIn * 0.25)
##        print( self.y0Out + self.nYOut * 0.25)

##
## Morning or afternoon swath
        self.doAM = True
        if self.doAM:
            self.suffix = '_am.gra'
            self.fidOut = Dataset( 'ascatAm2003Europe.nc', 'w', format = \
                                   'NETCDF3_CLASSIC')
        else:
            self.fidOut = Dataset( 'ascatPmHalfDegEurope.nc', 'w', format = \
                              'NETCDF3_CLASSIC')
            self.suffix = '_pm.gra'
Beispiel #6
0
    def __init__(self):
##
## The first time we read the daily / 3 hourly data
##  we mean it and regrid the WFDEI. After this we have
##  the outputs in a file and it is much easier just to
##  read them in
##
        self.fromScratch = True
##
## Parameters defining the input grid and file structure
##
        self.nXIn = 162
        self.x0In = -10.375
##        self.x0In = -9.875        
        self.nYIn = 100
        self.y0In = 35.125

        self.startYear = 2005
##        self.endYear = 2005 + 1
        self.endYear = 2009 + 1        
        self.months = monthsAsNumbers()
        self.years = yearsAsStrList( self.startYear, self.endYear )
        self.nTimesIn = len( self.months) * len( self.years)
        
        self.rootDir =\
                     '/users/global/cmt/SWELTER/lst/SWELTER_terra_025deg_files/'
##                     '/users/global/cmt/SWELTER/lst/SWELTER_aqua_025deg_files/'
        self.nXOut = 162
        self.nYOut = 100
        self.x0Out = -10.375
        self.y0Out = 35.125

        self.undef = np.zeros( ( self.nYOut, self.nXOut ) ) - 999.0

        self.outputArray = np.zeros( (self.nTimesIn, \
                                     self.nYIn/2, self.nXIn/2),\
                                     dtype = np.float32)
        self.outputArrayBig = np.zeros( (self.nTimesIn, \
                                         self.nYIn, self.nXIn),\
                                        dtype = np.float32)
##
## WFD-EI is on a vector so we have to read in the
##  relevant points mean them and regrid them to our
##  output grid
##
        self.wfdEIDir = \
                      "/prj/nceo/WFD-EI-Forcing/"
        self.pointsFile = \
                        "euroPoints2839.dat"
Beispiel #7
0
nceuro = 80
nreuro = 50
npeuro = nceuro*nreuro

mapping_file = "/users/global/ppha/swelter/wfd-ei/wfdei_map.asc"

nc_wfdei = 720
nr_wfdei = 360
np_wfdei = nc_wfdei*nr_wfdei
nl_wfdei = 67209

dloneuro = 0.5
dlateuro = 0.5
lon0euro = -9.75
lat0euro = 35.25
months = monthsAsNumbers()
years = yearsAsStrList( 2000, 2012)

rootDir = "/prj/SWELTER/rjel/EIHDEC-land/"
prefix = "Tair_EIHDEC_land_"
suffix = ".nc"

firstTstep = 3

class dailyEra():
    __author__ = "RichE"
    __email__ = "*****@*****.**"
    __date__ = "12-11-2-12"
    '''
    A class to read in t2m data from annual files and
    extract the 0900-1200 value.