Skip to content

Commit

Permalink
#2285 Adjusted the path for python scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Howard Soh committed Apr 7, 2023
1 parent 1c7f41e commit c355f4b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions docs/Users_Guide/appendixF.rst
Original file line number Diff line number Diff line change
Expand Up @@ -259,22 +259,22 @@ The ASCII2NC tool supports the "-format python" option. With this option, point
.. code-block:: none
ascii2nc -format python \
"MET_BASE/python/read_ascii_point.py sample_ascii_obs.txt" \
"MET_BASE/python/examples/read_ascii_point.py sample_ascii_obs.txt" \
sample_ascii_obs_python.nc
The Point2Grid, Plot-Point-Obs, Ensemble-Stat, and Point-Stat tools also process point observations. They support Python embedding of point observations directly on the command line by replacing the input MET NetCDF point observation file name with the Python command to be run. The Python command must begin with the prefix 'PYTHON_NUMPY=' and be followed by the path to the User's Python script and any arguments. The full command should be enclosed in single quotes to prevent embedded whitespace from causing parsing errors. An example of this is shown below:

.. code-block:: none
plot_point_obs \
"PYTHON_NUMPY=MET_BASE/python/read_ascii_point.py sample_ascii_obs.txt" \
"PYTHON_NUMPY=MET_BASE/python/examples/read_ascii_point.py sample_ascii_obs.txt" \
output_image.ps
Both of the above examples use the **read_ascii_point.py** sample script which is included with the MET code. It reads ASCII data in MET's 11-column point observation format and stores it in a Pandas DataFrame to be read by the MET tools using Python embedding for point data. The **read_ascii_point.py** sample script can be found in:

• MET installation directory in *MET_BASE/python*.
• MET installation directory in *MET_BASE/python/examples*.

• `MET GitHub repository <https://github.com/dtcenter/MET>`_ in *met/scripts/python*.
• `MET GitHub repository <https://github.com/dtcenter/MET>`_ in *met/scripts/python/examples*.

.. _pyembed-mpr-data:

Expand All @@ -285,6 +285,6 @@ The Stat-Analysis tool supports the "-lookin python" option. With this option, m

The **read_ascii_mpr.py** sample script can be found in:

• MET installation directory in *MET_BASE/python*.
• MET installation directory in *MET_BASE/python/examples*.

• `MET GitHub repository <https://github.com/dtcenter/MET>`_ in *met/scripts/python*.
• `MET GitHub repository <https://github.com/dtcenter/MET>`_ in *met/scripts/python/examples*.
2 changes: 1 addition & 1 deletion docs/Users_Guide/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ MET Directory Structure

The top-level MET directory consists of Makefiles, configuration files, and several subdirectories. The top-level Makefile and configuration files control how the entire toolkit is built. Instructions for using these files to build MET can be found in :numref:`Install_Building-the-MET`.

