: GEMPAK and AWIPS
System Python (2.7+)
-
Prerequisites
sudo yum install python-devel python-setuptools sudo /bin/easy_install pip sudo pip install python-awips numpy
-
Source Gemenviron.build
(after you’ve sourced Gemenviron.profile)
cd GEMPAK7 . Gemenviron.build
-
Confirm Python definitions
env |grep PY PYDEP=-lpthread -ldl -lutil PYHOME=/usr WITHPY=-DWITHPYTHON PYLIB=-lpython2.7 PYTHONPATH=/usr/lib64/python2.7/site-packages:/usr/lib/python2.7/site-packages:/home/awips/GEMPAK7/scripts/python PYINC=-I/usr/include/python2.7
-
Run
make all
andmake install
in GEMPAK7/gempakcd $NAWIPS make all 2>&1 | tee -a make.log make install
-
Confirm linked Python in the new
$OS_BIN
executablesldd $OS_BIN/gdinfo linux-vdso.so.1 => (0x00007ffde81f9000) libpython2.7.so.1.0 => /usr/lib64/libpython2.7.so.1.0 (0x00007f3168f5e000) libpthread.so.0 => /usr/lib64/libpthread.so.0 (0x00007f3168d41000) libdl.so.2 => /usr/lib64/libdl.so.2 (0x00007f3168b3d000) libutil.so.1 => /usr/lib64/libutil.so.1 (0x00007f316893a000) libgfortran.so.3 => /usr/lib64/libgfortran.so.3 (0x00007f3168617000) libm.so.6 => /usr/lib64/libm.so.6 (0x00007f3168315000) libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00007f31680ff000) libquadmath.so.0 => /usr/lib64/libquadmath.so.0 (0x00007f3167ec2000) libc.so.6 => /usr/lib64/libc.so.6 (0x00007f3167b00000) /lib64/ld-linux-x86-64.so.2 (0x00007f3169325000)
AWIPS Python
-
Install
Install all of the packages in the AWIPS Python group (or the
awips2-server
orawips2-cave
groups) to install AWIPS Python 2.7sudo yum groupinstall awips2-python sudo yum install awips2-gempak
This will install the
awips2-python-setuptools
package. -
Source Gemenviron.profile
cd GEMPAK7 . Gemenviron.profile
-
Run
gdinfo
GDFILE = A2GFS20 LSTALL = YES OUTPUT = T GDATTIM = LAST GLEVEL = 500 GVCORD = PRES GFUNC = T r Server = edex-cloud.unidata.ucar.edu Table = grid MODEL = GFS20
CentOS/RHEL 7 w Python 2.7
Install on CentOS/RHEL
pip install python-awips numpy
AWIPS Database Grid Names
For GDFILE
A2GFS
A2GFS20
A2NAM12
A2RAP13
Example
-
gdinfo
GDFILE = A2GFS20 LSTALL = YES OUTPUT = T GDATTIM = LAST GLEVEL = 500 GVCORD = PRES GFUNC = T r Requesting from edex.unidata.ucar.edu Server = edex.unidata.ucar.edu Table = grid MODEL = GFS20
Creating process: gplt for queue 0
Creating process: gif for queue 32769
Requesting from edex-cloud.unidata.ucar.edu
Traceback (most recent call last):
File “/home/awips/GEMPAK7/scripts/python/GridInfoRetriever.py”, line 5, in
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
Backtrace for this error: #0 0x7F740049E467 #1 0x7F740049EAAE #2 0x7F73FF9A466F #3 0x458E0E Segmentation fault [awips@edex-el7 ~]$
#
Remote AWIPS data retrieval must be built into GEMPAK. The GEMPAK binary is not built against Python due to the potential problem encountered when dynamically linking against libpython2.6.so or libpython2.7.so, but the binary installation can be easily updated with a new source build:
-
Source Gemenviron.build
(after you’ve sourced Gemenviron.profile)
cd $NAWIPS . Gemenviron.build
-
Confirm Python definitions
env |grep PY PYDEP=-lpthread -ldl -lutil PYHOME=/usr WITHPY=-DWITHPYTHON PYLIB=-lpython2.6 PYTHONPATH=/usr/lib64/python2.6/site-packages:/usr/lib/python2.6/site-packages:/home/awips/GEMPAK7/scripts/python PYINC=-I/usr/include/python2.6
Example shows CentOS/RHEL 6 using Python 2.6.
-
Run
make all
andmake install
in GEMPAK7/gempakcd $NAWIPS make all 2>&1 | tee -a make.log make install
-
Confirm linked Python in the new
$OS_BIN
executablesldd $OS_BIN/gdinfo linux-vdso.so.1 => (0x00007fffc8be5000) libpython2.6.so.1.0 => /usr/lib64/libpython2.6.so.1.0 (0x0000003b68200000) libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003b5ce00000) libdl.so.2 => /lib64/libdl.so.2 (0x0000003b5d200000) libutil.so.1 => /lib64/libutil.so.1 (0x0000003b6ba00000) libgfortran.so.3 => /usr/lib64/libgfortran.so.3 (0x00007ff7ef266000) libm.so.6 => /lib64/libm.so.6 (0x0000003b5ca00000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x0000003b66600000) libc.so.6 => /lib64/libc.so.6 (0x0000003b5c600000) /lib64/ld-linux-x86-64.so.2 (0x0000003b5c200000)
Install with AWIPS
GEMPAK 7.3.1 includes a bundled libpython2.7.so.1.0, which many programs link against (for example, see ldd $OS_BIN/gdinfo
), and this library is required for these program to run, but AWIPS python is not required unless you request A2 data sources. Making a request for GDFILE = A2NAM12
, for example, results in the following error:
Requesting from edex.unidata.ucar.edu
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
ImportError: No module named site
While GDFILE = GFS
(which resolves to $GEMDATA/model) would run as expected on a local data file.
As part of the migration from NAWIPS to AWIPS (II), the users will no longer have GEMPAK data management files created for use in operations. All data will be retrieved from the AWIPS database.
The changes in v7.0.0 only apply to applications that read data. Any of the programs that write data to GEMPAK files will not write to the A2DB. The following is a list of the applications that may access the A2DB: ● Surface (SF) ○ SFGRAM - plot meteorograms ○ SFL604/SFLIST - list surface observations in different tabular formats ○ SFMAP - plot surface observations on a map ● Sounding (SN) [Upper Air] ○ SNCROSS - plot a spatial or temporal cross-section ○ SNHODO - plot a hodograph ○ SNLIST - list the upper air observations ○ SNMAP - plot upper air observations on a map ○ SNPROF - plot a sounding profile/SKEW-T ○ SNTSER - plot a time series of an upper air data parameter ● Grid (GD) ○ GDCNTR - plot contours on a map ○ GDCROSS - plot a spatial cross-section ○ GDLIST - list grid point data ○ GDMAP - plot grid point values on a map ○ GDPLOT/GDPLOT2/GDPLOT3 - plot contours, vectors, point data, streamlines as appropriate for the type of data ○ GDPROF - plot a sounding profile/SKEW-T at a grid point ○ GDSTREAM - plot streamlines on a map ○ GDTHGT - plot a temporal cross-section ○ GDTSER - plot a time series at a grid point ○ GDWIND - plot vectors on a map
Adding or Modifying a Data Set In order to access data from the A2DB, use the standard SFFILE, SNFILE and GDFILE application parameters. These parameters allow the use of aliases to represent files or collections of files. This functionality has been extended to reference the control files, which define the attributes for connecting to, and reading from, the A2DB. The aliases are defined in $GEMTBL/config/datatype.tbl. For a new entry in the DataType table, most of the values can be copied from a corresponding entry that references an actual directory and file. The differences are in the PATH and FILE TEMPLATE. The path will always be AWIPSDB and the file will be the name of the control file. All of the control files reside in $GEMTBL/data-access. For example, the entry for METAR data from the A2DB begins with: A2METAR AWIPSDB metar.xml ……… The remainder of the line is identical to the regular METAR alias. After adding a new entry in the DataType table, the XML control file must be created. The control file equates the A2DB meta information to the required GEMPAK information for defining the contents of a “data file”. GEMPAK Surface, Sounding and Grid files have header values that identify the type of file and how to read the subsequent data. The control file is configured to specify the Python scripts that will request the appropriate header information and how that information is returned to the GEMPAK applications. At present, adding new point data types requires some knowledge of the contents of the A2DB in order to configure the list of data fields. Adding new grid data sets is much easier, but does require the name of the grid data in the A2DB. For example, the GFS model is stored as “GFS230” and the NAM model is stored as “nam”. Note that one is uppercase and one is lowercase. Until a utility can be written to provide the required information, please see your local AWIPS Administrator to help gather this information.
Suggested Installation for the AWIPS Environment The following configuration is used on NTBN, OPCN and HPCN. It allows for easy updating, but does require a separate user account to store the NAWIPS/GEMPAK tables, libraries and binaries. 1. If it does not exist, create a user account named “gempak”. Log into the “gempak” account. 2. Get the source tar file from the download web site above and transfer it to the AWIPS system. 3. Sample .cshrc and .profile files may also be found on the download site. 4. Make a directory for the current release (i.e., mkdir v7.0.0) in $HOME. 5. Go to the release directory and unpack the source tar file. 6. Follow the build instructions above. The current data flow paradigm for the AWIPS does not provide for creating or transferring GEMPAK files to the AWIPS system. Therefore, all of the data-related environment variables will not be used. Any data access, while on an AWIPS system, will be through the database. Sample entries for the data types are in $GEMTBL/config/datatype.tbl and the XML control files are in $GEMTBL/data-access/*.xml.