Skip to content

Commit

Permalink
removed user information and added scripts for data download
Browse files Browse the repository at this point in the history
  • Loading branch information
annajungbluth committed Dec 1, 2023
1 parent 5c5b237 commit 3b35214
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 2 deletions.
4 changes: 2 additions & 2 deletions notebooks/0.2.1-MODIS-download.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"from modis_tools.resources import CollectionApi, GranuleApi\n",
"from modis_tools.granule_handler import GranuleHandler\n",
"\n",
"username = \"anna.jungbluth\" # Update this line\n",
"password = \"wakqo4-qipbeX-nomjip\" # Update this line\n",
"username = \"\" # Update this line\n",
"password = \"\" # Update this line\n",
"\n",
"# Authenticate a session\n",
"session = ModisSession(username=username, password=password)"
Expand Down
72 changes: 72 additions & 0 deletions scripts/goes-download.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
"""
Summary: The download script to interact directly with the goes2go package.
We only want to specify what is necessary and compatible with the goes2go package.
In general, we want to satellite, the spatial domain, and the period.
Args:
satellite_number:
**Input Parameters**
Downloading:
- satellite number: int --> (16,17,18)
- spatial extent: str --> full disk (F), CONUS (C), Mesoscale domains (M, M1, M2)
- goes instrument: str --> e.g. ABI radiance (or SUVI for helio)
- preprocessing level: str --> e.g. level-1b
- directory: str
- return xarray dataset or list of files --> return as file list works better?
- band specifications: list[int] --> download all or subset only
- start time (of range of times to be downloaded): str
- end time: str
- timesteps/number of files: str
- day vs. night mode: --> e.g. for only downloading day mode images
Basic Processing:
- resolution: --> downscale all bands to common resolution (e.g. 2 km)
- coordinate system transformations
- etc.
# download stuff
np.arange, np.linspace
t0, t1, dt | num_files
timestamps = [t0, t1, t2]
for itime in timestamps:
# download to folder
# open data in folder
# preprocess - downscale, aggregate bands, coordinate reference system transformations
# resave
# preprocess stuff
preprocess_stuff(*args, **kwargs)
########## GOES ############
# ==================
# DOWNLOAD
# ==================
# download data
download_data(*arg, **kwargs)
# ==================
# QUALITY CHECKS
# ==================
# day & night flag
ds: xr.Dataset = day_and_night_flag(ds, *args, **kwargs)
# all bands are there?
ds: xr.Dataset = check_all_bands(ds, *args, **kwargs)
# ==================
# PREPROCESSING
# ==================
# open dataset
ds: xr.Dataset = ...
# crs transformation
ds: xr.Dataset = crs_transform(ds, *args, **kwargs)
# upscale/downscale
ds: xr.Dataset = resample(ds, *args, **kwargs)
"""
Empty file added scripts/modis-download.py
Empty file.

0 comments on commit 3b35214

Please sign in to comment.