Skip to content

Commit d879ae2

Browse files
committed
Update to version 2.0.3
Fixed bug that didn't take --cmap argument Added license page in documentation site Added documentation to explain the use of --clevels option Added documentation section about use of --ulevels option Update to readthedoc build which was failing earlier
1 parent 620e9cc commit d879ae2

12 files changed

+163
-65
lines changed

.readthedocs.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Read the Docs configuration file for MkDocs projects
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Set the version of Python and other tools you might need
8+
build:
9+
os: ubuntu-22.04
10+
tools:
11+
python: "3.11"
12+
13+
mkdocs:
14+
configuration: mkdocs.yml

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Details of PyPi package [![PyPI Version](https://badge.fury.io/py/ansicolortags.
1010

1111
Status of builds ![Build and Release](https://github.com/wxguy/wrfplot/actions/workflows/release-github.yaml/badge.svg) ![PyPi Package](https://github.com/wxguy/wrfplot/actions/workflows/release-pip.yaml/badge.svg)
1212

13-
Conda details ![Conda Version](https://anaconda.org/conda-forge/wrfplot/badges/version.svg) ![Last updated on](https://anaconda.org/conda-forge/wrfplot/badges/latest_release_date.svg) ![Works on Windows, Linux and Mac](https://anaconda.org/conda-forge/wrfplot/badges/platforms.svg) ![Download Counts](https://anaconda.org/conda-forge/wrfplot/badges/downloads.svg)
13+
Conda details ![Conda Version](https://img.shields.io/conda/v/conda-forge/wrfplot) ![Last updated on](https://anaconda.org/conda-forge/wrfplot/badges/latest_release_date.svg) ![Works on Windows, Linux and Mac](https://anaconda.org/conda-forge/wrfplot/badges/platforms.svg) ![Download Counts](https://img.shields.io/conda/dn/conda-forge/wrfplot)
1414

1515
## About wrfplot
1616

@@ -20,7 +20,7 @@ The idea of developing wrfplot came to my mind as I frequently revisit the same
2020

2121
## Documentation
2222

23-
Documentation of this project is located at https://wrfplot.readthedocs.io.
23+
Documentation of this project is located at https://wxguy.in/wrfplot.
2424

2525
## Use Cases
2626

@@ -43,11 +43,11 @@ wrfplot --version
4343

4444
## Binary (standalone) Installation
4545

46-
Since it is intended to be used as command line, the application is also distributed as stand-alone on both Linux and Windows. You must download the correct version of application installer or setup file. Both are described below:
46+
Since it is intended to be used as a command line, the application is also distributed as stand-alone on both Linux and Windows. You must download the correct version of application installer or setup file. Both are described below:
4747

4848
### Windows Only
4949

50-
Go to https://github.com/wxguy/wrfplot/releases and look for latest release. The Windows setup executable will have name `wrfplot-windows-64bit.exe`. Click on the link and download it to local disk. The rest of the installation procedure is same as you do for any other windows setup files. Once installed Check if installation is successful by typing following command in `cmd` window which should not produce any errors:
50+
Go to https://github.com/wxguy/wrfplot/releases and look for the latest release. The Windows setup executable will have name `wrfplot-windows-64bit.exe`. Click on the link and download it to local disk. The rest of the installation procedure is same as you do for any other windows setup files. Once installed Check if installation is successful by typing following command in `cmd` window which should not produce any errors:
5151

5252
```
5353
wrfplot --version

docs/install.md

+22-4
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,27 @@ Here are the following dependencies you should know about before installing wrfp
1111

1212
* Architecture: x86_64 or simple called 64bit. **_Don't download if you have 32bit machine_**. It won't work.
1313

14+
## Install on Windows, Linux and macOS
15+
16+
Support for all platforms is provided through conda-forge.
17+
If you have already conda installed, then the following command is enough to install wrfplot:
18+
19+
```commandline
20+
conda install -c cond-forge wrfplot
21+
```
22+
23+
Check your installation by typing the following command which should show the version number:
24+
25+
```commandline
26+
wrfplot --version
27+
2.0.2
28+
```
29+
30+
## Standalone (Binary) Installation
31+
1432
Since it is intended to be used as a command line, the application is distributed as stand-alone on both Linux and Windows. You must download the correct version of application installer or setup file. Both are described in the subsection below.
1533

16-
## Installation under Windows
34+
### Installation under Windows
1735
Go to [https://github.com/wxguy/wrfplot/releases](https://github.com/wxguy/wrfplot/releases) and look for the latest release. The Windows setup executable will have name `wrfplot-windows-64bit.exe` and download it to the local disk. The rest of the installation procedure is same as you do for any other windows setup files. Here are the complete process of installing in visual format:
1836

1937
<figure markdown="span">
@@ -53,12 +71,12 @@ Go to [https://github.com/wxguy/wrfplot/releases](https://github.com/wxguy/wrfpl
5371

5472
<figure markdown="span">
5573
![Image title](static/images/screenshots/8-windows-install-finish.png )
56-
<figcaption>Windows Finish Screen</figcaption>
74+
<figcaption>Click Finish to Close Setup</figcaption>
5775
</figure>
5876

5977
That’s it. You have successfully installed `wrfplot`.
6078

61-
## Installation under Linux
79+
### Installation under Linux
6280

6381
Go to [https://github.com/wxguy/wrfplot/releases](https://github.com/wxguy/wrfplot/releases) and look for the latest release. The Linux installer will have name wrfplot-linux-64bit.run. Click on the link and download it to local disk. Thereafter, execute the below command (assuming that the Linux installer is downloaded at ~/Downloads):
6482

@@ -81,7 +99,7 @@ Updating .bashrc file to include install directory...
8199
Installation completed. Please restart your terminal to continue using wrfplot...
82100
```
83101

84-
## Installation under macOS
102+
### Installation under macOS
85103

86104
There is no binary distribution made available for macOS at the moment. The support for macOS is provided through miniconda. If you already have miniconda/ anaconda installed, you can execute the following to install `wrfplot`:
87105

docs/license.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
wrfplot is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.
2+
3+
wrfplot is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
4+
5+
You should have received a copy of the GNU General Public License along with wrfplot. If not, see <http://www.gnu.org/licenses/>.
Loading

docs/usage.md

+85-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
## Basic Usage
22

3-
The first step in plotting diagnostic variable to find what all variables are supported by wrfplot application. This is required as the application would accept variable names only in certain string format. Therefore, you should list and review the name of variable by issuing the following command in the terminal:
3+
The first step in plotting diagnostic variable to find what all variables are supported by wrfplot application.
4+
This is required as the application would accept variable names only in certain string format.
5+
Therefore, you should list and review the name of variable by issuing the following command in the terminal:
46

57
```console
68
$ wrfplot --list-vars
@@ -51,8 +53,12 @@ Variable "u_cin" --> Convective Inhibition ($J kg^{1}$)
5153
Variable "u_cape" --> Convective Available Potential Energy ($J kg^{1}$)
5254
```
5355

54-
The above console print has two names. One with quote and the other is without. The name within quote such as "slp" is called short variable, and without a quote is called long variable. You can read through a list to take note of what parameter you want to plot. For example, if you need to plot `2m Relative Humidity`, then you need to remember the sort variable name in the first quote “” i.e, `“rh2”`. With this, we will proceed ahead to plot “rh2” variable.
55-
To plot any variable, there are minimum three arguments are to be provided. They are `--vars`, `--input` and `--output`. Details of this would be discussed later.
56+
The above console print has two names. One with quote and the other is without.
57+
The name within quote such as "slp" is called short variable, and without a quote is called long variable.
58+
You can read through a list to take note of what parameter you want to plot.
59+
For example, if you need to plot `2m Relative Humidity`, then you need to remember the sort variable name in the first quote “” i.e, `“rh2”`.
60+
With this, we will proceed ahead to plot “rh2” variable. To plot any variable, there are minimum three arguments required to be provided.
61+
They are `--vars`, `--input` and `--output`. Details of these would be discussed later.
5662

5763
## Plotting Surface Variable
5864

@@ -96,7 +102,10 @@ The plotted output for variable will look like below:
96102

97103
## Plotting Upper Atmospheric Variables
98104

99-
`wrfplot` supports a few upper atmospheric variables. These variables are indicated with u_ tag for ease of identification. By default, the plot for upper atmospheric variables would be plotted for 925, 850, 700, 600, 500, 400, 300 & 200hPa. The upper levels can be controlled using --ulevels though. If you want to plot upper winds, you can specify the variable with following command:
105+
`wrfplot` supports a few upper atmospheric variables. These variables are indicated with u_ tag for ease of identification.
106+
By default, the plot for upper atmospheric variables would be plotted for `925`, `850`, `700`, `600`, `500`, `400`, `300` & `200` hPa.
107+
The upper levels can be controlled using `--ulevels` though.
108+
If you want to plot upper winds, you can specify the variable with the following command:
100109

101110
```console
102111
$ wrfplot --vars "u_winds" --input ../../test/wrfout_data/wrfout_d01_2021-05-13_00_00_00 --output ../../test/wrfout_data/output_images
@@ -107,7 +116,48 @@ $ wrfplot --vars "u_winds" --input ../../test/wrfout_data/wrfout_d01_2021-05-13_
107116
<figcaption>Sample Upper Winds Plot at 300hPa</figcaption>
108117
</figure>
109118

110-
## Creating Animation to Plots
119+
## Plot Variable at Specific Level(s)
120+
121+
When plotting upper level variable, `wrfplot` will plot all the predefined levels viz., `925`, `850`, `700`, `600`, `500`, `400`, `300` & `200` hPa.
122+
You can control the level at which variable is required to be plotted using `--ulevels` argument.
123+
For example, if you need to plot at `800` and `750` hpa levels only, then you can apply the following command:
124+
125+
```console
126+
$ wrfplot --vars "u_winds" --ulevels "800,750" --input ../../test/wrfout_data/wrfout_d01_2021-05-13_00_00_00 --output ../../test/wrfout_data/output_images
127+
```
128+
129+
Remember that the level values are to be separated by `,`. That should produce the following output in the terminal:
130+
131+
```console
132+
Using user provided upper level(s) : "800.0,750.0"
133+
134+
*** Initialising plotting for variable : "u_winds" ***
135+
136+
Plotting "u_winds" for level "800.0" hPa and Time : "13-05-2021_05:30" UTC
137+
Image saved at : "../../test/wrfout_data/output_images/u_winds_800.0_13-05-2021_05_30.png"
138+
Plotting "u_winds" for level "800.0" hPa and Time : "13-05-2021_08:30" UTC
139+
Image saved at : "../../test/wrfout_data/output_images/u_winds_800.0_13-05-2021_08_30.png"
140+
Plotting "u_winds" for level "800.0" hPa and Time : "13-05-2021_11:31" UTC
141+
Image saved at : "../../test/wrfout_data/output_images/u_winds_800.0_13-05-2021_11_31.png"
142+
Plotting "u_winds" for level "800.0" hPa and Time : "13-05-2021_14:30" UTC
143+
Image saved at : "../../test/wrfout_data/output_images/u_winds_800.0_13-05-2021_14_30.png"
144+
Plotting "u_winds" for level "800.0" hPa and Time : "13-05-2021_17:30" UTC
145+
Image saved at : "../../test/wrfout_data/output_images/u_winds_800.0_13-05-2021_17_30.png"
146+
Plotting "u_winds" for level "750.0" hPa and Time : "13-05-2021_05:30" UTC
147+
Image saved at : "../../test/wrfout_data/output_images/u_winds_750.0_13-05-2021_05_30.png"
148+
Plotting "u_winds" for level "750.0" hPa and Time : "13-05-2021_08:30" UTC
149+
Image saved at : "../../test/wrfout_data/output_images/u_winds_750.0_13-05-2021_08_30.png"
150+
Plotting "u_winds" for level "750.0" hPa and Time : "13-05-2021_11:31" UTC
151+
Image saved at : "../../test/wrfout_data/output_images/u_winds_750.0_13-05-2021_11_31.png"
152+
Plotting "u_winds" for level "750.0" hPa and Time : "13-05-2021_14:30" UTC
153+
Image saved at : "../../test/wrfout_data/output_images/u_winds_750.0_13-05-2021_14_30.png"
154+
Plotting "u_winds" for level "750.0" hPa and Time : "13-05-2021_17:30" UTC
155+
Image saved at : "../../test/wrfout_data/output_images/u_winds_750.0_13-05-2021_17_30.png"
156+
157+
Plotting process completed. It took 0H:0M:6.948402S
158+
```
159+
160+
## Create Animation (GIF)
111161

112162
You can also create an animation of your plots using `--gif` option. Example command is given below:
113163

@@ -122,6 +172,8 @@ This would produce an animated `gif` image as shown below:
122172
<figcaption>Sample Animation Plot</figcaption>
123173
</figure>
124174

175+
## Control Animation Speed
176+
125177
By default, the speed of the animation is kept as `0.5` sec. If you wish to increase or decrease the speed, you can do so by with `--gif-speed` option as indicated below where speed is increased to `0.25` sec:
126178

127179
```console
@@ -134,3 +186,31 @@ This would increase the speed of animation as shown in the sample image file.
134186
![Image title](static/images/rh2-13-05-2021_05_30_faster.gif)
135187
<figcaption>Animation Plot with Increased Speed</figcaption>
136188
</figure>
189+
190+
## Control Contour Levels
191+
192+
The default contour levels of each variable set based on a variable type.
193+
For example, `Relative Humidity` variable will have 10 levels from 0 to 100 with an interval of 10.
194+
If you wish to change these intervals for specific variable, you may do so with `--clevels` argument.
195+
Levels are to be in ascending order and separated by ','.
196+
For example, `24,26,28,30,32,34,36`.
197+
Example plot to change temperature level to highlight the temperature range of interest will be as follows:
198+
199+
```console
200+
$ wrfplot --vars "rh2" --clevels '0,10,20,30,32,34,36,38,40,42,44,46' --input ../../test/wrfout_data/wrfout_d01_2021-05-13_00_00_00 --output ../../test/wrfout_data/output_images
201+
```
202+
203+
After executing the command with `--clevels` argument, the plot would look like this:
204+
205+
<figure markdown="span">
206+
![Image title](static/images/T2_13-05-2021_17_30_clevels.png)
207+
<figcaption>T2 Plot with Custom `--clevels` Option</figcaption>
208+
</figure>
209+
210+
this can be compared with the default clevels set by the `wrfplot` as shown below:
211+
212+
<figure markdown="span">
213+
![Image title](static/images/T2_13-05-2021_17_30.png)
214+
<figcaption>T2 Plot with Default `--clevels` Option</figcaption>
215+
</figure>
216+

installer.nsi

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
; Define the path to directory where Nutika put all our application files and directories
55
!define PY_APP_DIR "build\windows\wrfplot"
66
!define PRODUCT_NAME "wrfplot"
7-
!define PRODUCT_VERSION "2.0.0"
7+
!define PRODUCT_VERSION "2.0.2"
88
!define BITNESS "64"
99
!define ARCH_TAG ".amd64"
1010
!define INSTALLER_NAME "wrfplot-windows-64bit.exe"

mkdocs.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ site_url: https://wxguy.github.io/wrfplot
44
nav:
55
- Home: index.md
66
- Installation: install.md
7-
- Supported Variables: variable-list.md
7+
- Variables : variable-list.md
88
- Usage: usage.md
9-
- Supported Colormaps: colormaps.md
9+
- Colormaps: colormaps.md
1010
- Support: support.md
1111
- Contribution: contribution.md
1212
- Authors: authors.md
13+
- License: license.md
1314

1415
theme:
1516
name: material

setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def my_release_branch_semver_version(version):
130130
# cmdclass={ 'upload': UploadCommand,},
131131
project_urls={
132132
"Bug Reports": "https://github.com/wxguy/wrfplot/issues",
133-
"Source": "https://github.com/wxguy/wrfplot/",
134-
"Documentation": "https://wrfplot.readthedocs.io"
133+
"Source": "https://github.com/wxguy/wrfplot",
134+
"Documentation": "https://wxguy.in/wrfplot"
135135
},
136136
)

wrfplot/arguments.py

+7-14
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def dir_path(path):
3434
str: if path is valid or else ArgumentTypeError
3535
"""
3636

37-
# Convert Linux's '~' to absolute path to make it workable
37+
# Convert Linux's '~' to an absolute path to make it workable
3838
if path.startswith("~"):
3939
path = os.path.expanduser(path)
4040
previous_dir = os.path.dirname(path)
@@ -48,10 +48,10 @@ def dir_path(path):
4848

4949

5050
def file_path(path):
51-
"""Validate if input file provided exist
51+
"""Validate if an input file provided exists
5252
5353
Args:
54-
path: Path to input file
54+
path: Path to an input file
5555
5656
Results:
5757
str: if path is valid or else ArgumentTypeError
@@ -72,7 +72,7 @@ def validate_vars(input_vars):
7272
input_vars (list): List of variables for plotting
7373
7474
Results:
75-
list: list of variable after omitting names not known to application
75+
list: list of variables after omitting names not known to application
7676
"""
7777

7878
final_vars = []
@@ -131,14 +131,7 @@ def list_cmaps():
131131
cmap_methods = dir(cmaps)
132132
print(cmap_methods)
133133
return cmap_methods
134-
"""
135-
for method in cmap_methods:
136-
try:
137-
if getattr(cmaps, method):
138-
print(method)
139-
except AttributeError:
140-
pass
141-
"""
134+
142135

143136
def validate_cmap(cmap):
144137
"""Validate user colormap name
@@ -195,7 +188,7 @@ def validate_ulevels(ulevels):
195188

196189
if len(filtered_ulevels) > 0:
197190
output_str_lst = [str(x) for x in filtered_ulevels]
198-
print("Using user provided upper level(s) : " + utils.quote(",".join(output_str_lst)))
191+
print("\nUsing user provided upper level(s) : " + utils.quote(",".join(output_str_lst)))
199192
return filtered_ulevels
200193
else:
201194
print("\nNone of the levels are valid upper levels.")
@@ -238,7 +231,7 @@ def validate_clevels(clevels):
238231
return False
239232
else:
240233
output_str_lst = [str(x) for x in filtered_clevels]
241-
print("Using user provided contour levels : " + utils.quote(",".join(sorted(output_str_lst))))
234+
print("\nUsing user provided contour levels : " + utils.quote(",".join(sorted(output_str_lst))))
242235
return sorted(filtered_clevels)
243236

244237

0 commit comments

Comments
 (0)