Verified Commit cf571a1e authored by Qusai Al Shidi's avatar Qusai Al Shidi 💬

Merge branch 'cdha/swmfpy-more-tecplot-doc-fixes' into HEAD

parents e90d39d3 5b864452
Pipeline #26012 passed with stage
in 1 minute and 10 seconds
...@@ -571,7 +571,7 @@ Some useful references: ...@@ -571,7 +571,7 @@ Some useful references:
apply_equations(eqn_path: str, verbose: bool = False) -> None apply_equations(eqn_path: str, verbose: bool = False) -> None
``` ```
Apply an equations file in the Tecplot macro format to the active dataset Apply a Tecplot-formatted equations file to the active dataset.
Please reference the Tecplot User's Manual for more details on Please reference the Tecplot User's Manual for more details on
equation files and syntax. It is recommended to use this function with eqn equation files and syntax. It is recommended to use this function with eqn
...@@ -580,11 +580,9 @@ See [TECPLOT](TECPLOT.markdown) for tips on using pytecplot. ...@@ -580,11 +580,9 @@ See [TECPLOT](TECPLOT.markdown) for tips on using pytecplot.
**Arguments**: **Arguments**:
eqn_file_path (str): - `eqn_file_path` _str_ - The path to the equation macro file (typically with
The path to the equation macro file extension `.eqn`).
(typically with extension `.eqn`). - `verbose` _bool_ - (Optional) Whether or not to print the equations as they
verbose (bool):
(Optional) Whether or not to print the equations as they
are applied. Default behavior is silent. are applied. Default behavior is silent.
...@@ -630,8 +628,8 @@ This is helpful for accessing Tecplot variables. ...@@ -630,8 +628,8 @@ This is helpful for accessing Tecplot variables.
**Arguments**: **Arguments**:
variable_name (str): - `variable_name` _str_ - A string which may contain the meta-characters * ?
A string which may contain the meta-characters * ? [ or ]. [ or ].
**Examples**: **Examples**:
...@@ -645,8 +643,8 @@ This is helpful for accessing Tecplot variables. ...@@ -645,8 +643,8 @@ This is helpful for accessing Tecplot variables.
```python ```python
print(dataset.variable('X [R]').name) print(dataset.variable('X [R]').name)
# TecplotPatternMatchWarning: no variables found matching: "X [R]" For # TecplotPatternMatchWarning: no variables found matching: "X [R]" For
# a literal match, the meta-characters: * ? [ ] must be wrapped in square- # a literal match, the meta-characters: * ? [ ] must be wrapped in
# For example, "[?]" matches the character "?"... # square-brackets. For example, "[?]" matches the character "?"...
``` ```
However, However,
```python ```python
...@@ -665,21 +663,15 @@ Writes a tecplot zone to various formats. ...@@ -665,21 +663,15 @@ Writes a tecplot zone to various formats.
**Arguments**: **Arguments**:
tecplot_dataset (tecplot.data.dataset.Dataset): - `tecplot_dataset` _tecplot.data.Dataset_ - The dataset to save.
The dataset to save. - `tecplot_zone` _tecplot.data.zone_ - The zone to save.
tecplot_zone (tecplot.data.dataset.Zone): - `write_as` _str_ - Type of file to write to. Supported options are `hdf5`,
The zone to save. `csv`, `tecplot_ascii`, and `tecplot_plt`.
write_as (str): - `filename` _str_ - Name of the file to write to.
Type of file to write to. Supported options are 'hdf5', - `variables` _list_ - (Optional) Specify a subset of the dataset variables
'csv', 'tecplot_ascii', and 'tecplot_plt'. to save. This option may decrease the size of the output. Default
filename (str):
Name of the file to write to.
variables (list(tecplot.data.dataset.Variable)):
(Optional) Specify a subset of the dataset variables to
save. This option may decrease the size of the output. Default
behavior is to save all variables. behavior is to save all variables.
verbose: - `verbose` - (Optional) Print diagnostic information. Defaults to False.
(Optional) Print diagnostic information. Defaults to False.
**Examples**: **Examples**:
...@@ -726,52 +718,49 @@ interpolate_zone_to_geometry(dataset, source_zone, geometry: str, variables: lis ...@@ -726,52 +718,49 @@ interpolate_zone_to_geometry(dataset, source_zone, geometry: str, variables: lis
Interpolates Tecplot binary data onto various geometries. Interpolates Tecplot binary data onto various geometries.
Returns a tecplot zone object.
**Arguments**: **Arguments**:
dataset: - `dataset` _tecplot.data.Dataset_ - The loaded Tecplot dataset.
The loaded Tecplot dataset. - `source_zone` _tecplot.data.zone_ - The Tecplot zone to interpolate onto
source_zone: the geometry.
The Tecplot zone to interpolate onto the geometry. - `geometry` _str_ - Type of geometry for interpolation. Supported geometries
geometry (str): are `shell`, `line`, `rectprism`, or `trajectory`. See below for the
Type of geometry for interpolation. Supported geometries
are 'shell', 'line', 'rectprism', or 'trajectory'. See below for the
required keyword arguments for each geometry. required keyword arguments for each geometry.
variables (list): - `variables` _list_ - (Optional) Subset of variables to interpolate. Default
(Optional) Subset of variables to interpolate. Default
behavior is to interpolate all variables. behavior is to interpolate all variables.
verbose: - `verbose` _bool_ - (Optional) Print diagnostic information. Defaults to
(Optional) Print diagnostic information. Defaults to False. False.
- `**center` _array-like_ - Argument for the `shell` geometry. Contains the
**kwargs: X, Y, and Z positions of the shell. Defaults to (0,0,0).
- `center` _array-like_ - Argument for the 'shell' geometry. Contains the X, - `**radius` _float_ - Required argument for the `shell` geometry.
Y, and Z positions of the shell. Defaults to (0,0,0). - `**npoints` _array-like_ - Argument for the `shell` geometry. Contains the
- `radius` _float_ - Argument for the 'shell' geometry. Required. number of points in the azimuthal and polar directions to interpolate
- `npoints` _array-like_ - Argument for the 'shell' geometry. Contains the onto, excluding the north and south polar points. Defaults to
number of points in the azimuthal and polar directions to (360, 179).
interpolate onto, excluding the north and south polar points. - `**r1` _array-like_ - Required argument for the `line` geometry. Contains
Defaults to (360,179). the X, Y, and Z positions of the point where the line starts.
- `r1` _array-like_ - Argument for the 'line' geometry. Contains the X, Y, - `**r2` _array-like_ - Required argument for the `line` geometry. Contains
and Z positions of the point where the line starts. Required. the X, Y, and Z positions of the point where the line ends.
- `r2` _array-like_ - Argument for the 'line' geometry. Contains the X, Y, - `**npoints` _int_ - Required argument for the `line` geometry. The number
and Z positions of the point where the line ends. Required. of points along the line to interpolate onto.
- `npoints` _int_ - Argument for the 'line' geometry. The number of points - `**center` _array-like_ - Argument for the `rectprism` geometry. Contains
along the line to interpolate onto. Required. the X, Y, and Z positions of the center of the rectangular prism.
- `center` _array-like_ - Argument for the 'rectprism' geometry. Contains the
X, Y, and Z positions of the center of the rectangular prism.
Defaults to (0,0,0). Defaults to (0,0,0).
- `halfwidths` _array-like_ - Argument for the 'rectprism' geometry. Contains - `**halfwidths` _array-like_ - Required argument for the `rectprism`
the half widths of the rectangular prism in the X, Y, and Z geometry. Contains the half widths of the rectangular prism in the X,
directions. Required. Y, and Z directions.
- `npoints` _array-like_ - Argument for the 'rectprism' geometry. Contains - `**npoints` _array-like_ - Required argument for the `rectprism` geometry.
the number of points in the X, Y, and Z directions to interpolate Contains the number of points in the X, Y, and Z directions to
onto. Required. interpolate onto.
- `trajectory_data` _str_ - Argument for the 'trajectory' geometry. The path - `**trajectory_data` _str_ - Required argument for the `trajectory`
to the ASCII trajectory data file. Required. geometry. The path to the ASCII trajectory data file.
- `trajectory_format` _str_ - Argument for the 'trajectory' geometry. The - `**trajectory_format` _str_ - Required argument for the `trajectory`
format of the trajectory data file. Supported formats are 'tecplot' geometry. The format of the trajectory data file. Supported formats
(data is a tecplot zone with 3D positional variables and 'time') and are `tecplot` (data is a tecplot zone with 3D positional variables)
'batsrus' (data is formatted as described for the `SATELLITE` and `batsrus` (data is formatted as described for the `SATELLITE`
command, see SWMF documentation). Required. command, see SWMF documentation).
**Examples**: **Examples**:
...@@ -818,13 +807,13 @@ Interpolates Tecplot binary data onto various geometries. ...@@ -818,13 +807,13 @@ Interpolates Tecplot binary data onto various geometries.
) )
## geometry: spacecraft trajectory as specified for the ## geometry: spacecraft trajectory as specified for the
## BATSRUS `SATELLITE` command ## BATSRUS SATELLITE command
tpt.interpolate_zone_to_geometry( tpt.interpolate_zone_to_geometry(
dataset=dataset, dataset=dataset,
source_zone=dataset.zone(0), source_zone=dataset.zone(0),
geometry='trajectory', geometry='trajectory',
trajectory_format='batsrus', trajectory_format='batsrus',
trajectory_data='./test_data/satellite_e4.dat' trajectory_data='satellite_e4.dat'
) )
## The new zones are labeled with the name of the geometry and can be ## The new zones are labeled with the name of the geometry and can be
......
...@@ -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 -m swmfpy.tecplottools $@ | 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
...@@ -28,14 +28,13 @@ import numpy as np ...@@ -28,14 +28,13 @@ import numpy as np
import tecplot import tecplot
def _get_variable_names(variables): def _get_variable_names(variables) -> list:
"""For getting the names of a group of Tecplot variables""" """For getting the names of a group of Tecplot variables."""
return [var.name for var in variables] return [var.name for var in variables]
def _shell_geometry(geometry_params: dict) -> dict: def _shell_geometry(geometry_params: dict) -> dict:
"""Returns a dict containing points for the described shell geometry. """Returns a dict containing points for the described shell geometry."""
"""
nlon = geometry_params['npoints'][0] # 360 nlon = geometry_params['npoints'][0] # 360
nlat = geometry_params['npoints'][1] # 179 nlat = geometry_params['npoints'][1] # 179
lons = np.linspace(0, 360, nlon, endpoint=False) lons = np.linspace(0, 360, nlon, endpoint=False)
...@@ -63,8 +62,7 @@ def _shell_geometry(geometry_params: dict) -> dict: ...@@ -63,8 +62,7 @@ def _shell_geometry(geometry_params: dict) -> dict:
def _line_geometry(geometry_params: dict) -> dict: def _line_geometry(geometry_params: dict) -> dict:
"""Returns a dict containing points for the described line geometry. """Returns a dict containing points for the described line geometry."""
"""
geometry_points = { geometry_points = {
'npoints': geometry_params['npoints'], 'npoints': geometry_params['npoints'],
'X': np.linspace( 'X': np.linspace(
...@@ -84,8 +82,7 @@ def _line_geometry(geometry_params: dict) -> dict: ...@@ -84,8 +82,7 @@ def _line_geometry(geometry_params: dict) -> dict:
def _rectprism_geometry(geometry_params: dict) -> dict: def _rectprism_geometry(geometry_params: dict) -> dict:
"""Returns a dict containing points for the described rectprism geometry. """Returns a dict containing points for the described rectprism geometry."""
"""
npoints = (geometry_params['npoints'][0] npoints = (geometry_params['npoints'][0]
* geometry_params['npoints'][1] * geometry_params['npoints'][1]
* geometry_params['npoints'][2]) * geometry_params['npoints'][2])
...@@ -113,7 +110,7 @@ def _rectprism_geometry(geometry_params: dict) -> dict: ...@@ -113,7 +110,7 @@ def _rectprism_geometry(geometry_params: dict) -> dict:
def _trajectory_geometry(geometry_params: dict) -> dict: def _trajectory_geometry(geometry_params: dict) -> dict:
"""Returns a dict containing points for the described trajectory geometry. """Returns a dict containing points for the described trajectory geometry.
Assumes format of trajectory file after SWMF SATELLITE command. Assumes format of trajectory file after SWMF `SATELLITE` command.
""" """
do_read = False do_read = False
trajectory_data = [] trajectory_data = []
...@@ -156,9 +153,13 @@ def _trajectory_geometry(geometry_params: dict) -> dict: ...@@ -156,9 +153,13 @@ def _trajectory_geometry(geometry_params: dict) -> dict:
return geometry_points return geometry_points
def _save_hdf5(filename, geometry_params, new_zone, variables) -> None: def _save_hdf5(
"""Save the aux data and a subset of the variables in hdf5 format. filename: str,
""" geometry_params: dict,
new_zone,
variables
) -> None:
"""Save the aux data and a subset of the variables in hdf5 format."""
column_names = _get_variable_names(variables) column_names = _get_variable_names(variables)
tp_data = [] tp_data = []
for var in variables: for var in variables:
...@@ -170,9 +171,13 @@ def _save_hdf5(filename, geometry_params, new_zone, variables) -> None: ...@@ -170,9 +171,13 @@ def _save_hdf5(filename, geometry_params, new_zone, variables) -> None:
h5_file['data'].attrs['names'] = column_names h5_file['data'].attrs['names'] = column_names
def _save_csv(filename, geometry_params, new_zone, variables) -> None: def _save_csv(
"""Save the aux data and a subset of the variables in plain-text format. filename: str,
""" geometry_params: dict,
new_zone,
variables
) -> None:
"""Save the aux data and a subset of the variables in plain-text format."""
aux_data = geometry_params.__repr__() + '\n' aux_data = geometry_params.__repr__() + '\n'
column_names = variables[0].name.__repr__() column_names = variables[0].name.__repr__()
for var in variables[1:]: for var in variables[1:]:
...@@ -190,14 +195,14 @@ def _save_csv(filename, geometry_params, new_zone, variables) -> None: ...@@ -190,14 +195,14 @@ def _save_csv(filename, geometry_params, new_zone, variables) -> None:
) )
def _add_variable_value(dataset, variable_name: str, zone, values): def _add_variable_value(dataset, variable_name: str, zone, values) -> None:
"""Adds and populates a new variable to a zone in a dataset.""" """Adds and populates a new variable to a zone in a dataset."""
dataset.add_variable(variable_name) dataset.add_variable(variable_name)
zone.values(bracketify(variable_name))[:] = values zone.values(bracketify(variable_name))[:] = values
def apply_equations(eqn_path: str, verbose: bool = False) -> None: def apply_equations(eqn_path: str, verbose: bool = False) -> None:
"""Apply an equations file in the Tecplot macro format to the active dataset """Apply a Tecplot-formatted equations file to the active dataset.
Please reference the Tecplot User's Manual for more details on Please reference the Tecplot User's Manual for more details on
equation files and syntax. It is recommended to use this function with eqn equation files and syntax. It is recommended to use this function with eqn
...@@ -205,12 +210,10 @@ def apply_equations(eqn_path: str, verbose: bool = False) -> None: ...@@ -205,12 +210,10 @@ def apply_equations(eqn_path: str, verbose: bool = False) -> None:
See [TECPLOT](TECPLOT.markdown) for tips on using pytecplot. See [TECPLOT](TECPLOT.markdown) for tips on using pytecplot.
Args: Args:
eqn_file_path (str): eqn_file_path (str): The path to the equation macro file (typically with
The path to the equation macro file extension `.eqn`).
(typically with extension `.eqn`). verbose (bool): (Optional) Whether or not to print the equations as they
verbose (bool): are applied. Default behavior is silent.
(Optional) Whether or not to print the equations as they
are applied. Default behavior is silent.
Examples: Examples:
```python ```python
...@@ -266,8 +269,8 @@ def bracketify(variable_name: str) -> str: ...@@ -266,8 +269,8 @@ def bracketify(variable_name: str) -> str:
This is helpful for accessing Tecplot variables. This is helpful for accessing Tecplot variables.
Args: Args:
variable_name (str): variable_name (str): A string which may contain the meta-characters * ?
A string which may contain the meta-characters * ? [ or ]. [ or ].
Examples: Examples:
In a dataset which contains the variable 'X [R]', In a dataset which contains the variable 'X [R]',
...@@ -279,8 +282,8 @@ def bracketify(variable_name: str) -> str: ...@@ -279,8 +282,8 @@ def bracketify(variable_name: str) -> str:
```python ```python
print(dataset.variable('X [R]').name) print(dataset.variable('X [R]').name)
# TecplotPatternMatchWarning: no variables found matching: "X [R]" For # TecplotPatternMatchWarning: no variables found matching: "X [R]" For
# a literal match, the meta-characters: * ? [ ] must be wrapped in square- # a literal match, the meta-characters: * ? [ ] must be wrapped in
# For example, "[?]" matches the character "?"... # square-brackets. For example, "[?]" matches the character "?"...
``` ```
However, However,
```python ```python
...@@ -308,21 +311,15 @@ def write_zone( ...@@ -308,21 +311,15 @@ def write_zone(
"""Writes a tecplot zone to various formats. """Writes a tecplot zone to various formats.
Args: Args:
tecplot_dataset (tecplot.data.dataset.Dataset): tecplot_dataset (tecplot.data.Dataset): The dataset to save.
The dataset to save. tecplot_zone (tecplot.data.zone): The zone to save.
tecplot_zone (tecplot.data.dataset.Zone): write_as (str): Type of file to write to. Supported options are `hdf5`,
The zone to save. `csv`, `tecplot_ascii`, and `tecplot_plt`.
write_as (str): filename (str): Name of the file to write to.
Type of file to write to. Supported options are 'hdf5', variables (list): (Optional) Specify a subset of the dataset variables
'csv', 'tecplot_ascii', and 'tecplot_plt'. to save. This option may decrease the size of the output. Default
filename (str): behavior is to save all variables.
Name of the file to write to. verbose: (Optional) Print diagnostic information. Defaults to False.
variables (list(tecplot.data.dataset.Variable)):
(Optional) Specify a subset of the dataset variables to
save. This option may decrease the size of the output. Default
behavior is to save all variables.
verbose:
(Optional) Print diagnostic information. Defaults to False.
Examples: Examples:
```python ```python
...@@ -407,18 +404,16 @@ def _assign_geometry_defaults( ...@@ -407,18 +404,16 @@ def _assign_geometry_defaults(
geometry: str, geometry: str,
default_params: dict, default_params: dict,
geometry_params: dict geometry_params: dict
): ) -> dict:
"""Checks parameters with defaults and assigns them. """Checks parameters with defaults and assigns them.
If the parameters are already set nothing will change. If the parameters are already set nothing will change.
Args: Args:
geometry (str): geometry (str): String identifying the geometry to look for.
String identifying the geometry to look for. default_params (dict): Dictionary of the default parameters.
default_params (dict): geomatry_params (dict): Dictionary in which to look for and set
Dictionary of the default parameters. parameters.
geomatry_params (dict):
Dictionary in which to look for and set parameters.
""" """
if geometry in geometry_params['geometry']: if geometry in geometry_params['geometry']:
for key, value in default_params.items(): for key, value in default_params.items():
...@@ -432,7 +427,7 @@ def _assign_geometry_defaults( ...@@ -432,7 +427,7 @@ def _assign_geometry_defaults(
def _check_geometry_requirements( def _check_geometry_requirements(
geometry_requirements: dict, geometry_requirements: dict,
geometry_params: dict geometry_params: dict
): ) -> None:
"""Checks that the required kwargs for the given geometry have been set. """Checks that the required kwargs for the given geometry have been set.
""" """
if geometry_params['geometry'] not in geometry_requirements: if geometry_params['geometry'] not in geometry_requirements:
...@@ -447,7 +442,7 @@ def _check_geometry_requirements( ...@@ -447,7 +442,7 @@ def _check_geometry_requirements(
def _get_geometry_points( def _get_geometry_points(
geometry_params: dict geometry_params: dict
): ) -> dict:
"""Select the right function to calculate the geometry points.""" """Select the right function to calculate the geometry points."""
if 'shell' in geometry_params['geometry']: if 'shell' in geometry_params['geometry']:
geometry_points = _shell_geometry(geometry_params) geometry_points = _shell_geometry(geometry_params)
...@@ -473,51 +468,48 @@ def interpolate_zone_to_geometry( ...@@ -473,51 +468,48 @@ def interpolate_zone_to_geometry(
): ):
"""Interpolates Tecplot binary data onto various geometries. """Interpolates Tecplot binary data onto various geometries.
Returns a tecplot zone object.
Args: Args:
dataset: dataset (tecplot.data.Dataset): The loaded Tecplot dataset.
The loaded Tecplot dataset. source_zone (tecplot.data.zone): The Tecplot zone to interpolate onto
source_zone: the geometry.
The Tecplot zone to interpolate onto the geometry. geometry (str): Type of geometry for interpolation. Supported geometries
geometry (str): are `shell`, `line`, `rectprism`, or `trajectory`. See below for the
Type of geometry for interpolation. Supported geometries required keyword arguments for each geometry.
are 'shell', 'line', 'rectprism', or 'trajectory'. See below for the variables (list): (Optional) Subset of variables to interpolate. Default
required keyword arguments for each geometry. behavior is to interpolate all variables.
variables (list): verbose (bool): (Optional) Print diagnostic information. Defaults to
(Optional) Subset of variables to interpolate. Default False.
behavior is to interpolate all variables. **center (array-like): Argument for the `shell` geometry. Contains the
verbose: X, Y, and Z positions of the shell. Defaults to (0,0,0).
(Optional) Print diagnostic information. Defaults to False. **radius (float): Required argument for the `shell` geometry.
**npoints (array-like): Argument for the `shell` geometry. Contains the
**kwargs: number of points in the azimuthal and polar directions to interpolate
center (array-like): Argument for the 'shell' geometry. Contains the X, onto, excluding the north and south polar points. Defaults to
Y, and Z positions of the shell. Defaults to (0,0,0). (360, 179).
radius (float): Argument for the 'shell' geometry. Required. **r1 (array-like): Required argument for the `line` geometry. Contains
npoints (array-like): Argument for the 'shell' geometry. Contains the the X, Y, and Z positions of the point where the line starts.
number of points in the azimuthal and polar directions to **r2 (array-like): Required argument for the `line` geometry. Contains
interpolate onto, excluding the north and south polar points. the X, Y, and Z positions of the point where the line ends.
Defaults to (360,179). **npoints (int): Required argument for the `line` geometry. The number
r1 (array-like): Argument for the 'line' geometry. Contains the X, Y, of points along the line to interpolate onto.
and Z positions of the point where the line starts. Required. **center (array-like): Argument for the `rectprism` geometry. Contains
r2 (array-like): Argument for the 'line' geometry. Contains the X, Y, the X, Y, and Z positions of the center of the rectangular prism.
and Z positions of the point where the line ends. Required. Defaults to (0,0,0).
npoints (int): Argument for the 'line' geometry. The number of points **halfwidths (array-like): Required argument for the `rectprism`
along the line to interpolate onto. Required. geometry. Contains the half widths of the rectangular prism in the X,
center (array-like): Argument for the 'rectprism' geometry. Contains the Y, and Z directions.
X, Y, and Z positions of the center of the rectangular prism. **npoints (array-like): Required argument for the `rectprism` geometry.
Defaults to (0,0,0). Contains the number of points in the X, Y, and Z directions to
halfwidths (array-like): Argument for the 'rectprism' geometry. Contains interpolate onto.
the half widths of the rectangular prism in the X, Y, and Z **trajectory_data (str): Required argument for the `trajectory`
directions. Required. geometry. The path to the ASCII trajectory data file.
npoints (array-like): Argument for the 'rectprism' geometry. Contains **trajectory_format (str): Required argument for the `trajectory`
the number of points in the X, Y, and Z directions to interpolate geometry. The format of the trajectory data file. Supported formats
onto. Required. are `tecplot` (data is a tecplot zone with 3D positional variables)
trajectory_data (str): Argument for the 'trajectory' geometry. The path and `batsrus` (data is formatted as described for the `SATELLITE`
to the ASCII trajectory data file. Required. command, see SWMF documentation).
trajectory_format (str): Argument for the 'trajectory' geometry. The
format of the trajectory data file. Supported formats are 'tecplot'
(data is a tecplot zone with 3D positional variables and 'time') and
'batsrus' (data is formatted as described for the #SATELLITE
command, see SWMF documentation). Required.
Examples: Examples:
```python ```python
...@@ -562,13 +554,13 @@ def interpolate_zone_to_geometry( ...@@ -562,13 +554,13 @@ def interpolate_zone_to_geometry(
) )
## geometry: spacecraft trajectory as specified for the ## geometry: spacecraft trajectory as specified for the
## BATSRUS #SATELLITE command ## BATSRUS SATELLITE command
tpt.interpolate_zone_to_geometry( tpt.interpolate_zone_to_geometry(
dataset=dataset, dataset=dataset,
source_zone=dataset.zone(0), source_zone=dataset.zone(0),
geometry='trajectory', geometry='trajectory',
trajectory_format='batsrus', trajectory_format='batsrus',
trajectory_data='./test_data/satellite_e4.dat' trajectory_data='satellite_e4.dat'
) )
## The new zones are labeled with the name of the geometry and can be ## The new zones are labeled with the name of the geometry and can be
......
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