-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from gregstarr/develop
south hemisphere in progress, improved documentation in progress
- Loading branch information
Showing
17 changed files
with
455 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,61 @@ | ||
# trough | ||
[![Python Package using Conda](https://github.com/gregstarr/trough/actions/workflows/python-package-conda.yml/badge.svg)](https://github.com/gregstarr/trough/actions/workflows/python-package-conda.yml) | ||
[![codecov](https://codecov.io/gh/gregstarr/trough/branch/master/graph/badge.svg?token=QNCESQ41EW)](https://codecov.io/gh/gregstarr/trough) | ||
|
||
# trough | ||
mid latitude ionospheric trough research | ||
![GitHub](https://img.shields.io/github/license/gregstarr/trough) | ||
![GitHub last commit](https://img.shields.io/github/last-commit/gregstarr/trough?color=blue&style=flat) | ||
![Lines of code](https://img.shields.io/tokei/lines/github/gregstarr/trough?color=orange) | ||
![GitHub Repo stars](https://img.shields.io/github/stars/gregstarr/trough?style=social) | ||
|
||
### Example | ||
|
||
![Example](example.png) | ||
|
||
### Features | ||
- Download Madrigal TEC, OMNI and DMSP SSUSI data | ||
- Process datasets into more convenient `xarray` data structures and save as NetCDF | ||
- Automatically label main ionospheric trough | ||
|
||
# Usage | ||
|
||
1. Clone Repo | ||
2. create conda environment using `environment.yml` (if you have trouble with apexpy, install it first) | ||
3. install trough with `pip install -e .` | ||
4. copy `config.json.example` --> `config.json` and change any options you want | ||
5. run with `python -m trough config.json` | ||
6. wait for it to finish (can take several days if you are running 5+ years) | ||
7. add `import trough` in your code and access the data using `trough.get_data` | ||
|
||
### Config | ||
#### Main Options | ||
| Config Option | Definition | | ||
| --- |-------------------------------------------------------------------------------------------------------------------------| | ||
| base_dir | base directory of trough downloads and processing, directories for downloading and processing will be created from here | | ||
| madrigal_user_name | name supplied to MadrigalWeb | | ||
| madrigal_user_email | email supplied to MadrigalWeb | | ||
| madrigal_user_affil | affiliation supplied to MadrigalWeb | | ||
| nasa_spdf_download_method | "http" or "ftp" (default) | | ||
| lat_res | latitude resolution of processed TEC maps (degrees Apex magnetic latitude) | | ||
| lon_res | longitude resolution of processed TEC maps (degrees Apex magnetic longitude) | | ||
| time_res_unit | time resolution units (passed to `np.timedelta64`) | | ||
| time_res_n | time resolution in units specified above (passed to `np.timedelta64`) | | ||
| script_name | which script to run, available scripts are in `trough/scripts.py` | | ||
| start_date | start date of interval (YYYYMMDD, YYYYMMDD_hh, YYYYMMDD_hhmm, or YYYYMMDD_hhmmss) | | ||
| end_date | end date of interval, see "start_date" for format | | ||
| keep_download | whether or not to keep the downloaded files (not recommended) | | ||
| trough_id_params | trough labeling algorithm parameters, see below | | ||
|
||
#### Trough Labeling Options | ||
| Config Option | Definition | | ||
| --- |-------------------------------------------------------------------------------------| | ||
| bg_est_shape | background estimation filter size in pixels [time, latitude, longitude] | | ||
| model_weight_max | maximum value of L2 regularization before multiplication by coefficient `l2_weight` | | ||
| rbf_bw | RBF bandwidth, number of pixels to half weight | | ||
| tv_hw | total variation horizontal weight | | ||
| tv_vw | total variation vertical weight | | ||
| l2_weight | L2 regularization coefficient | | ||
| tv_weight | TV regularization coefficient | | ||
| perimeter_th | minimum perimeter for a connected component in a label image | | ||
| area_th | minimum area for a connected component in a label image | | ||
| threshold | score threshold below which a pixel is not labeled as MIT | | ||
| closing_rad | radius for disk structuring element passed to `skimage.morphology.binary_closing` | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"base_dir": "path/to/trough_directory", | ||
"trough_id_params": { | ||
"bg_est_shape": [ | ||
1, | ||
19, | ||
17 | ||
], | ||
"model_weight_max": 15, | ||
"rbf_bw": 1, | ||
"tv_hw": 2, | ||
"tv_vw": 1, | ||
"l2_weight": 0.09, | ||
"tv_weight": 0.15, | ||
"perimeter_th": 30, | ||
"area_th": 30, | ||
"threshold": 1, | ||
"closing_rad": 0 | ||
}, | ||
"madrigal_user_name": "your_name", | ||
"madrigal_user_email": "[email protected]", | ||
"madrigal_user_affil": "your_affiliation", | ||
"nasa_spdf_download_method": "ftp", | ||
"lat_res": 1, | ||
"lon_res": 2, | ||
"time_res_unit": "h", | ||
"time_res_n": 1, | ||
"script_name": "full_run", | ||
"start_date": "20100101", | ||
"end_date": "20220101", | ||
"keep_download": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.