Exemplo n.º 1
0
    def setUpClass(self):

        self.rootpath = os.path.join(curpath(), 'data', 'src_test')
        self.nan_value = -99
        self.regions = ['AU']
        self.spatial_resolution = 1
        self.temporal_resolution = 'week'
        self.start_date = datetime(2013, 1, 7)
        self.enddate = datetime(2013, 1, 13)
        self.testdate = datetime(2013, 1, 10)

        if os.path.exists(self.rootpath):
            shutil.rmtree(self.rootpath)

        os.mkdir(self.rootpath)
        os.mkdir(os.path.join(self.rootpath, 'DATA'))
        os.mkdir(os.path.join(self.rootpath, 'TMP'))

        self.poet = Poet(self.rootpath, self.regions, self.spatial_resolution,
                         self.temporal_resolution, self.start_date,
                         self.nan_value)

        # setup test png files
        self.pngdir = os.path.join(curpath(), 'data', 'testpngs')
        if os.path.exists(self.pngdir):
            shutil.rmtree(self.pngdir)
        os.mkdir(self.pngdir)
        dtindex = get_dtindex('day', self.start_date, self.enddate)
        for dat in dtindex:
            year = str(dat.year)
            month = "%02d" % (dat.month)
            day = "%02d" % (dat.day)
            fname = ('test_' + year + '_' + month + '_' + day + '.png')
            shutil.copy(os.path.join(curpath(), 'data', 'test.png'),
                        os.path.join(self.pngdir, fname))
Exemplo n.º 2
0
rootpath = os.path.join('C:\\', 'Users', 'i.pfeil', 'Desktop', 'poets')
#shapefile = os.path.join('C:\\', 'Users', 'i.pfeil', 'Documents',
#                         '0_IWMI_DATASETS', 'shapefiles', 'IND_adm', 'IND_adm1')
#shapefile = os.path.join('C:\\', 'Users', 'i.pfeil', 'Desktop',
#                         'Isabella', 'Peejush', 'Box_West_SA', 'West_SA_cl2')
regions = ['West_SA']  # CE...Sri Lanka, IN...India
spatial_resolution = 0.1
temporal_resolution = 'dekad'
start_date = datetime(2007, 1, 1)
nan_value = -99

# initializing Poet class:
p = Poet(rootpath,
         regions,
         spatial_resolution,
         temporal_resolution,
         start_date,
         nan_value,
         shapefile=shapefile)

#===============================================================================
# #source attributes:
# name = 'NDVI'
# filename = "g2_BIOPAR_NDVI_QL_{YYYY}{MM}{DD}0000_ASIA_VGT_V1_3.tiff"
# filedate = {'YYYY': (18, 22), 'MM': (22, 24), 'DD': (24, 26)}
# temp_res = 'daily'
# host = "neoftp.sci.gsfc.nasa.gov"
# protocol = 'FTP'
# directory = "/gs/MOD11C1_D_LSTDA/"
# begin_date = datetime(2007, 1, 1)
# nan_value = 255
Exemplo n.º 3
0
if __name__ == "__main__":

    # POETS SETTINGS
    spatial_resolution = 0.25
    temporal_resolution = 'dekad'
    rootpath = '/home/tuwien/poets'
    nan_value = -99
    start_date = datetime(1992, 1, 1)
    regions = ['CT']
    delete_rawdata = True
    valid_range = (0, 1)

    p = Poet(rootpath,
             regions,
             spatial_resolution,
             temporal_resolution,
             start_date,
             nan_value,
             delete_rawdata=delete_rawdata)

    # SOURCE SETTINGS BOKU NDVI
    name = 'Vegetation_Status'
    filename = "CF_MCD13Q1.A{{YYYY}}{{RP}}.10_days.NDVIgd.tif"
    filedate = {'YYYY': (12, 16), 'RP': (16, 18)}
    temp_res = 'dekad'
    host = "ivfl-rio.boku.ac.at"
    protocol = 'FTP'
    directory = "/SATIDA/MODIS_NRT/CF/"
    begin_date = datetime(2015, 1, 1)
    nan_value = 255
    data_range = (0, 254)