Skip to content

Commit

Permalink
created miniset hydra configs, added autoroot to __main__.py to set t…
Browse files Browse the repository at this point in the history
…he correct working directory
  • Loading branch information
lillif committed Apr 29, 2024
1 parent 1b269f5 commit 6e72b5e
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 1 deletion.
16 changes: 16 additions & 0 deletions config/miniset/download.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# PERIOD
period:
start_date: '2020-10-01'
start_time: '00:00:00'
end_date: '2020-10-31'
end_time: '23:59:00'

# CLOUD MASK
cloud_mask: True

# PATH FOR SAVING DATA
save_dir: /mnt/disks/data/miniset

defaults:
- _self_

8 changes: 8 additions & 0 deletions config/miniset/geoprocess.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# PATH WITH RAW DATA
read_path: /mnt/disks/data/miniset/

# PATH FOR SAVING GEOPROCESSED DATA
save_path: /mnt/disks/data/miniset/

defaults:
- _self_
7 changes: 7 additions & 0 deletions config/miniset/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
defaults:
- download
- geoprocess
# - patch
- satellite: goes

stage: download
18 changes: 18 additions & 0 deletions config/miniset/patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# PATH WITH GEOPROCESSED DATA
read_path: data

# PATH FOR SAVING PATCHES
save_path: data

# PATCH PARAMETERS
patch_size: 256
stride_size: 256

# NAN CUTOFF
nan_cutoff: 0.5

# FILETYPE TO SAVE [nc = netcdf, np = numpy]
save_filetype: nc

defaults:
- _self_
29 changes: 29 additions & 0 deletions config/miniset/satellite/goes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
download:
_target_: rs_tools._src.data.goes.downloader_goes16.download
save_dir: ${save_dir}/goes16/raw
start_date: ${period.start_date}
start_time: ${period.start_time}
end_date: ${period.end_date}
end_time: ${period.end_time}
daily_window_t0: "13:00:00" # UTC - 1 to -3
daily_window_t1: "17:00:00"
time_step: "1:00:00"

geoprocess:
_target_: rs_tools._src.geoprocessing.goes.geoprocessor_goes16.geoprocess
read_path: ${read_path}/goes16/raw
save_path: ${save_path}/goes16/geoprocessed
resolution: null
region: "-45 0 -20 40"
resample_method: null

# preprocess:

# patch:
# _target_: rs_tools._src.preprocessing.prepatcher.prepatch
# read_path: ${read_path}/goes16/geoprocessed
# save_path: ${save_path}/goes16/analysis
# patch_size: ${patch_size}
# stride_size: ${stride_size}
# nan_cutoff: ${nan_cutoff}
# save_filetype: ${save_filetype}
29 changes: 29 additions & 0 deletions config/miniset/satellite/msg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
download:
_target_: rs_tools._src.data.msg.downloader_msg.download
save_dir: ${save_dir}/msg/raw
start_date: ${period.start_date}
start_time: ${period.start_time}
end_date: ${period.end_date}
end_time: ${period.end_time}
daily_window_t0: "13:00:00"
daily_window_t1: "17:00:00"
time_step: "1:00:00"

geoprocess:
_target_: rs_tools._src.geoprocessing.msg.geoprocessor_msg.geoprocess
read_path: ${read_path}/msg/raw
save_path: ${save_path}/msg/geoprocessed
resolution: null
region: "-45 0 -20 40"
resample_method: null

# preprocess:

# patch:
# _target_: rs_tools._src.preprocessing.prepatcher.prepatch
# read_path: ${read_path}/msg/geoprocessed
# save_path: ${save_path}/msg/analysis
# patch_size: ${patch_size}
# stride_size: ${stride_size}
# nan_cutoff: ${nan_cutoff}
# save_filetype: ${save_filetype}
5 changes: 4 additions & 1 deletion rs_tools/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
from typing import Dict
from loguru import logger
from omegaconf import OmegaConf, DictConfig
import autoroot

# TODO add option to provide config path via command line

@hydra.main(config_path="../config/example/", config_name="main", version_base="1.3")
@hydra.main(config_path="../config/miniset/", config_name="main", version_base="1.3")
def main(cfg):
# instantiate the config
logger.debug(f"Choosing Stage...")
Expand All @@ -36,5 +38,6 @@ def main(cfg):
raise ValueError(f"Unrecognized stage: {cfg.stage}")

if __name__ == "__main__":
root_dir = autoroot.root
main()

0 comments on commit 6e72b5e

Please sign in to comment.