Skip to content

Commit

Permalink
Added KPP-Standalone plot fixes for latitude labels pressure range
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
yantosca committed Dec 12, 2024
1 parent 9823781 commit e7f2e8a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions gcpy/kpp/kppsa_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""

# Imports
from os.path import abspath, join
from os.path import expanduser, join
from glob import glob
import matplotlib.pyplot as plt
import numpy as np
Expand All @@ -29,7 +29,7 @@ def kppsa_get_file_list(
Returns
file_list : list : List of files matching the criteria
"""
return glob(abspath(join(input_dir, f"*{pattern}*")))
return glob(join(expanduser(input_dir), f"*{pattern}*"))


def kppsa_read_one_csv_file(file_name):
Expand Down Expand Up @@ -160,9 +160,9 @@ def kppsa_prepare_site_data(

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

# Set Y-axis range
axes_subplot.set_ylim(
1000.0,
1020.0,
500.0
)
axes_subplot.set_yticks(
Expand Down

0 comments on commit e7f2e8a

Please # to comment.