From 4ff5c6acc4d410ba6853e1588fed7945902444fb Mon Sep 17 00:00:00 2001 From: Forrest Williams Date: Thu, 8 Feb 2024 07:35:08 -0600 Subject: [PATCH] update requirements --- environment.yml | 5 ++++- pyproject.toml | 4 ++++ src/hyp3_sdk/stac.py | 8 +++++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/environment.yml b/environment.yml index fe07cee..71558b4 100644 --- a/environment.yml +++ b/environment.yml @@ -17,9 +17,12 @@ dependencies: - pytest - pytest-cov - responses - - pystac # For running - python-dateutil - requests - tqdm - urllib3 + - pystac + - fsspec + - aiohttp + - pillow diff --git a/pyproject.toml b/pyproject.toml index 44f8003..979866f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -27,6 +27,10 @@ dependencies = [ "requests", "urllib3", "tqdm", + "pystac", + "fsspec", + "aiohttp", + "pillow", ] dynamic = ["version"] diff --git a/src/hyp3_sdk/stac.py b/src/hyp3_sdk/stac.py index 7717245..37cf4e0 100644 --- a/src/hyp3_sdk/stac.py +++ b/src/hyp3_sdk/stac.py @@ -310,6 +310,11 @@ def create_stac_item(job: Job) -> pystac.Item: base_url = job.to_dict()['files'][0]['url'] param_file_url = base_url.replace('.zip', '.txt') param_file = ParameterFile.read(param_file_url) + + unw_file_url = base_url.replace('.zip', '_unw_phase.tif') + geotransform, shape, epsg = get_geotiff_info_nogdal(unw_file_url) + bbox = get_bounding_box(geotransform, shape) + pattern = '%Y%m%dT%H%M%S' start_time = datetime.strptime(param_file.reference_granule.split('_')[3], pattern).replace(tzinfo=timezone.utc) stop_time = datetime.strptime(param_file.secondary_granule.split('_')[3], pattern).replace(tzinfo=timezone.utc) @@ -321,9 +326,6 @@ def create_stac_item(job: Job) -> pystac.Item: # unw_file_url = '/vsicurl/' + base_url.replace('.zip', '_unw_phase.tif') # geotransform, shape, epsg = get_geotiff_info(unw_file_url) - unw_file_url = base_url.replace('.zip', '_unw_phase.tif') - geotransform, shape, epsg = get_geotiff_info_nogdal(unw_file_url) - bbox = get_bounding_box(geotransform, shape) image_properties = { 'data_type': 'float32',