Skip to content

Commit

Permalink
Feature 933 cartopy hpc (#964)
Browse files Browse the repository at this point in the history
* Modification to use NaturalEarth shapefiles that are already downloaded
and saved to file in location designated by the CARTOPY_DIR environment.

* Github Issue #933 Check for CARTOPY_DIR first, if unset, then proceed as
before.

* updated documentation for offline systems

* Updated docs based on feedback

Co-authored-by: Minna Win <[email protected]>
  • Loading branch information
j-opatz and Minna Win authored Jun 24, 2021
1 parent dda9de3 commit 3498c31
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/Users_Guide/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ to run.
- cartopy (0.17.0)
- matplotlib (3.3.4)

Cartopy, one of the dependencies of CyclonePlotter, attempts to download shapefiles from the internet to complete successfully. So if CyclonePlotter is run on a closed system (i.e. no internet), additional steps need to be taken. First, go to the Natural Earth Data webpage and download the small scale (1:110m) cultural and physical files that will have multiple extensions (e.g. .dbf, .shp, .shx). Untar these files in a noted location. Finally, create an environment variable in the user-specific system configuration file for CARTOPY_DIR, setting it to the location where the shapefiles are located.

.. _getcode:

Getting the METplus Wrappers source code
Expand Down
3 changes: 2 additions & 1 deletion docs/Users_Guide/wrappers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ Description

This wrapper does not have a corresponding MET tool but instead wraps
the logic necessary to create plots of cyclone tracks. Currently only
the output from the MET tc-pairs tool can be plotted.
the output from the MET tc-pairs tool can be plotted. If used on an internet-limited system,
additional dependencies may apply. See :ref:`install` for details.

METplus Configuration
---------------------
Expand Down
7 changes: 7 additions & 0 deletions metplus/wrappers/cyclone_plotter_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@
import matplotlib.ticker as mticker
import cartopy.crs as ccrs
import cartopy.feature as cfeature
import cartopy
from cartopy.mpl.gridliner import LONGITUDE_FORMATTER, LATITUDE_FORMATTER
##If the script is run on a limited-internet access machine, the CARTOPY_DIR environment setting
##will need to be set in the user-specific system configuration file. Review the Installation section
##of the User's Guide for more details.
if os.getenv('CARTOPY_DIR'):
cartopy.config['data_dir'] = os.getenv('CARTOPY_DIR', cartopy.config.get('data_dir'))

except Exception as err_msg:
WRAPPER_CANNOT_RUN = True
EXCEPTION_ERR = err_msg
Expand Down

0 comments on commit 3498c31

Please sign in to comment.