Python code to display precipitation globally using GPM dataset.
Information on volcanoes is retrieved from Global Volcanism Program webservice.
- Create destination folder from terminal and clone the repo:
cd $HOME
mkdir -p $HOME/code/Precip
git clone git@github.com:geodesymiami/Precip.git $HOME/code/Precip
- Set environment variables (temp):
export PRECIP_HOME=$HOME/code/Precip
- Prepend to your
$PATH
export PATH=${PRECIP_HOME}/src/Precip/cli:$PATH
export PYTHONPATH=${PRECIP_HOME}/src:$PYTHONPATH
while read requirement; do conda install --yes $requirement; done < requirements.txt
In order to be able to download GPM data locally, you need to have an active EarthData account.
To create one, follow the steps below:
Otherwise you can use a mockup account, just copy paste the following code in your terminal (Mac/Linux, Windows):
cd $HOME
touch .netrc
echo "machine urs.earthdata.nasa.gov login emrehavazli password 4302749" >> .netrc
chmod 0600 .netrc
touch $HOME/.urs_cookies
touch $HOME/.dodsrc
echo "HTTP.NETRC=$HOME/.netrc" >> $HOME/.dodsrc
echo "HTTP.COOKIEJAR=$HOME/.urs_cookies" >> $HOME/.dodsrc
- Open Notepad
- Enter (without quotes):
machine urs.earthdata.nasa.gov login emrehavazli password 4302749
Save as C:.netrc
From terminal (Win
+ R, type cmd )
cd %USERPROFILE%
NUL > .urs_cookies
cd %USERPROFILE%
NUL > .dodsrc
echo "HTTP.NETRC=%USERPROFILE%/.netrc" >> %USERPROFILE%\.dodsrc
echo "HTTP.COOKIEJAR=%USERPROFILE%/.urs_cookies" >> %USERPROFILE%\.dodsrc
You can run the code through command line by simply runnig the following command:
plot_precipitation.py Merapi --style bar --period=20060101:20070101
This line will show the precipitation over Merapi volcano from 01 January 2006 to 2007 as a bar plot, with vertical lines representing the eruptions.
For more examples run:
plot_precipitation.py --h
If You want to show (almost) all the available types of plot in one single command, run:
run_plot_precipitation_all.py Merapi --period=20060101:20070101
You can add some of the arguments from gplot_precipitation.py
, like:
--roll
--bins
--log
--save
For visual examples, refer to the following Jupyter Notebook.
If you have special access to our Cloud Service, you can try to connect to JetStream and use the data uploaded there instead of downloading them locally with --use-ssh
argument.