Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge develop into main for v1.2.3 #9

Merged
merged 3 commits into from
Feb 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v1.2.3](https://github.com/emit-sds/emit-utils/compare/v1.2.2...v1.2.3)

> 17 February 2023

- Add software delivery version to UMM-G and NetCDF metadata [`e881f7a`](https://github.com/emit-sds/emit-utils/commit/e881f7af6e77e97408426d211e6dd4d6c80e8b15)
- Update version to 1.2.3 [`dfd9a2f`](https://github.com/emit-sds/emit-utils/commit/dfd9a2f7ae978840f09e483dc7f75268858e189a)

#### [v1.2.2](https://github.com/emit-sds/emit-utils/compare/v1.2.1...v1.2.2)

> 25 January 2023

- Merge develop into main for v1.2.2 [`#8`](https://github.com/emit-sds/emit-utils/pull/8)
- Update change log [`a81cce6`](https://github.com/emit-sds/emit-utils/commit/a81cce608ab526cf022f5f257496096341e849f0)
- bugfix for east/west long metadata [`a6de126`](https://github.com/emit-sds/emit-utils/commit/a6de12627606c615fc462c60f30fb3a9779b9cb3)
- Update to 1.2.2 [`08ac199`](https://github.com/emit-sds/emit-utils/commit/08ac1993ffd5762234836925094f6a390f41ed87)

Expand Down
15 changes: 10 additions & 5 deletions emit_utils/daac_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ def makeGlobalAttrBase(nc_ds: netCDF4.Dataset):



def makeGlobalAttr(nc_ds: netCDF4.Dataset, primary_envi_file: str, glt_envi_file: str = None):
def makeGlobalAttr(nc_ds: netCDF4.Dataset, primary_envi_file: str, software_delivery_version: str,
glt_envi_file: str = None):
"""
Set up global attributes that are universal. Required attributes that should be populated by individual PGEs
are flagged with None values
Expand All @@ -234,6 +235,7 @@ def makeGlobalAttr(nc_ds: netCDF4.Dataset, primary_envi_file: str, glt_envi_file
nc_ds.time_coverage_start = primary_ds.metadata['emit acquisition start time']
nc_ds.time_coverage_end = primary_ds.metadata['emit acquisition stop time']
nc_ds.software_build_version = primary_ds.metadata['emit software build version']
nc_ds.software_delivery_version = software_delivery_version
nc_ds.product_version = "V0" + primary_ds.metadata['emit data product version']
run_command = "PGE Run Command: {" + primary_ds.metadata['emit pge run command'] + "}"
input_files = "PGE Input Files: {" + ", ".join(primary_ds.metadata['emit pge input files']) + "}"
Expand Down Expand Up @@ -279,10 +281,11 @@ def get_required_ummg():

def initialize_ummg(granule_name: str, creation_time: datetime, collection_name: str, collection_version: str,
start_time: datetime, stop_time: datetime, pge_name: str, pge_version: str,
software_build_version: str = None, doi: str = None, orbit: int = None, orbit_segment: int = None,
scene: int = None, solar_zenith: float = None, solar_azimuth: float = None,
water_vapor: float = None, aod: float = None, mean_fractional_cover: float = None,
mean_spectral_abundance: float = None, cloud_fraction: str = None):
software_build_version: str = None, software_delivery_version: str = None, doi: str = None,
orbit: int = None, orbit_segment: int = None, scene: int = None, solar_zenith: float = None,
solar_azimuth: float = None, water_vapor: float = None, aod: float = None,
mean_fractional_cover: float = None, mean_spectral_abundance: float = None,
cloud_fraction: str = None):
""" Initialize a UMMG metadata output file
Args:
granule_name: granule UR tag
Expand Down Expand Up @@ -331,6 +334,8 @@ def initialize_ummg(granule_name: str, creation_time: datetime, collection_name:
ummg['AdditionalAttributes'] = []
if software_build_version is not None:
ummg['AdditionalAttributes'].append({'Name': 'SOFTWARE_BUILD_VERSION', 'Values': [str(software_build_version)]})
if software_delivery_version is not None:
ummg['AdditionalAttributes'].append({'Name': 'SOFTWARE_DELIVERY_VERSION', 'Values': [str(software_delivery_version)]})
if doi is not None:
ummg['AdditionalAttributes'].append({'Name': 'Identifier_product_doi_authority', 'Values': ["https://doi.org"]})
ummg['AdditionalAttributes'].append({'Name': 'Identifier_product_doi', 'Values': [str(doi)]})
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
setup(name='emit_utils',
packages=find_packages(),
include_package_data=True,
version='1.2.2',
version='1.2.3',
install_requires=[
'gdal>=2.0',
'spectral>=0.21',
Expand Down