-
Notifications
You must be signed in to change notification settings - Fork 5
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
Pre-publication DEA Intertidal updates #79
Conversation
For full integration test results, refer to the Tests directory README. |
RUN pip-compile --extra-index-url=https://packages.dea.ga.gov.au/ --output-file=/conf/requirements.txt /conf/requirements.in | ||
# COPY requirements.in /conf/ | ||
# RUN pip-compile --extra-index-url=https://packages.dea.ga.gov.au/ --output-file=/conf/requirements.txt /conf/requirements.in | ||
COPY requirements.txt /conf/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use a precompiled requirements.txt
file rather than creating it on the fly - much faster! We just need to run this manually when we change our inputs
dem_flat_uncertainty = dem_flat_high - dem_flat_low | ||
# Subtract low from high DEM to summarise uncertainty range | ||
# (and divide by two to give one-sided uncertainty) | ||
dem_flat_uncertainty = (dem_flat_high - dem_flat_low) / 2.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Divide uncertainty by 2.0 to get one-sided uncertainty bounds
ocean_connected_mask = ocean_connection( | ||
~(ds.qa_ndwi_freq < min_freq), ocean_mask | ||
) | ||
ds[elevation_bands] = ds[elevation_bands].where(ocean_connected_mask) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any elevation pixels outside of the "connected to ocean" mask are set to NaN
@@ -1067,6 +1088,18 @@ def elevation( | |||
help="Proportion of the tide range to use for each window radius " | |||
"in the per-pixel rolling median calculation, by default 0.15.", | |||
) | |||
@click.option( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will allow us to test seasonality correction in Argo later - off by default
max_freq=max_freq, | ||
min_correlation=min_correlation, | ||
) | ||
# # Calculate extents (to be included in next version) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Temporarily commented out, will restore in next version
aclum_ds = dc.load(product=product, like=geobox, resampling=resampling).squeeze( | ||
"time" | ||
) | ||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try/except to return an empty array rather than an error if no data is available
@@ -782,12 +844,14 @@ def tidal_metadata(ds): | |||
) | |||
|
|||
# Calculate category | |||
metadata_dict["intertidal:category"] = ( | |||
metadata_dict["intertidal:tr_class"] = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed for concistency with "tr" tide range metadata field
"microtidal" | ||
if metadata_dict["intertidal:tr"] < 2 | ||
else "mesotidal" | ||
if 2 <= metadata_dict["intertidal:tr"] <= 4 | ||
else "macrotidal" | ||
if metadata_dict["intertidal:tr"] > 4 | ||
else np.nan |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If metadata_dict["intertidal:tr"]
was NaN, this used to return "macrotidal". Now it returns NaN
too
_write_stac( | ||
dataset_assembler, | ||
destination_path=destination_path, | ||
explorer_base_url=explorer_url, | ||
explorer_base_url="https://explorer.dea.ga.gov.au", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just use main Explorer URL always instead of trying to guess it from S3 path (not sure this is used for anything)
if lat_hat: | ||
lat = min_mod.where(valid_mask) | ||
hat = max_mod.where(valid_mask) | ||
lat = min_mod |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just return tide stats as-is without any masking for now
# from rasterio.features import sieve | ||
|
||
|
||
# def extents_ocean_masking( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Experimental ocean masking version of Extents - not tested at large scale
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work!
Many changes here in the leadup to version 1.0.0:
Extents:
Elevation and exposure
CLI and packaging
Other
requirements.txt