Note: The default ITS GitLab runner is a shared resource and is subject to slowdowns during heavy usage.
You can run your own GitLab runner that is dedicated just to your group if you need to avoid processing delays.

Verified Commit 991a3a26 authored by Qusai Al Shidi's avatar Qusai Al Shidi 💬
Browse files

v2020.5 commit

parent 08e89627
- 873bcf5 **(2020-05-29, Qusai Al Shidi)**: _CHEAD -> master, tag: v2020.4, origin/master, origin/HEAD_: Version 2020.4 with bug fixes to retrieve time better from omni and also works with `share/Python/Scripts/prepare_geospace.py` - 08e8962 **(2020-06-19, Qusai Al Shidi)**: _CHEAD -> master_: Merge branch 'cdha/swmfpy-tecplottools'
- 63a40aa **(2020-06-19, Qusai Al Shidi)**: _Corigin/cdha/swmfpy-tecplottools, cdha/swmfpy-tecplottools_: @cdha this is great and I made a few changes to keep in mind.
- 8981fcd **(2020-06-19, Qusai Al Shidi)**: _Corigin/master, origin/HEAD_: Change the -U
- d319627 **(2020-06-18, Camilla D. K. Harris)**: _C_: Added TECPLOT.markdown to include some explanations of using Tecplot with SWMF output.
- f420b06 **(2020-06-18, Camilla D. K. Harris)**: _C_: Initial commit of tecplottools module for working with Tecplot and pytecplot.
- c9a11f6 **(2020-05-29, Qusai Al Shidi)**: _C_: Use `python3 -m pip` since pip comes with python >=3.4
- 4b4cfb5 **(2020-05-29, Qusai Al Shidi)**: _C_: Speed up of `get_omni_data`
- 69033fc **(2020-05-29, Qusai Al Shidi)**: _C_: Update changelog
- 873bcf5 **(2020-05-29, Qusai Al Shidi)**: _Ctag: v2020.4_: Version 2020.4 with bug fixes to retrieve time better from omni and also works with `share/Python/Scripts/prepare_geospace.py`
- 6daa030 **(2020-05-29, Qusai Al Shidi)**: _C_: Running write_imf_from_omni now returns the omni data also - 6daa030 **(2020-05-29, Qusai Al Shidi)**: _C_: Running write_imf_from_omni now returns the omni data also
- 9140d57 **(2020-05-29, Qusai Al Shidi)**: _C_: Better installation method - 9140d57 **(2020-05-29, Qusai Al Shidi)**: _C_: Better installation method
- caad652 **(2020-05-29, Qusai Al Shidi)**: _C_: Writing IMF files fixed, will not write nans anymore - caad652 **(2020-05-29, Qusai Al Shidi)**: _C_: Writing IMF files fixed, will not write nans anymore
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
* [replace\_command](#.swmfpy.paramin.replace_command) * [replace\_command](#.swmfpy.paramin.replace_command)
* [read\_command](#.swmfpy.paramin.read_command) * [read\_command](#.swmfpy.paramin.read_command)
* [swmfpy.tools](#.swmfpy.tools) * [swmfpy.tools](#.swmfpy.tools)
* [swmfpy.tecplottools](#.swmfpy.tecplottools)
* [apply\_equations](#.swmfpy.tecplottools.apply_equations)
<a name=".swmfpy"></a> <a name=".swmfpy"></a>
## swmfpy ## swmfpy
...@@ -34,6 +36,8 @@ These are automatically imported. ...@@ -34,6 +36,8 @@ These are automatically imported.
- `swmfpy.tools` Tools used in swmfpy. You might find these useful but it is - `swmfpy.tools` Tools used in swmfpy. You might find these useful but it is
unecessary. unecessary.
- `swmfpy.tecplottools` Tools for working with the Tecplot visualization
software. Requires a Tecplot license and the pytecplot python package.
<a name=".swmfpy.write_imf_from_omni"></a> <a name=".swmfpy.write_imf_from_omni"></a>
#### write\_imf\_from\_omni #### write\_imf\_from\_omni
...@@ -502,3 +506,72 @@ values for the parameters. ...@@ -502,3 +506,72 @@ values for the parameters.
Tools to be used in swmfpy functions and classes. Some of the functions are Tools to be used in swmfpy functions and classes. Some of the functions are
*hidden functions*. *hidden functions*.
<a name=".swmfpy.tecplottools"></a>
## swmfpy.tecplottools
Tools for working with the Tecplot visualization software.
Requires an active Tecplot license and the pytecplot python package.
pytecplot ships with Tecplot 360 2017 R1 and later versions
but it is recommended that you install the latest version with
`pip install pytecplot`.
See the pytecplot documentation for more details about
[installation](https://www.tecplot.com/docs/pytecplot/install.html).
See also [TECPLOT](TECPLOT.markdown) for tips targeted to SWMF users.
Some useful references:
- [Tecplot User's Manual](download.tecplot.com/360/current/360_users_manual.pdf)
- [Tecplot Scripting Guide](download.tecplot.com/360/current/360_scripting_guide.pdf)
- [Pytecplot documentation](www.tecplot.com/docs/pytecplot/index.html)
<a name=".swmfpy.tecplottools.apply_equations"></a>
#### apply\_equations
```python
apply_equations(eqn_path: str, verbose: bool = False)
```
Apply an equations file in the Tecplot macro format to the active dataset
Please reference the Tecplot User's Manual for more details on
equation files and syntax. It is recommended to use this function with eqn
files generated with the Tecplot GUI.
See [TECPLOT](TECPLOT.markdown) for tips on using pytecplot.
**Arguments**:
- `eqn_file_path` _str_ - The path to the equation macro file (typically with
extension `.eqn`).
- `verbose` _bool_ - (Optional) Whether or not to print the equations as they are
applied. Default behavior is silent.
**Examples**:
```python
import tecplot
import swmfpy.tecplottools as tpt
## Uncomment this line if you are connecting to a running tecplot
## session. Be sure that the port number matches the port the GUI is
## listening to. See TECPLOT.markdown for tips on connecting to a
## running session or running your script seperately.
# tecplot.session.connect(port=7600)
## load a dataset
dataset = tecplot.data.load_tecplot('./z=0_mhd_1_n00000000.plt')
## apply an equations file
tpt.apply_equations('./gse_to_ephio.eqn', verbose= True)
## apply a frame style
frame = tecplot.active_frame()
frame.load_stylesheet('./density.sty')
## annotate with the zone name
frame.add_text('&(ZONENAME[ACTIVEOFFSET=1])', position= (5, 95))
## save the image
tecplot.export.save_png('./density.png', width= 1200, supersample= 8)
```
...@@ -13,7 +13,7 @@ with open('requirements.txt') as fh_requirements: ...@@ -13,7 +13,7 @@ with open('requirements.txt') as fh_requirements:
setuptools.setup( setuptools.setup(
name='swmfpy', name='swmfpy',
version='2020.4', version='2020.5',
author='Qusai Al Shidi', author='Qusai Al Shidi',
author_email='qusai@umich.edu', author_email='qusai@umich.edu',
description='''A collection of tools for the Space Weather Modelling description='''A collection of tools for the Space Weather Modelling
......
...@@ -4,5 +4,5 @@ ...@@ -4,5 +4,5 @@
# run `pip install pydoc-markdown --user` # run `pip install pydoc-markdown --user`
# then run this script in the project root directory # then run this script in the project root directory
pydoc-markdown --py3 -v -I. --render-toc -m swmfpy -m swmfpy.web -m swmfpy.io -m swmfpy.paramin -m swmfpy.tools $@ | sed 's/\\043/#/g' - > DOCUMENTATION.markdown pydoc-markdown --py3 -v -I. --render-toc -m swmfpy -m swmfpy.web -m swmfpy.io -m swmfpy.paramin -m swmfpy.tools -m swmfpy.tecplottools $@ | sed 's/\\043/#/g' - > DOCUMENTATION.markdown
...@@ -18,7 +18,7 @@ These are automatically imported. ...@@ -18,7 +18,7 @@ These are automatically imported.
""" """
__author__ = 'Qusai Al Shidi' __author__ = 'Qusai Al Shidi'
__license__ = 'MIT' __license__ = 'MIT'
__version__ = '2020.4' __version__ = '2020.5'
__maintainer__ = 'Qusai Al Shidi' __maintainer__ = 'Qusai Al Shidi'
__email__ = 'qusai@umich.edu' __email__ = 'qusai@umich.edu'
...@@ -26,7 +26,6 @@ __email__ = 'qusai@umich.edu' ...@@ -26,7 +26,6 @@ __email__ = 'qusai@umich.edu'
import sys import sys
from . import paramin from . import paramin
from . import io from . import io
from . import tecplottools
from . import web from . import web
assert sys.version_info >= (3, 6), "swmfpy requires Python >=3.6. Sorry :(." assert sys.version_info >= (3, 6), "swmfpy requires Python >=3.6. Sorry :(."
......
...@@ -45,7 +45,7 @@ def apply_equations(eqn_path: str, verbose: bool = False): ...@@ -45,7 +45,7 @@ def apply_equations(eqn_path: str, verbose: bool = False):
## session. Be sure that the port number matches the port the GUI is ## session. Be sure that the port number matches the port the GUI is
## listening to. See TECPLOT.markdown for tips on connecting to a ## listening to. See TECPLOT.markdown for tips on connecting to a
## running session or running your script seperately. ## running session or running your script seperately.
#tecplot.session.connect(port=7600) # tecplot.session.connect(port=7600)
## load a dataset ## load a dataset
dataset = tecplot.data.load_tecplot('./z=0_mhd_1_n00000000.plt') dataset = tecplot.data.load_tecplot('./z=0_mhd_1_n00000000.plt')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment