Skip to content

Commit

Permalink
update with more metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquelynsmale committed Dec 18, 2023
1 parent 314015d commit bd9fc40
Show file tree
Hide file tree
Showing 8 changed files with 111 additions and 17 deletions.
59 changes: 59 additions & 0 deletions image_services/opera/metadata/create_metadata.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import argparse
import json

from jinja2 import Environment, PackageLoader, StrictUndefined, select_autoescape


def get_environment() -> Environment:
env = Environment(
loader=PackageLoader('templates', ''),
autoescape=select_autoescape(['html.j2', 'xml.j2']),
undefined=StrictUndefined,
trim_blocks=True,
lstrip_blocks=True,
keep_trailing_newline=True,
)
return env


def render_template(template: str, payload: dict) -> str:
env = get_environment()
template = env.get_template(template)
rendered = template.render(payload)
return rendered


def main():
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument('-o', '--output', help='File to save output to (optional)')
parser.add_argument('-t', '--template', help='Metadata template to fill', default='rtc_metadata.txt.j2')
parser.add_argument('config_file', help='Configuration file from which resources are imported')
args = parser.parse_args()

polarization = json.load(open(args.config_file))['s3_suffix'][1:3]

if polarization[0] != polarization[1]:
polarization_description = f'Values for the {polarization} (cross-polarized) polarization are generally driven by volume scattering, with more complex volume scatterers (such as dense vegetation) returning higher backscatter values. Surface water generally appears very dark, as it is predominantly a surface scatterer; most returns remain in the primary polarization.'
elif polarization[0] == 'V':
polarization_description = f'Values for the {polarization} polarization are commonly driven by surface roughness and/or soil moisture, with rougher surfaces and higher soil moisture returning higher backscatter values. Surface water appears very dark under calm conditions, as the signal bounces off the surface away from the sensor.'
elif polarization[0] == 'H':
polarization_description = f'Values for the {polarization} polarization are a predominance of double-bounce scattering, with signal bouncing off the ground and then off of surficial objects (e.g., stemmy vegetation, manmade structures) and back towards the sensor. Surface water appears very dark under calm conditions, as the signal bounces off the surface away from the sensor.'
else:
polarization_description = ''
fields = {
'polarization': polarization,
'polarization_description': polarization_description
}

output_text = render_template(args.template, fields)
if args.output:
output_file = args.output
else:
output_file = f'metadata/metadata_text/OPERA_RTC_{polarization}_metadata.txt'

with open(output_file, 'w') as f:
f.write(output_text)


if __name__ == '__main__':
main()
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ OPERA RTC-S1 data is available over all landmasses (excluding Antarctica) for Se

The source rasters referenced in this service are hosted by the Alaska Satellite Facility in NASA's Earthdata Cloud. More information about the dataset is available here: [https://asf.alaska.edu/datasets/daac/opera/](https://asf.alaska.edu/datasets/daac/opera/)

