Skip to content

Commit

Permalink
fix(dswx-s1): tile collection location
Browse files Browse the repository at this point in the history
Refs #705
  • Loading branch information
chrisjrd committed Mar 8, 2024
1 parent 485f17b commit 5357b80
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cluster_provisioning/modules/common/mozart.tf
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ resource "aws_instance" "mozart" {
# For daac_data_subscriber utility tool
mkdir ~/Downloads/
aws s3 cp s3://opera-ancillaries/MGRS_tile_collection_v0.2.sqlite ~/Downloads/
aws s3 cp s3://opera-ancillaries/mgrs_tiles/dswx_s1/MGRS_tile_collection_v0.3.sqlite ~/Downloads/
EOT
]
}
Expand Down
2 changes: 1 addition & 1 deletion conf/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ DISP_S1_PRODUCT_VERSION: "0.1"
DSWX_S1_COVERAGE_TARGET: 99
# Force DSWx-S1 processing of pending burst sets after X minutes, rather than waiting for additional data
DSWX_S1_COLLECTION_GRACE_PERIOD_MINUTES: 210
MGRS_TILE_COLLECTION_DB_S3PATH: "s3://opera-ancillaries/MGRS_tile_collection_v0.2.sqlite"
MGRS_TILE_COLLECTION_DB_S3PATH: "s3://opera-ancillaries/mgrs_tiles/dswx_s1/MGRS_tile_collection_v0.3.sqlite"

# The minimum coverage, defined as the percent of bursts in a bursts set, required to run DISP_S1
# Must be a number in the closed interval [0, 99].
Expand Down
5 changes: 3 additions & 2 deletions data_subscriber/rtc/mgrs_bursts_collection_db_client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import ast
import logging
import os
import re
from collections import defaultdict
from functools import cache
Expand Down Expand Up @@ -54,7 +55,7 @@ def load_mgrs_burst_db(filter_land=True):

def load_mgrs_burst_db_raw(filter_land=True) -> GeoDataFrame:
"""Loads the MGRS Tile Collection Database. On AWS environments, this will localize from a known S3 location."""
mtc_local_filepath = Path("~/Downloads/MGRS_tile_collection_v0.2.sqlite").expanduser()
mtc_local_filepath = Path(os.environ.get("MGRS_TILE_COLLECTION_DB_FILEPATH", "~/Downloads/MGRS_tile_collection_v0.3.sqlite")).expanduser()
if mtc_local_filepath.exists():
vector_gdf = gpd.read_file(mtc_local_filepath, crs="EPSG:4326") # , bbox=(-230, 0, -10, 90)) # bbox=(-180, -90, 180, 90) # global
else:
Expand All @@ -70,7 +71,7 @@ def load_mgrs_burst_db_raw(filter_land=True) -> GeoDataFrame:
# vector_gdf = vector_gdf.overlay(na_gdf, how="intersection")
logger.info(f"{len(vector_gdf)=}")
if filter_land:
vector_gdf = vector_gdf[vector_gdf["land_ocean_flag"] == "water/land"] # filter out water (water == no relevant data)
vector_gdf = vector_gdf[vector_gdf["land_ocean_flag"] in ["water/land", "land"]] # filter out water (water == no relevant data)
logger.info(f"{len(vector_gdf)=}")

return vector_gdf
Expand Down
2 changes: 1 addition & 1 deletion tests/opera_chimera/test_precondition_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ def test_get_dswx_s1_static_ancillary_files(self):
},
"mgrs_collection_database_file": {
oc_const.S3_BUCKET: "opera-ancillaries",
oc_const.S3_KEY: "mgrs_tiles/dswx_s1/MGRS_tile_collection_v0.2.1.sqlite"
oc_const.S3_KEY: "mgrs_tiles/dswx_s1/MGRS_tile_collection_v0.3.sqlite"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tools/ops/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ See `data_subscriber/data_subscriber_client.py --help`, documentation comments,
1. Python (see `.python-version`).
1. A clone of the `opera-sds-pcm` repo.
1. data_subscriber_client.py requires GDAL to be natively installed on the host machine. Installation instructions vary by operating system, but macOS users with Homebrew installed may install it using `brew install gdal` or as otherwise noted in `setup.py` in the `cmr_audit` dependency section. NOTE: native `gdal` is distinct from the `GDAL` python package dependency.
1. data_subscriber_client.py requires the MGRS collection DB file to be present in `~/Downloads/MGRS_tile_collection_v0.2.sqlite` This file is found in the ancillary S3 and may also be in the opera-pcm repo.
1. data_subscriber_client.py requires the MGRS collection DB file to be present in `~/Downloads/MGRS_tile_collection_v0.3.sqlite` or the path defined in environment variable `MGRS_TILE_COLLECTION_DB_FILEPATH`. This file is found in the ancillary S3 and may also be in the opera-pcm repo.

### Installation

Expand Down

0 comments on commit 5357b80

Please sign in to comment.