예제 #1
0
    def test_files_temp_ajacent(self):

        file_t0 = '/data/test_data/tamsat-rfe/3.0/TAMSAT-Africa-4km/tif/10d/20190101_tamsat-rfe_10d_TAMSAT-Africa-4km_3.0.tif'
        file_t1 = '/data/test_data/tamsat-rfe/3.0/TAMSAT-Africa-4km/tif/10d/20190111_tamsat-rfe_10d_TAMSAT-Africa-4km_3.0.tif'

        adjacent_file_list = functions.files_temp_ajacent(file_t0)
        self.assertEqual(adjacent_file_list[0], file_t1)
예제 #2
0
def generate_parameters_ndvi_linearx1():

        #   Look for all input files in input_dir, and sort them
        input_files = glob.glob(starting_files)
        input_files.sort()

        for file_t0 in input_files:
            # Get current date
            date_t0 = functions.get_date_from_path_full(file_t0)
            output_file = es_constants.processing_dir+subdir_linearx1+str(date_t0)+prod_ident_linearx1

            # Get files at t-1 and t+1
            adjac_files = functions.files_temp_ajacent(file_t0)

            if len(adjac_files) == 2:

                # Prepare and return arguments
                three_files_in_a_row = [adjac_files[0], file_t0, adjac_files[1]]
                yield (three_files_in_a_row, output_file)
예제 #3
0
def generate_parameters_ndvi_linearx1():

    #   Look for all input files in input_dir, and sort them
    input_files = glob.glob(starting_files)
    input_files.sort()

    for file_t0 in input_files:
        # Get current date
        date_t0 = functions.get_date_from_path_full(file_t0)
        output_file = es_constants.processing_dir + subdir_linearx1 + str(
            date_t0) + prod_ident_linearx1

        # Get files at t-1 and t+1
        adjac_files = functions.files_temp_ajacent(file_t0)

        if len(adjac_files) == 2:

            # Prepare and return arguments
            three_files_in_a_row = [adjac_files[0], file_t0, adjac_files[1]]
            yield (three_files_in_a_row, output_file)