Skip to content

Commit

Permalink
Merge pull request #28 from NASA-IMPACT/l9update
Browse files Browse the repository at this point in the history
L9 source product field updage.
  • Loading branch information
sharkinsspatial authored Aug 16, 2022
2 parents 2f508c3 + c0157a3 commit 6f504b5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 6 additions & 2 deletions metadata_creator/metadata_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,12 @@ def template_handler(self):
with open(os.path.join(util_dir, self.product + ".json"), "r") as template_file:
template = json.load(template_file, object_pairs_hook=OrderedDict)
template = template[self.product]
spacecraft_name = self.attributes.get("SPACECRAFT_NAME")
platform = "LANDSAT-8" if spacecraft_name is None else spacecraft_name
product_uri = self.attributes.get("PRODUCT_URI")
landsat_product_id = self.attributes.get("LANDSAT_PRODUCT_ID")
if product_uri is not None:
platform = "Sentinel-2B" if "S2B" in product_uri else "Sentinel-2A"
if landsat_product_id is not None:
platform = "LANDSAT-8" if "LC08" in landsat_product_id else "LANDSAT-9"
self.root["Collection"]["DataSetId"] = template["DataSetId"]
self.root["DataFormat"] = template["DataFormat"]
self.file_extension = self.data_file.split(".")[-1]
Expand Down
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,19 @@
"pyhdf",
"pyproj==2.6.1",
"rasterio",
"shapely",
"shapely==1.8a1",
"lxml",
],
extras_require={
"test": [
"pytest",
"pytest-cov",
"black",
"flake8",
"isort",
],
"dev": [
"pytest",
"black",
"black==20.8b1",
"flake8",
"isort",
"pre-commit",
Expand Down

0 comments on commit 6f504b5

Please sign in to comment.