def test_list_cells_ls578(config=None): filename = "cells_ls578.csv" list_cells_to_file(x=range(MIN_X, MAX_X + 1), y=range(MIN_Y, MAX_Y + 1), acq_min=MIN_ACQ_MIN, acq_max=MAX_ACQ_MAX, satellites=SATELLITE_LS578, dataset_types=DATASET_TYPE_ARG25, filename=filename, config=config) assert filecmp.cmp(filename, get_test_data_path(filename))
def test_list_cells_120_020_2014_ls8(config=None): filename = "cells_120_020_2014_ls8.csv" list_cells_to_file(x=[CELL_X], y=[CELL_Y], acq_min=ACQ_MIN_2014, acq_max=ACQ_MAX_2014, satellites=SATELLITE_LS8, dataset_types=DATASET_TYPE_ARG25, filename=filename, config=config) assert filecmp.cmp(filename, get_test_data_path(filename))
def test_list_cells_120_020_2005_ls7(config=None): filename = "cells_120_020_2005_ls7_wofs.csv" list_cells_to_file(x=[CELL_X], y=[CELL_Y], acq_min=ACQ_MIN_2005, acq_max=ACQ_MAX_2005, satellites=SATELLITE_LS7, dataset_types=DATASET_TYPE_WOFS, filename=filename, config=config) assert filecmp.cmp(filename, get_test_data_path(filename))
def test_list_cells_120_020_2005_ls578_no_ls8_pre_wrs_2(config=None): filename = "cells_120_020_2005_ls578_no_ls8_pre_wrs_2.csv" list_cells_to_file(x=[CELL_X], y=[CELL_Y], acq_min=ACQ_MIN_2005, acq_max=ACQ_MAX_2005, satellites=SATELLITE_LS578, dataset_types=DATASET_TYPE_ARG25, filename=filename, exclude=[LS8_PRE_WRS_2_EXCLUSION], config=config) assert filecmp.cmp(filename, get_test_data_path(filename))
def run(self): print("**** ", self.output().path) x_list = range(self.x_min, self.x_max + 1) y_list = range(self.y_min, self.y_max + 1) from datacube.api.query import list_cells_to_file from datacube.api.query import SortType list_cells_to_file(x=x_list, y=y_list, satellites=list(self.satellites), acq_min=self.acq_min, acq_max=self.acq_max, dataset_types=self.dataset_types, filename=self.output().path, sort=SortType.ASC)
def test_list_cells_120_020_2005_ls578_no_ls7_slc(config=None): filename = "cells_120_020_2005_ls578_wofs_no_ls7_slc.csv" list_cells_to_file(x=[CELL_X], y=[CELL_Y], acq_min=ACQ_MIN_2005, acq_max=ACQ_MAX_2005, satellites=SATELLITE_LS578, dataset_types=DATASET_TYPE_WOFS, filename=filename, exclude=[LS7_SLC_OFF_EXCLUSION], config=config) assert filecmp.cmp(filename, get_test_data_path(filename))
def test_list_cells_120_020_2005_ls578_summer(config=None): filename = "cells_120_020_2005_ls578_summer.csv" acq_min, acq_max, include = build_season_date_criteria(ACQ_MIN_2005, ACQ_MAX_2005, Season.SUMMER) list_cells_to_file(x=[CELL_X], y=[CELL_Y], acq_min=acq_min, acq_max=acq_max, satellites=SATELLITE_LS578, dataset_types=DATASET_TYPE_ARG25, filename=filename, include=include, config=config) assert filecmp.cmp(filename, get_test_data_path(filename))
def test_list_cells_120_020_2000_2010_ls578_summer_arg25_stats(config=None): filename = "cells_120_020_2000_2010_ls578_summer_arg25_stats.csv" acq_min = parse_date_min("2000") acq_max = parse_date_max("2010") acq_min, acq_max, include = build_season_date_criteria(acq_min, acq_max, Season.SUMMER, seasons=SEASONS_ARG25_STATS) list_cells_to_file(x=[CELL_X], y=[CELL_Y], acq_min=acq_min, acq_max=acq_max, satellites=SATELLITE_LS578, dataset_types=DATASET_TYPE_ARG25, filename=filename, include=include, config=config) assert filecmp.cmp(filename, get_test_data_path(filename))
def do_list_cells_by_xy_single_csv(config=None): filename = os.path.expandvars("$HOME/tmp/cube/cells.csv") list_cells_to_file(x=[123], y=[-25], acq_min=parse_date_min("2014-01"), acq_max=parse_date_max("2014-01"), satellites=[Satellite.LS7], dataset_types=[DatasetType.ARG25, DatasetType.PQ25, DatasetType.FC25], filename=filename, config=config) cells = [] with open(filename, "rb") as f: reader = csv.DictReader(f) for record in reader: _log.debug("Found CSV record [%s]", record) cells.append(Cell.from_csv_record(record)) for cell in cells: _log.debug("Found cell xy = %s", cell.xy)