Skip to content

Commit

Permalink
added float32 conversion and modified raml
Browse files Browse the repository at this point in the history
  • Loading branch information
annajungbluth committed Jul 3, 2024
1 parent 504059d commit 4049235
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions config/esl-3dclouds/geoprocess.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# PATH WITH RAW DATA
read_path: /mnt/disks/data/miniset/
read_path: /home/anna.jungbluth/data/

# PATH FOR SAVING GEOPROCESSED DATA
save_path: /mnt/disks/data/miniset-full-disk/
save_path: /home/anna.jungbluth/data/geoprocessing/

defaults:
- _self_
6 changes: 3 additions & 3 deletions config/esl-3dclouds/main.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defaults:
- download
- geoprocess
- patch
- satellite: aqua
# - patch
- satellite: msg

stage: download
stage: geoprocess
6 changes: 3 additions & 3 deletions config/esl-3dclouds/satellite/msg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ download:

geoprocess:
_target_: rs_tools._src.geoprocessing.msg.geoprocessor_msg.geoprocess
read_path: ${read_path}/msg/raw
save_path: ${save_path}/msg/geoprocessed
read_path: ${read_path}
save_path: ${save_path}
resolution: null
region: "-70 -15 20 5"
region: null
resample_method: bilinear

# preprocess:
Expand Down
3 changes: 3 additions & 0 deletions rs_tools/_src/geoprocessing/msg/geoprocessor_msg.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def preprocess_fn_radiances(self, file: List[str], cloud_mask: np.array) -> xr.D
# concatinate in new band dimension
# NOTE: Concatination overwrites attrs of bands.
ds_subset = ds_subset.assign(Rad=xr.concat(list(map(lambda x: ds_subset[x], channels)), dim="band"))
ds_subset['Rad'] = ds_subset['Rad'].astype('float32')
# rename band dimensions
ds_subset = ds_subset.assign_coords(band=list(map(lambda x: x, channels)))

Expand All @@ -206,6 +207,8 @@ def preprocess_fn_radiances(self, file: List[str], cloud_mask: np.array) -> xr.D
)
# assign band wavelengths
ds_subset = ds_subset.assign_coords({"band_wavelength": list(MSG_WAVELENGTHS.values())})
# change to float32 to reduce file size
ds_subset['Rad'] = ds_subset['Rad'].astype('float32')

return ds_subset

Expand Down

0 comments on commit 4049235

Please sign in to comment.