Skip to content

Commit e7f2e8a

Browse files
committed
Added KPP-Standalone plot fixes for latitude labels pressure range
gcpy/kpp/kppsa_utils.py - Use os.path.expanduser instead of os.path.abspath to replace "~" in input paths instead of os.path.abspath - Set the default pressure range to 1020..500 for now. We may add the pressure range as an input variable later Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
1 parent 9823781 commit e7f2e8a

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

gcpy/kpp/kppsa_utils.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"""
66

77
# Imports
8-
from os.path import abspath, join
8+
from os.path import expanduser, join
99
from glob import glob
1010
import matplotlib.pyplot as plt
1111
import numpy as np
@@ -29,7 +29,7 @@ def kppsa_get_file_list(
2929
Returns
3030
file_list : list : List of files matching the criteria
3131
"""
32-
return glob(abspath(join(input_dir, f"*{pattern}*")))
32+
return glob(join(expanduser(input_dir), f"*{pattern}*"))
3333

3434

3535
def kppsa_read_one_csv_file(file_name):
@@ -160,9 +160,9 @@ def kppsa_prepare_site_data(
160160

161161
# Create the top title for the subplot for this observation site
162162
# (use integer lon & lat values and N/S lat and E/W lon notation)
163-
lat = int(round(get_element_of_series(dframe["Latitude"], 0)))
164-
lon = int(round(get_element_of_series(dframe["Longitude"], 0)))
165-
time = get_element_of_series(dframe["DateTime"], 0)
163+
lat = int(round(get_element_of_series(site_data["Latitude"], 0)))
164+
lon = int(round(get_element_of_series(site_data["Longitude"], 0)))
165+
time = get_element_of_series(site_data["DateTime"], 0)
166166
ystr = "S"
167167
if lat >= 0:
168168
ystr = "N"
@@ -281,7 +281,7 @@ def kppsa_plot_single_site(
281281

282282
# Set Y-axis range
283283
axes_subplot.set_ylim(
284-
1000.0,
284+
1020.0,
285285
500.0
286286
)
287287
axes_subplot.set_yticks(

0 commit comments

Comments
 (0)