Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
12d2a8e
update Dockerfile to Python 3.9
gshiroma Oct 14, 2022
13e5b9d
Fix DIAG no data value (from 34464 to 65535)
gshiroma Oct 19, 2022
bc2a83c
add cast shadow masking
gshiroma Nov 19, 2022
4a2e9e7
use tempfile.NamedTemporaryFile() for temporary variables
gshiroma Dec 5, 2022
1405f93
update the naming of uncollapsed water classes 3 and 4
gshiroma Dec 8, 2022
5e35d64
simplify code
gshiroma Dec 8, 2022
47b084e
add placeholder for runconfig parameter `check_ancillary_inputs_cover…
gshiroma Dec 8, 2022
948d66c
add 4.9-km HLS margin to MGRS 100 km x 100 km tiles
gshiroma Dec 11, 2022
89c36b2
fix `check_ancillary_inputs_coverage` comments
gshiroma Dec 16, 2022
2f379eb
use tempfile.NamedTemporaryFile() for temporary variables (2)
gshiroma Dec 16, 2022
15d4c2f
rename HLS QA band to FMask and DSWx-HLS QA to CLOUD mask
gshiroma Dec 16, 2022
6e6e56f
rename `fill_data` to `fill_value`; mask out points where Fmask == fi…
gshiroma Dec 16, 2022
25ff661
remove debug messages
gshiroma Dec 16, 2022
8ea0ccd
mask out points where Fmask == fill value (2)
gshiroma Dec 16, 2022
53d7234
add ctable to diagnostic layer
gshiroma Dec 17, 2022
7d277bf
fix assignment of DIAGNOSTIC_LAYER_NO_DATA_BINARY_REPR onto diagnosti…
gshiroma Dec 17, 2022
d412e04
expose `copernicus_forest_classes` to the runconfig
gshiroma Dec 19, 2022
264ed13
update SOFTWARE_VERSION to v0.5.2
gshiroma Dec 19, 2022
5d0cb15
update PROCESSING_DATETIME and SPACECRAFT_NAME to follow DSWx-HLS pro…
gshiroma Dec 19, 2022
8a764b7
store software version in a different file: src/proteus/version.py
gshiroma Dec 19, 2022
46f96cb
store software version in a different file: src/proteus/version.py (2)
gshiroma Dec 19, 2022
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
2 changes: 2 additions & 0 deletions bin/dswx_hls.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ def main():
flag_use_otsu_terrain_masking=args.flag_use_otsu_terrain_masking,
min_slope_angle = args.min_slope_angle,
max_sun_local_inc_angle=args.max_sun_local_inc_angle,
apply_cast_shadow_masking=args.apply_cast_shadow_masking,
mask_adjacent_to_cloud_mode=args.mask_adjacent_to_cloud_mode,
copernicus_forest_classes=args.copernicus_forest_classes,
flag_debug=args.flag_debug)


Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM ubuntu:20.04
FROM python:3.8
FROM python:3.9

# Set default UID and GID
ENV USER_ID 1000
Expand Down
18 changes: 17 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,23 @@
from setuptools import setup
from setuptools import Command

__version__ = version = VERSION = '0.1'

def _get_version():
"""Returns the PROTEUS software version

Returns
-------
version : str
PROTEUS software version
"""

version_file = 'src/proteus/version.py'
version = open(version_file).read().split('=')[1]
version = version.replace("'", '').replace('"', '').strip()

return version

__version__ = version = VERSION = _get_version()


class CleanCommand(Command):
Expand Down
11 changes: 6 additions & 5 deletions src/proteus/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def save_as_cog(filename, scratch_dir = '.', logger = None,
logger = logging.getLogger('proteus')

logger.info('COG step 1: add overviews')
gdal_ds = gdal.Open(filename, 1)
gdal_ds = gdal.Open(filename, gdal.GA_Update)
gdal_dtype = gdal_ds.GetRasterBand(1).DataType
dtype_name = gdal.GetDataTypeName(gdal_dtype).lower()

Expand Down Expand Up @@ -62,7 +62,6 @@ def save_as_cog(filename, scratch_dir = '.', logger = None,
if flag_compress:
gdal_translate_options += ['COMPRESS=DEFLATE']

is_integer = 'byte' in dtype_name or 'int' in dtype_name
if is_integer:
gdal_translate_options += ['PREDICTOR=2']
else:
Expand Down Expand Up @@ -90,7 +89,7 @@ def save_as_cog(filename, scratch_dir = '.', logger = None,
f' optimized GeoTIFF!')


def get_geographic_boundaries_from_mgrs_tile(mgrs_tile_name, verbose=False):
def get_hls_geographic_boundaries_from_mgrs_tile(mgrs_tile_name, verbose=False):

import mgrs
mgrs_obj = mgrs.MGRS()
Expand Down Expand Up @@ -122,8 +121,10 @@ def get_geographic_boundaries_from_mgrs_tile(mgrs_tile_name, verbose=False):
for offset_x_multiplier in range(2):
for offset_y_multiplier in range(2):

x = x_min + offset_x_multiplier * 109.8 * 1000
y = y_min + offset_y_multiplier * 109.8 * 1000
# We are using MGRS 100km x 100km tiles
# HLS tiles have 4.9 km of margin => width/length = 109.8 km
x = x_min - 4.9 * 1000 + offset_x_multiplier * 109.8 * 1000
y = y_min - 4.9 * 1000 + offset_y_multiplier * 109.8 * 1000
lat, lon, z = transformation.TransformPoint(x, y, elevation)

if verbose:
Expand Down
10 changes: 10 additions & 0 deletions src/proteus/defaults/dswx_hls.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ runconfig:
product_version:

processing:

# Check if ancillary inputs cover entirely the output product
check_ancillary_inputs_coverage: True

# Use terrain-masking based on the Otsu method
flag_use_otsu_terrain_masking: False

Expand All @@ -61,9 +65,15 @@ runconfig:
# Maximum sun local-incidence angle in degrees for terrain masking
max_sun_local_inc_angle: 40

# Apply cast shadow masking
apply_cast_shadow_masking: False

# Define how areas adjacent to cloud/cloud-shadow should be handled
mask_adjacent_to_cloud_mode: 'mask'

# Copernicus CGLS Land Cover 100m forest classes
copernicus_forest_classes: [20, 111, 113, 115, 116, 121, 123, 125, 126]

save_wtr: True # Layer 1 - WTR
save_bwtr: True # Layer 2 - BWTR
save_conf: True # Layer 3 - CONF
Expand Down
Loading