When MET has been successfully built and installed, the installation directory contains two subdirectories. The *bin/* directory contains executables for each module of MET as well as several plotting utilities. The *share/met/* directory contains many subdirectories with data required at runtime and a subdirectory of sample R scripts utilities. The *colortables/*, *map/*, and *ps/* subdirectories contain data used in creating PostScript plots for several MET tools. The *poly/* subdirectory contains predefined lat/lon polyline regions for use in selecting regions over which to verify. The polylines defined correspond to verification regions used by NCEP as described in :numref:`Appendix B, Section %s <appendixB>`. The *config/* directory contains default configuration files for the MET tools. The *python/* subdirectory contains sample scripts used in Python embedding (:numref:`Appendix F, Section %s <appendixF>`). The *table_files/* and *tc_data/* subdirectories contain GRIB table definitions and tropical cyclone data, respectively. The *Rscripts/* subdirectory contains a handful of plotting graphic utilities for MET-TC. These are the same Rscripts that reside under the top-level MET *scripts/Rscripts* directory, other than it is the installed location. The *wrappers/* subdirectory contains code used in Python embedding (:numref:`Appendix F, Section %s <appendixF>`).
When MET has been successfully built and installed, the installation directory contains two subdirectories. The *bin/* directory contains executables for each module of MET as well as several plotting utilities. The *share/met/* directory contains many subdirectories with data required at runtime and a subdirectory of sample R scripts utilities. The *colortables/*, *map/*, and *ps/* subdirectories contain data used in creating PostScript plots for several MET tools. The *poly/* subdirectory contains predefined lat/lon polyline regions for use in selecting regions over which to verify. The polylines defined correspond to verification regions used by NCEP as described in :numref:`Appendix B, Section %s <appendixB>`. The *config/* directory contains default configuration files for the MET tools. The *python/* subdirectory contains python scripts. The *python/examples* subdirectory contains sample scripts used in Python embedding (:numref:`Appendix F, Section %s <appendixF>`). The *python/pyembed/* subdirectory contains code used in Python embedding (:numref:`Appendix F, Section %s <appendixF>`). The *table_files/* and *tc_data/* subdirectories contain GRIB table definitions and tropical cyclone data, respectively. The *Rscripts/* subdirectory contains a handful of plotting graphic utilities for MET-TC. These are the same Rscripts that reside under the top-level MET *scripts/Rscripts* directory, other than it is the installed location.

The *data/* directory contains several configuration and static data files used by MET. The *sample_fcst/* and *sample_obs/* subdirectories contain sample data used by the test scripts provided in the *scripts/* directory.

Expand Down
2 changes: 1 addition & 1 deletion docs/Users_Guide/plotting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ An equivalent command using python embedding for point observations is shown bel

.. code-block:: none
plot_point_obs 'PYTHON_NUMPY=MET_BASE/python/read_met_point_obs.py sample_pb.nc' sample_data.ps
plot_point_obs 'PYTHON_NUMPY=MET_BASE/python/examples/read_met_point_obs.py sample_pb.nc' sample_data.ps
Please see section :numref:`pyembed-point-obs-data` for more details about Python embedding in MET.

Expand Down
8 changes: 4 additions & 4 deletions docs/Users_Guide/reformat_point.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,7 @@ Required arguments for point2grid

1. The **input_filename** argument indicates the name of the input file to be processed. The input can be a MET NetCDF point observation file generated by other MET tools or a NetCDF AOD dataset from GOES16/17. Python embedding for point observations is also supported, as described in :numref:`pyembed-point-obs-data`.

The MET point observation NetCDF file name as **input_filename** argument is equivalent with "PYTHON_NUMPY=MET_BASE/python/read_met_point_obs.py netcdf_file name'.
The MET point observation NetCDF file name as **input_filename** argument is equivalent with "PYTHON_NUMPY=MET_BASE/python/examples/read_met_point_obs.py netcdf_filename".

2. The **to_grid** argument defines the output grid as: (1) a named grid, (2) the path to a gridded data file, or (3) an explicit grid specification string.

Expand Down Expand Up @@ -1100,7 +1100,7 @@ Listed below is an example of processing the same set of observations but using
.. code-block:: none
point2grid \
'PYTHON_NUMPY=MET_BASE/python/read_met_point_obs.py ascii2nc_edr_hourly.20130827.nc' \
'PYTHON_NUMPY=MET_BASE/python/examples/read_met_point_obs.py ascii2nc_edr_hourly.20130827.nc' \
G212 python_gridded_ascii_python.nc -config Point2GridConfig_edr \
-field 'name="200"; level="*"; valid_time="20130827_205959";' -method MAX -v 1
Expand Down Expand Up @@ -1191,10 +1191,10 @@ The script can be found at:

.. code-block:: none
MET_BASE/utility/print_pointnc2ascii.py
MET_BASE/python/utility/print_pointnc2ascii.py
For how to use the script, issue the command:

.. code-block:: none
python3 MET_BASE/utility/print_pointnc2ascii.py -h
python3 MET_BASE/python/utility/print_pointnc2ascii.py -h
2 changes: 1 addition & 1 deletion docs/Users_Guide/stat-analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ The example below uses Python embedding.
.. code-block:: none
stat_analysis \
-lookin python MET_BASE/python/read_ascii_mpr.py point_stat_mpr.txt \
-lookin python MET_BASE/python/examples/read_ascii_mpr.py point_stat_mpr.txt \
-job aggregate_stat -line_type MPR -out_line_type CNT \
-by FCST_VAR,FCST_LEV
Expand Down

0 comments on commit c355f4b

Please sign in to comment.