OPERA includes partners from NASA’s Goddard Space Flight Center, the U.S. Geological Survey (USGS), the University of Maryland College Park, the University of Alaska Fairbanks, Southern Methodist University, and EarthScope. Refer to [OPERA’s website](https://www.jpl.nasa.gov/go/opera) for more details.
The OPERA project is managed by JPL with partners from NASA’s Goddard Space Flight Center, the U.S. Geological Survey (USGS), the University of Maryland College Park, the University of Alaska Fairbanks, Southern Methodist University, and EarthScope. Refer to [OPERA’s website](https://www.jpl.nasa.gov/go/opera) for more details.

<b>Data Use:</b> Please cite the use of this data set using the following:
OPERA. 2023. OPERA Level-2 Radiometric Terrain Corrected from Sentinel-1. Fairbanks, Alaska USA. NASA Alaska Satellite Facility Distributed Active Archive Center. doi: https://doi.org/10.5067/SNWG/OPERA_L2_RTC-S1_V1. [Date Accessed]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ OPERA RTC-S1 data is available over all landmasses (excluding Antarctica) for Se

The source rasters referenced in this service are hosted by the Alaska Satellite Facility in NASA's Earthdata Cloud. More information about the dataset is available here: [https://asf.alaska.edu/datasets/daac/opera/](https://asf.alaska.edu/datasets/daac/opera/)

OPERA includes partners from NASA’s Goddard Space Flight Center, the U.S. Geological Survey (USGS), the University of Maryland College Park, the University of Alaska Fairbanks, Southern Methodist University, and EarthScope. Refer to [OPERA’s website](https://www.jpl.nasa.gov/go/opera) for more details.
The OPERA project is managed by JPL with partners from NASA’s Goddard Space Flight Center, the U.S. Geological Survey (USGS), the University of Maryland College Park, the University of Alaska Fairbanks, Southern Methodist University, and EarthScope. Refer to [OPERA’s website](https://www.jpl.nasa.gov/go/opera) for more details.

<b>Data Use:</b> Please cite the use of this data set using the following:
OPERA. 2023. OPERA Level-2 Radiometric Terrain Corrected from Sentinel-1. Fairbanks, Alaska USA. NASA Alaska Satellite Facility Distributed Active Archive Center. doi: https://doi.org/10.5067/SNWG/OPERA_L2_RTC-S1_V1. [Date Accessed]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@ Title:
OPERA RTC HH

Tags:
ASF, Alaska Satellite Facility, Synthetic Aperture Radar, SAR, Sentinel-1, OPERA, CALVAL
ASF, Alaska Satellite Facility, Synthetic Aperture Radar, SAR, Sentinel-1, OPERA, CALVAL, Radiometric Terrain Correction, RTC

Summary:
OPERA Level-2 Radiometric Terrain Corrected (RTC) products in HH polarization generated from Sentinel-1 SAR imagery, processed by OPERA (JPL)

Description:
OPERA Level-2 Radiometric Terrain Corrected (RTC) products in HH polarization generated from Sentinel-1 SAR imagery, processed by OPERA (JPL). Values for the HH polarization are commonly driven by surface roughness and/or soil moisture, with rougher surfaces and higher soil moisture returning higher backscatter values. Surface water appears very dark under calm conditions, as the signal bounces off the surface away from the sensor.
OPERA Level-2 Radiometric Terrain Corrected (RTC) SAR Backscatter products in VH polarization generated from Sentinel-1 (S1) SAR imagery, processed by the OPERA project at JPL. Values for the VH (cross-polarized) polarization are generally driven by volume scattering, with more complex volume scatterers (such as dense vegetation) returning higher backscatter values. Surface water generally appears very dark, as it is predominantly a surface scatterer; most returns remain in the primary polarization.

The OPERA project is managed by JPL with partners from NASA’s Goddard Space Flight Center, the U.S. Geological Survey (USGS), the University of Maryland College Park, the University of Alaska Fairbanks, Southern Methodist University, and EarthScope. Refer to [OPERA’s website](https://www.jpl.nasa.gov/go/opera) for more details.

The source rasters referenced in this service are hosted by the Alaska Satellite Facility in NASA's Earthdata Cloud. More information about the dataset is available here: [https://asf.alaska.edu/datasets/daac/opera/](https://asf.alaska.edu/datasets/daac/opera/)

<b>Data Use:</b> Please cite the use of this data set using the following:
OPERA. 2023. OPERA Level-2 Radiometric Terrain Corrected from Sentinel-1. Fairbanks, Alaska USA. NASA Alaska Satellite Facility Distributed Active Archive Center. doi: https://doi.org/10.5067/SNWG/OPERA_L2_RTC-S1_V1. [Date Accessed]

Credits:
OPERA Level-2 Radiometric Terrain Corrected SAR Backscatter from Sentinel-1. NASA Alaska Satellite Facility Distributed Active Archive Center. doi: https://doi.org/10.5067/SNWG/OPERA_L2_RTC-S1_V1. Contains modified Copernicus Sentinel data, processed by ESA.
OPERA Level-2 Radiometric Terrain Corrected SAR Backscatter from Sentinel-1. NASA Alaska Satellite Facility Distributed Active Archive Center. doi: https://doi.org/10.5067/SNWG/OPERA_L2_RTC-S1_V1. Contains modified Copernicus Sentinel data, processed by ESA.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@ Title:
OPERA RTC HV

Tags:
ASF, Alaska Satellite Facility, Synthetic Aperture Radar, SAR, Sentinel-1, OPERA, CALVAL
ASF, Alaska Satellite Facility, Synthetic Aperture Radar, SAR, Sentinel-1, OPERA, CALVAL, Radiometric Terrain Correction, RTC

Summary:
OPERA Level-2 Radiometric Terrain Corrected (RTC) products in HV polarization generated from Sentinel-1 SAR imagery, processed by OPERA (JPL)

Description:
OPERA Level-2 Radiometric Terrain Corrected (RTC) products in HV polarization generated from Sentinel-1 SAR imagery, processed by OPERA (JPL). Values for the HV polarization are commonly driven by surface roughness and/or soil moisture, with rougher surfaces and higher soil moisture returning higher backscatter values. Surface water appears very dark under calm conditions, as the signal bounces off the surface away from the sensor.
OPERA Level-2 Radiometric Terrain Corrected (RTC) SAR Backscatter products in VH polarization generated from Sentinel-1 (S1) SAR imagery, processed by the OPERA project at JPL. Values for the VH (cross-polarized) polarization are generally driven by volume scattering, with more complex volume scatterers (such as dense vegetation) returning higher backscatter values. Surface water generally appears very dark, as it is predominantly a surface scatterer; most returns remain in the primary polarization.

The OPERA project is managed by JPL with partners from NASA’s Goddard Space Flight Center, the U.S. Geological Survey (USGS), the University of Maryland College Park, the University of Alaska Fairbanks, Southern Methodist University, and EarthScope. Refer to [OPERA’s website](https://www.jpl.nasa.gov/go/opera) for more details.

The source rasters referenced in this service are hosted by the Alaska Satellite Facility in NASA's Earthdata Cloud. More information about the dataset is available here: [https://asf.alaska.edu/datasets/daac/opera/](https://asf.alaska.edu/datasets/daac/opera/)

<b>Data Use:</b> Please cite the use of this data set using the following:
OPERA. 2023. OPERA Level-2 Radiometric Terrain Corrected from Sentinel-1. Fairbanks, Alaska USA. NASA Alaska Satellite Facility Distributed Active Archive Center. doi: https://doi.org/10.5067/SNWG/OPERA_L2_RTC-S1_V1. [Date Accessed]

Credits:
OPERA Level-2 Radiometric Terrain Corrected SAR Backscatter from Sentinel-1. NASA Alaska Satellite Facility Distributed Active Archive Center. doi: https://doi.org/10.5067/SNWG/OPERA_L2_RTC-S1_V1. Contains modified Copernicus Sentinel data, processed by ESA.
OPERA Level-2 Radiometric Terrain Corrected SAR Backscatter from Sentinel-1. NASA Alaska Satellite Facility Distributed Active Archive Center. doi: https://doi.org/10.5067/SNWG/OPERA_L2_RTC-S1_V1. Contains modified Copernicus Sentinel data, processed by ESA.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@ Title:
OPERA RTC VH

Tags:
ASF, Alaska Satellite Facility, Synthetic Aperture Radar, SAR, Sentinel-1, OPERA, CALVAL
ASF, Alaska Satellite Facility, Synthetic Aperture Radar, SAR, Sentinel-1, OPERA, CALVAL, Radiometric Terrain Correction, RTC

Summary:
OPERA Level-2 Radiometric Terrain Corrected (RTC) products in VH polarization generated from Sentinel-1 SAR imagery, processed by OPERA (JPL)

Description:
OPERA Level-2 Radiometric Terrain Corrected (RTC) products in VH polarization generated from Sentinel-1 SAR imagery, processed by OPERA (JPL). Values for the VH (cross-polarized) polarization are generally driven by volume scattering, with more complex volume scatterers (such as dense vegetation) returning higher backscatter values. Surface water generally appears very dark, as it is predominantly a surface scatterer; most returns remain in the primary polarization.
OPERA Level-2 Radiometric Terrain Corrected (RTC) SAR Backscatter products in VH polarization generated from Sentinel-1 (S1) SAR imagery, processed by the OPERA project at JPL. Values for the VH (cross-polarized) polarization are generally driven by volume scattering, with more complex volume scatterers (such as dense vegetation) returning higher backscatter values. Surface water generally appears very dark, as it is predominantly a surface scatterer; most returns remain in the primary polarization.

The OPERA project is managed by JPL with partners from NASA’s Goddard Space Flight Center, the U.S. Geological Survey (USGS), the University of Maryland College Park, the University of Alaska Fairbanks, Southern Methodist University, and EarthScope. Refer to [OPERA’s website](https://www.jpl.nasa.gov/go/opera) for more details.

The source rasters referenced in this service are hosted by the Alaska Satellite Facility in NASA's Earthdata Cloud. More information about the dataset is available here: [https://asf.alaska.edu/datasets/daac/opera/](https://asf.alaska.edu/datasets/daac/opera/)

<b>Data Use:</b> Please cite the use of this data set using the following:
OPERA. 2023. OPERA Level-2 Radiometric Terrain Corrected from Sentinel-1. Fairbanks, Alaska USA. NASA Alaska Satellite Facility Distributed Active Archive Center. doi: https://doi.org/10.5067/SNWG/OPERA_L2_RTC-S1_V1. [Date Accessed]

Credits:
OPERA Level-2 Radiometric Terrain Corrected SAR Backscatter from Sentinel-1. NASA Alaska Satellite Facility Distributed Active Archive Center. doi: https://doi.org/10.5067/SNWG/OPERA_L2_RTC-S1_V1. Contains modified Copernicus Sentinel data, processed by ESA.
OPERA Level-2 Radiometric Terrain Corrected SAR Backscatter from Sentinel-1. NASA Alaska Satellite Facility Distributed Active Archive Center. doi: https://doi.org/10.5067/SNWG/OPERA_L2_RTC-S1_V1. Contains modified Copernicus Sentinel data, processed by ESA.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@ Title:
OPERA RTC VV

Tags:
ASF, Alaska Satellite Facility, Synthetic Aperture Radar, SAR, Sentinel-1, OPERA, CALVAL
ASF, Alaska Satellite Facility, Synthetic Aperture Radar, SAR, Sentinel-1, OPERA, CALVAL, Radiometric Terrain Correction, RTC

Summary:
OPERA Level-2 Radiometric Terrain Corrected (RTC) products in VV polarization generated from Sentinel-1 SAR imagery, processed by OPERA (JPL)

Description:
OPERA Level-2 Radiometric Terrain Corrected (RTC) products in VV polarization generated from Sentinel-1 SAR imagery, processed by OPERA (JPL). Values for the VV polarization are commonly driven by surface roughness and/or soil moisture, with rougher surfaces and higher soil moisture returning higher backscatter values. Surface water appears very dark under calm conditions, as the signal bounces off the surface away from the sensor.
OPERA Level-2 Radiometric Terrain Corrected (RTC) SAR Backscatter products in VH polarization generated from Sentinel-1 (S1) SAR imagery, processed by the OPERA project at JPL. Values for the VH (cross-polarized) polarization are generally driven by volume scattering, with more complex volume scatterers (such as dense vegetation) returning higher backscatter values. Surface water generally appears very dark, as it is predominantly a surface scatterer; most returns remain in the primary polarization.

The OPERA project is managed by JPL with partners from NASA’s Goddard Space Flight Center, the U.S. Geological Survey (USGS), the University of Maryland College Park, the University of Alaska Fairbanks, Southern Methodist University, and EarthScope. Refer to [OPERA’s website](https://www.jpl.nasa.gov/go/opera) for more details.

The source rasters referenced in this service are hosted by the Alaska Satellite Facility in NASA's Earthdata Cloud. More information about the dataset is available here: [https://asf.alaska.edu/datasets/daac/opera/](https://asf.alaska.edu/datasets/daac/opera/)

<b>Data Use:</b> Please cite the use of this data set using the following:
OPERA. 2023. OPERA Level-2 Radiometric Terrain Corrected from Sentinel-1. Fairbanks, Alaska USA. NASA Alaska Satellite Facility Distributed Active Archive Center. doi: https://doi.org/10.5067/SNWG/OPERA_L2_RTC-S1_V1. [Date Accessed]

Credits:
OPERA Level-2 Radiometric Terrain Corrected SAR Backscatter from Sentinel-1. NASA Alaska Satellite Facility Distributed Active Archive Center. doi: https://doi.org/10.5067/SNWG/OPERA_L2_RTC-S1_V1. Contains modified Copernicus Sentinel data, processed by ESA.
OPERA Level-2 Radiometric Terrain Corrected SAR Backscatter from Sentinel-1. NASA Alaska Satellite Facility Distributed Active Archive Center. doi: https://doi.org/10.5067/SNWG/OPERA_L2_RTC-S1_V1. Contains modified Copernicus Sentinel data, processed by ESA.
13 changes: 10 additions & 3 deletions image_services/opera/metadata/templates/rtc_metadata.txt.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@ Title:
OPERA RTC {{ polarization }}

Tags:
ASF, Alaska Satellite Facility, Synthetic Aperture Radar, SAR, Sentinel-1, OPERA, CALVAL
ASF, Alaska Satellite Facility, Synthetic Aperture Radar, SAR, Sentinel-1, OPERA, CALVAL, Radiometric Terrain Correction, RTC

Summary:
OPERA Level-2 Radiometric Terrain Corrected (RTC) products in {{ polarization }} polarization generated from Sentinel-1 SAR imagery, processed by OPERA (JPL)

Description:
OPERA Level-2 Radiometric Terrain Corrected (RTC) products in {{ polarization }} polarization generated from Sentinel-1 SAR imagery, processed by OPERA (JPL). Values for the {{ polarization }} polarization are commonly driven by surface roughness and/or soil moisture, with rougher surfaces and higher soil moisture returning higher backscatter values. Surface water appears very dark under calm conditions, as the signal bounces off the surface away from the sensor.
OPERA Level-2 Radiometric Terrain Corrected (RTC) SAR Backscatter products in VH polarization generated from Sentinel-1 (S1) SAR imagery, processed by the OPERA project at JPL. Values for the VH (cross-polarized) polarization are generally driven by volume scattering, with more complex volume scatterers (such as dense vegetation) returning higher backscatter values. Surface water generally appears very dark, as it is predominantly a surface scatterer; most returns remain in the primary polarization.

The OPERA project is managed by JPL with partners from NASA’s Goddard Space Flight Center, the U.S. Geological Survey (USGS), the University of Maryland College Park, the University of Alaska Fairbanks, Southern Methodist University, and EarthScope. Refer to [OPERA’s website](https://www.jpl.nasa.gov/go/opera) for more details.

The source rasters referenced in this service are hosted by the Alaska Satellite Facility in NASA's Earthdata Cloud. More information about the dataset is available here: [https://asf.alaska.edu/datasets/daac/opera/](https://asf.alaska.edu/datasets/daac/opera/)

<b>Data Use:</b> Please cite the use of this data set using the following:
OPERA. 2023. OPERA Level-2 Radiometric Terrain Corrected from Sentinel-1. Fairbanks, Alaska USA. NASA Alaska Satellite Facility Distributed Active Archive Center. doi: https://doi.org/10.5067/SNWG/OPERA_L2_RTC-S1_V1. [Date Accessed]

Credits:
OPERA Level-2 Radiometric Terrain Corrected SAR Backscatter from Sentinel-1. NASA Alaska Satellite Facility Distributed Active Archive Center. doi: https://doi.org/10.5067/SNWG/OPERA_L2_RTC-S1_V1. Contains modified Copernicus Sentinel data, processed by ESA.
OPERA Level-2 Radiometric Terrain Corrected SAR Backscatter from Sentinel-1. NASA Alaska Satellite Facility Distributed Active Archive Center. doi: https://doi.org/10.5067/SNWG/OPERA_L2_RTC-S1_V1. Contains modified Copernicus Sentinel data, processed by ESA.

0 comments on commit bd9fc40

Please sign in to comment.