Skip to content
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

Hydra integration #39

Merged
merged 38 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
11ca362
added function to convert units
annajungbluth Mar 19, 2024
d762b2c
added function to convert units
annajungbluth Mar 19, 2024
e5ddbac
added goes16 downloader for pipeline
annajungbluth Mar 19, 2024
765517e
added downloader for terra
annajungbluth Mar 19, 2024
d7a3323
tested terra aqua downloader
annajungbluth Mar 19, 2024
637d3f8
tested goes downloader
annajungbluth Mar 19, 2024
23fcfb0
added and tested msg downloader
annajungbluth Mar 19, 2024
49a3900
First Merge to Hydra-Integration (#35)
jejjohnson Mar 20, 2024
e4925c7
added GOES filename parser
annajungbluth Mar 21, 2024
3849a45
added msg filename parser
annajungbluth Mar 21, 2024
968e9ef
added filename parser for msg
annajungbluth Mar 21, 2024
4402f04
started developing msg pipeline
annajungbluth Mar 21, 2024
0a72a6d
continued developing msg pipeline
annajungbluth Mar 21, 2024
cee8a13
continued working on msg pipeline
annajungbluth Mar 22, 2024
7fa2144
continued hydra integration and finished download components
annajungbluth Mar 22, 2024
6ecc687
added examples to main.py
annajungbluth Mar 22, 2024
75d0db6
added goes geoprocessor to repo, added docstrings
annajungbluth Mar 27, 2024
2828f05
deleted obsolete scripts
annajungbluth Mar 27, 2024
3089ef0
tested goes geoprocessor
annajungbluth Mar 27, 2024
0618df4
updated default args
annajungbluth Mar 27, 2024
a5c3928
notebooks/dev/goes/1.4-GOES-geoprocess-val.ipynb
annajungbluth Mar 27, 2024
cad391b
tested goes geoprocessor
annajungbluth Mar 27, 2024
ef9fa9a
renamed script for consistency
annajungbluth Mar 28, 2024
4ffdf1f
work in progress modis geoprocessing
annajungbluth Mar 28, 2024
2b33e92
merged with other branch
annajungbluth Mar 28, 2024
951d280
continued developing modis geoprocessor
annajungbluth Mar 28, 2024
ba94f25
tested modis geoprocessor
annajungbluth Mar 28, 2024
a04d71e
fixed errors, standardized code, and started with msg geoprocessor
annajungbluth Apr 1, 2024
def165a
fixed modis problem
annajungbluth Apr 1, 2024
075758d
fixed modis naming issue
annajungbluth Apr 2, 2024
34f04d9
fixed small errors and tested MSG geoprocessor
annajungbluth Apr 2, 2024
0729507
fixed default arguments
annajungbluth Apr 2, 2024
10a0314
finished hydra integration of geoprocessing
annajungbluth Apr 4, 2024
7d814d2
started developing prepatcher
annajungbluth Apr 4, 2024
5eb9175
work in progress patcher
annajungbluth Apr 4, 2024
7953222
fixed coordinate, dimension problem
annajungbluth Apr 5, 2024
31b0366
tested patcher and fixed small errors
annajungbluth Apr 5, 2024
4b95a40
integrated patcher into hydra pipeline
annajungbluth Apr 5, 2024
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
16 changes: 16 additions & 0 deletions config/example/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: data

defaults:
- _self_

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

# PATH FOR SAVING GEOPROCESSED DATA
save_path: data

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

stage: patch
18 changes: 18 additions & 0 deletions config/example/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_
Empty file added config/example/preprocess.yaml
Empty file.
25 changes: 25 additions & 0 deletions config/example/satellite/aqua.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
download:
_target_: rs_tools._src.data.modis.downloader_aqua.download
save_dir: ${save_dir}/aqua/
start_date: ${period.start_date}
start_time: ${period.start_time}
end_date: ${period.end_date}
end_time: ${period.end_time}
region: "-130 -15 -90 5" # "lon_min lat_min lon_max lat_max"

geoprocess:
_target_: rs_tools._src.geoprocessing.modis.geoprocessor_modis.geoprocess
read_path: ${read_path}/aqua/raw
save_path: ${save_path}/aqua/geoprocessed
satellite: aqua

# preprocess:

patch:
_target_: rs_tools._src.preprocessing.prepatcher.prepatch
read_path: ${read_path}/aqua/geoprocessed
save_path: ${save_path}/aqua/analysis
patch_size: ${patch_size}
stride_size: ${stride_size}
nan_cutoff: ${nan_cutoff}
save_filetype: ${save_filetype}
29 changes: 29 additions & 0 deletions config/example/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/
start_date: ${period.start_date}
start_time: ${period.start_time}
end_date: ${period.end_date}
end_time: ${period.end_time}
daily_window_t0: "14:00:00"
daily_window_t1: "20: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: "-130 -15 -90 5"
resample_method: bilinear

# 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/example/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/
start_date: ${period.start_date}
start_time: ${period.start_time}
end_date: ${period.end_date}
end_time: ${period.end_time}
daily_window_t0: "9: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: "-70 -15 20 5"
resample_method: bilinear

# 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}
25 changes: 25 additions & 0 deletions config/example/satellite/terra.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
download:
_target_: rs_tools._src.data.modis.downloader_terra.download
save_dir: ${save_dir}/terra/
start_date: ${period.start_date}
start_time: ${period.start_time}
end_date: ${period.end_date}
end_time: ${period.end_time}
region: "-130 -15 -90 5" # "lon_min lat_min lon_max lat_max"

geoprocess:
_target_: rs_tools._src.geoprocessing.modis.geoprocessor_modis.geoprocess
read_path: ${read_path}/terra/raw
save_path: ${save_path}/terra/geoprocessed
satellite: terra

# preprocess:

patch:
_target_: rs_tools._src.preprocessing.prepatcher.prepatch
read_path: ${read_path}/terra/geoprocessed
save_path: ${save_path}/terra/analysis
patch_size: ${patch_size}
stride_size: ${stride_size}
nan_cutoff: ${nan_cutoff}
save_filetype: ${save_filetype}
60 changes: 21 additions & 39 deletions notebooks/1.1-pipeline-goes16.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,27 @@
"id": "1e79e0fb-2f8d-48ea-b2cc-9f86db6ca4e3",
"metadata": {},
"source": [
"In this demo, we will do a full walkthrough of a minimal MODIS pipeline to get some data for training"
"In this demo, we will do a full walkthrough of a minimal GOES pipeline to get some data for training"
]
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 1,
"id": "5d7511e4-80b3-4053-8c5c-bb430d8a0c14",
"metadata": {},
"outputs": [],
"outputs": [
{
"ename": "ModuleNotFoundError",
"evalue": "No module named 'autoroot'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[1], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mautoroot\u001b[39;00m\n\u001b[1;32m 2\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mrs_tools\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01m_src\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mutils\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mio\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m get_list_filenames\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mrioxarray\u001b[39;00m\n",
"\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'autoroot'"
]
}
],
"source": [
"import autoroot\n",
"from rs_tools._src.utils.io import get_list_filenames\n",
Expand Down Expand Up @@ -172,14 +184,10 @@
"id": "06c9b06e-2eb1-4be0-88f1-e2b3e0c2c622",
"metadata": {},
"source": [
"For this case, we are going to download MODIS data.\n",
"\n",
"* AQUA - \"MYDO21KM\"\n",
"* TERRA - \"MODO21KM\"\n",
"* Geolocation - \"MYDO3\"\n",
"For this case, we are going to download GOES data.\n",
"\n",
"**Resources**:\n",
"* NASA LAADS - [Webpage](https://ladsweb.modaps.eosdis.nasa.gov/missions-and-measurements/science-domain/modis-L0L1/)"
"* GOES2GO"
]
},
{
Expand All @@ -205,14 +213,6 @@
"goes_files[0], len(goes_files)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "915384f2-3f98-49f3-907c-a760166179ba",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 10,
Expand Down Expand Up @@ -245,28 +245,10 @@
"metadata": {},
"source": [
"1. Get All Files\n",
"2. Create MODISFileName Identifiers\n",
"2. Create GOESFileName Identifiers\n",
"3. Filter Based on criteria"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f19010d4-a37a-4784-ac5b-18ef86a0ea0f",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 11,
"id": "bd61b03a-ff48-49ac-b24c-b971c9c30f3b",
"metadata": {},
"outputs": [],
"source": [
"import rioxarray"
]
},
{
"cell_type": "code",
"execution_count": 12,
Expand Down Expand Up @@ -5943,9 +5925,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python [conda env:rs_tools]",
"display_name": "Python 3",
"language": "python",
"name": "conda-env-rs_tools-py"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -5957,7 +5939,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.6"
"version": "3.9.6"
}
},
"nbformat": 4,
Expand Down
Loading
Loading