From 4049235481adac695bc8cba10acc68f6cd6a4a0d Mon Sep 17 00:00:00 2001 From: annajungbluth Date: Wed, 3 Jul 2024 20:01:38 +0000 Subject: [PATCH] added float32 conversion and modified raml --- config/esl-3dclouds/geoprocess.yaml | 4 ++-- config/esl-3dclouds/main.yaml | 6 +++--- config/esl-3dclouds/satellite/msg.yaml | 6 +++--- rs_tools/_src/geoprocessing/msg/geoprocessor_msg.py | 3 +++ 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/config/esl-3dclouds/geoprocess.yaml b/config/esl-3dclouds/geoprocess.yaml index c9e4e09..99aa1b7 100644 --- a/config/esl-3dclouds/geoprocess.yaml +++ b/config/esl-3dclouds/geoprocess.yaml @@ -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_ diff --git a/config/esl-3dclouds/main.yaml b/config/esl-3dclouds/main.yaml index fba8caa..9e5f3e1 100644 --- a/config/esl-3dclouds/main.yaml +++ b/config/esl-3dclouds/main.yaml @@ -1,7 +1,7 @@ defaults: - download - geoprocess - - patch - - satellite: aqua + # - patch + - satellite: msg -stage: download \ No newline at end of file +stage: geoprocess \ No newline at end of file diff --git a/config/esl-3dclouds/satellite/msg.yaml b/config/esl-3dclouds/satellite/msg.yaml index 55741c2..2712219 100644 --- a/config/esl-3dclouds/satellite/msg.yaml +++ b/config/esl-3dclouds/satellite/msg.yaml @@ -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: diff --git a/rs_tools/_src/geoprocessing/msg/geoprocessor_msg.py b/rs_tools/_src/geoprocessing/msg/geoprocessor_msg.py index 4efdf96..5ad19d7 100644 --- a/rs_tools/_src/geoprocessing/msg/geoprocessor_msg.py +++ b/rs_tools/_src/geoprocessing/msg/geoprocessor_msg.py @@ -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))) @@ -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