diff options
Diffstat (limited to 'docs/plot')
| -rw-r--r-- | docs/plot/plot.py | 12 | ||||
| -rw-r--r-- | docs/plot/plotdefs.json | 23 |
2 files changed, 32 insertions, 3 deletions
diff --git a/docs/plot/plot.py b/docs/plot/plot.py index 139281bf..a4f330f6 100644 --- a/docs/plot/plot.py +++ b/docs/plot/plot.py @@ -157,8 +157,14 @@ def project(coordinates, proj_string, in_radians=False): args = [PROJ, '-b'] args.extend(proj_string.split(' ')) - proc = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, - env={'PROJ_LIB': os.path.abspath(PROJ_LIB)}) + try: + proc = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, + env={'PROJ_LIB': os.path.abspath(PROJ_LIB)}) + except FileNotFoundError: + print("'proj' binary not found, please update PROJ constant in plot.py " + "to point to your local 'proj' binary") + exit(1) + stdout, _ = proc.communicate(coordinates.tobytes(order='C')) out = np.frombuffer(stdout, dtype=np.double) @@ -304,7 +310,7 @@ def plotproj(plotdef, data, outdir): # Make sure the plot is not stretched axes.set_aspect('equal') - + if not os.path.exists(outdir): os.makedirs(outdir) plt.savefig(outdir + '/' + plotdef['filename'], diff --git a/docs/plot/plotdefs.json b/docs/plot/plotdefs.json index c494d6a7..daaf2ef8 100644 --- a/docs/plot/plotdefs.json +++ b/docs/plot/plotdefs.json @@ -88,6 +88,18 @@ "type": "poly" }, { + "filename": "bertin1953.png", + "latmax": 90, + "latmin": -90, + "latmin": -60, + "lonmax": 180, + "lonmin": -180, + "name": "bertin1953", + "projstring": "+proj=bertin1953", + "res": "low", + "type": "poly" + }, + { "filename": "bipc.png", "latmax": 90, "latmin": -90, @@ -1243,6 +1255,17 @@ "type": "poly" }, { + "filename": "tobmerc.png", + "latmax": 80, + "latmin": -80, + "lonmax": 180, + "lonmin": -180, + "name": "tobmerc", + "projstring": "+proj=tobmerc", + "res": "low", + "type": "poly" + }, + { "filename": "tpeqd.png", "latmax": 90, "latmin": -90, |
