From 5d4d60238716ef7a38eb208c6c5a627209480455 Mon Sep 17 00:00:00 2001 From: rs028 Date: Thu, 19 Mar 2020 13:21:14 +0000 Subject: [PATCH] Add __future__ and rename python scripts --- tools/plot/{plot-atchem2_v2.py => plot-atchem2-numpy.py} | 9 +++++---- .../plot/{plot-atchem2_v3.py => plot-atchem2-pandas.py} | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) rename tools/plot/{plot-atchem2_v2.py => plot-atchem2-numpy.py} (93%) rename tools/plot/{plot-atchem2_v3.py => plot-atchem2-pandas.py} (93%) diff --git a/tools/plot/plot-atchem2_v2.py b/tools/plot/plot-atchem2-numpy.py similarity index 93% rename from tools/plot/plot-atchem2_v2.py rename to tools/plot/plot-atchem2-numpy.py index d6addcced..1a3372044 100644 --- a/tools/plot/plot-atchem2_v2.py +++ b/tools/plot/plot-atchem2-numpy.py @@ -10,7 +10,7 @@ # ----------------------------------------------------------------------------- ## Plotting tool for the AtChem2 model output -## --> Python2 version [requires numpy & matplotlib] +## --> Python version [requires numpy & matplotlib] ## ## Acknowledgements: M. Panagi ## @@ -18,15 +18,16 @@ ## - directory with the model output ## ## USAGE: -## python2 ./tools/plot/plot-atchem2_v2.py ./model/output/ +## python ./tools/plot/plot-atchem2-numpy.py ./model/output/ ## ---------------------------------------------- ## +from __future__ import print_function import os, sys import numpy as np import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages os.chdir(sys.argv[1]) -print os.getcwd() +print(os.getcwd()) with open('speciesConcentrations.output') as f: var1 = f.readline().split() @@ -121,4 +122,4 @@ ## ---------------------------- ## -print "\n===> atchem2_output.pdf created in directory:", sys.argv[1], "\n\n" +print("\n===> atchem2_output.pdf created in directory:", sys.argv[1], "\n\n") diff --git a/tools/plot/plot-atchem2_v3.py b/tools/plot/plot-atchem2-pandas.py similarity index 93% rename from tools/plot/plot-atchem2_v3.py rename to tools/plot/plot-atchem2-pandas.py index 8958f017e..a636a1cb2 100644 --- a/tools/plot/plot-atchem2_v3.py +++ b/tools/plot/plot-atchem2-pandas.py @@ -10,7 +10,7 @@ # ----------------------------------------------------------------------------- ## Plotting tool for the AtChem2 model output -## --> Python3 version [requires pandas & matplotlib] +## --> Python version [requires pandas & matplotlib] ## ## Acknowledgements: M. Panagi, M. Fabre' ## @@ -18,8 +18,9 @@ ## - directory with the model output ## ## USAGE: -## python3 ./tools/plot/plot-atchem2_v3.py ./model/output/ +## python ./tools/plot/plot-atchem2-pandas.py ./model/output/ ## ---------------------------------------------- ## +from __future__ import print_function import os, sys import pandas as pd import matplotlib.pyplot as plt