parser.add_argument( '--no-crop', action='store_true', help=("don't crop but instead download the original JP2 files")) parser.add_argument('--timeout', type=int, default=60, help='timeout for images downloads, in seconds') args = parser.parse_args() if 'all' in args.band: args.band = s2_metadata_parser.BANDS_L2A if args.product_type == "L2A" else s2_metadata_parser.BANDS_L1C if args.lat is not None and args.lon is not None: args.geom = utils.geojson_geometry_object(args.lat, args.lon, args.width, args.height) get_time_series(args.geom, start_date=args.start_date, end_date=args.end_date, bands=args.band, tile_id=args.tile_id, title=args.title, relative_orbit_number=args.relative_orbit_number, out_dir=args.outdir, api=args.api, mirror=args.mirror, no_crop=args.no_crop, product_type=args.product_type, cloud_masks=args.cloud_masks, parallel_downloads=args.parallel_downloads,
import datetime from tsd import utils from tsd import search_stac aoi = utils.geojson_geometry_object(29.9793, 31.1346, 5000, 5000) results = search_stac.search(aoi, start_date=datetime.datetime(2019, 1, 15), end_date=datetime.datetime(2019, 1, 30), satellite='Sentinel-2', product_type="L1C") computed = [r['properties']['sentinel:product_id'] for r in results] expected = ['S2B_MSIL1C_20190129T083209_N0207_R021_T36RUU_20190129T103220', 'S2A_MSIL1C_20190124T083231_N0207_R021_T36RUU_20190124T095836', 'S2B_MSIL1C_20190119T083259_N0207_R021_T36RUU_20190119T104924'] assert computed == expected, computed