def modis_par_monavg(input_file, output_file):

        output_file = functions.list_to_element(output_file)
        functions.check_output_dir(os.path.dirname(output_file))
        args = {"input_file": input_file, "output_file": output_file, "output_format": 'GTIFF', \
        "options": "compress=lzw", "input_nodata": in_nodata}
        raster_image_math.do_avg_image(**args)
Beispiel #2
0
    def modis_chla_monclim(input_file, output_file):

        output_file = functions.list_to_element(output_file)
        functions.check_output_dir(os.path.dirname(output_file))
        args = {"input_file": input_file, "output_file": output_file, "output_format": 'GTIFF', \
     "options": "compress=lzw"}
        raster_image_math.do_avg_image(**args)
    def compute_monavg(input_file, output_file):

        output_file = functions.list_to_element(output_file)
        out_filename = os.path.basename(output_file)
        functions.check_output_dir(os.path.dirname(output_file))
        no_data = int(sds_meta.get_nodata_value(input_file[0]))

        str_date = out_filename[0:6]
        today = datetime.date.today()
        today_yyyymm = today.strftime('%Y%m')

        # expected_ndays=functions.get_number_days_month(str_date)
        # current_ndays=len(input_file)
        if str_date == today_yyyymm:
            logger.info(
                'Do not perform computation for current month {0}. Skip'.
                format(str_date))
        else:
            args = {
                "input_file": input_file,
                "output_file": output_file,
                "output_format": 'GTIFF',
                "input_nodata": no_data,
                "options": "compress=lzw"
            }
            raster_image_math.do_avg_image(**args)
    def compute_3dayavg(input_file, output_file):

        no_data = int(sds_meta.get_nodata_value(input_file[0]))
        output_file = functions.list_to_element(output_file)
        functions.check_output_dir(os.path.dirname(output_file))
        args = {"input_file": input_file, "output_file": output_file, "output_format": 'GTIFF', "options": "", "input_nodata":no_data, "output_nodata":no_data}
        raster_image_math.do_avg_image(**args)
Beispiel #5
0
    def std_yearly_clim(input_file, output_file):

        output_file = functions.list_to_element(output_file)
        reduced_list = exclude_current_year(input_file)
        functions.check_output_dir(os.path.dirname(output_file))
        args = {"input_file": reduced_list, "output_file": output_file, "output_format": 'GTIFF',
                "options": "compress=lzw"}
        raster_image_math.do_avg_image(**args)
def compute_10d_from_1d(input_file, output_file):
    output_file = functions.list_to_element(output_file)
    functions.check_output_dir(os.path.dirname(output_file))
    args = {
        "input_file": input_file,
        "output_file": output_file,
        "output_format": 'GTIFF',
        "options": "compress = lzw"
    }
    raster_image_math.do_avg_image(**args)
Beispiel #7
0
    def std_precip_10davg(input_file, output_file):

        output_file = functions.list_to_element(output_file)
        functions.check_output_dir(os.path.dirname(output_file))
        args = {
            "input_file": input_file,
            "output_file": output_file,
            "output_format": 'GTIFF',
            "options": "compress=lzw",
            'output_type': 'Float32',
            'input_nodata': -32767
        }
        raster_image_math.do_avg_image(**args)
Beispiel #8
0
    def lsasaf_etp_10d30min(input_file, output_file):

        output_file = functions.list_to_element(output_file)
        functions.check_output_dir(os.path.dirname(output_file))
        args = {"input_file": input_file, "output_file": output_file, "output_format": 'GTIFF', \
                "options": "compress=lzw", "input_nodata":-32768}

        raster_image_math.do_avg_image(**args)

        # Do also the house-keeping, by deleting the files older than 6 months
        number_months_keep = 6
        remove_old_files(prod, "lsasaf-et", version, native_mapset, 'Ingest',
                         number_months_keep)
Beispiel #9
0
    def olci_wrr_3dcum(input_file, output_file):

        output_file = functions.list_to_element(output_file)
        functions.check_output_dir(os.path.dirname(output_file))
        args = {
            "input_file": input_file,
            "output_file": output_file,
            "output_format": 'GTIFF',
            "options": "",
            "input_nodata": 1000,
            "output_nodata": 1000
        }
        raster_image_math.do_avg_image(**args)
def compute_monthly_prod_from_10d(input_file, output_file):
    # ES2- 235 Do not show temporary products like composite not complete (ex monthly composite available mid month...)
    input_file_date = functions.get_date_from_path_full(input_file[0])
    if len(input_file) == 3:
        if not functions.is_date_current_month(input_file_date):
            output_file = functions.list_to_element(output_file)
            functions.check_output_dir(os.path.dirname(output_file))
            args = {
                "input_file": input_file,
                "output_file": output_file,
                "output_format": 'GTIFF',
                "options": "compress = lzw"
            }
            raster_image_math.do_avg_image(**args)
    def modis_chla_monavg(input_file, output_file):

        output_file = functions.list_to_element(output_file)
        out_filename=os.path.basename(output_file)
        str_date=out_filename[0:6]
        expected_ndays=functions.get_number_days_month(str_date)
        functions.check_output_dir(os.path.dirname(output_file))
        current_ndays=len(input_file)
        if expected_ndays != current_ndays:
            logger.info('Missing days for period: %s. Skip' % str_date)
        else:
            args = {"input_file": input_file, "output_file": output_file, "output_format": 'GTIFF', \
            "options": "compress=lzw", "input_nodata": in_nodata}
            raster_image_math.do_avg_image(**args)
    def modis_chla_monavg(input_file, output_file):

        output_file = functions.list_to_element(output_file)
        out_filename = os.path.basename(output_file)
        str_date = out_filename[0:6]
        expected_ndays = functions.get_number_days_month(str_date)
        functions.check_output_dir(os.path.dirname(output_file))
        current_ndays = len(input_file)
        if expected_ndays != current_ndays:
            logger.info('Missing days for period: %s. Skip' % str_date)
        else:
            args = {"input_file": input_file, "output_file": output_file, "output_format": 'GTIFF', \
            "options": "compress=lzw", "input_nodata": in_nodata}
            raster_image_math.do_avg_image(**args)
Beispiel #13
0
    def test_avg_image(self):

        output_filename = 'fewsnet-rfe/10davg/1221_fewsnet-rfe_10davg_FEWSNET-Africa-8km_2.0.tif'
        output_file = os.path.join(self.root_out_dir, output_filename)
        ref_file = os.path.join(self.ref_dir, output_filename)
        functions.check_output_dir(os.path.dirname(output_file))

        args = {
            "input_file": self.input_files,
            "output_file": output_file,
            "output_format": 'GTIFF',
            "options": "compress = lzw"
        }
        raster_image_math.do_avg_image(**args)

        equal = self.checkFile(ref_file, output_file)
        self.assertEqual(equal, 1)
    def std_precip_1monavg(input_file, output_file):

        output_file = functions.list_to_element(output_file)
        functions.check_output_dir(os.path.dirname(output_file))
        args = {"input_file": input_file, "output_file": output_file, "output_format": 'GTIFF', "options": "compress=lzw"}
        raster_image_math.do_avg_image(**args)
Beispiel #15
0
def vgt_ndvi_10davg_linearx2(input_file, output_file):

    output_file = functions.list_to_element(output_file)
    functions.check_output_dir(os.path.dirname(output_file))
    args = {"input_file": input_file, "output_file": output_file, "output_format": 'GTIFF', "options": "compress = lzw"}
    raster_image_math.do_avg_image(**args)