Skip to content

Commit

Permalink
add the option of plotting tracks to plot_selected_probability_fields
Browse files Browse the repository at this point in the history
  • Loading branch information
FariborzDaneshvar-NOAA authored and SorooshMani-NOAA committed Aug 7, 2024
1 parent 6bf3d80 commit ae00a93
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ensembleperturbation/plotting/surrogate.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,7 @@ def plot_selected_probability_fields(
output_directory: PathLike,
label_unit_convert_factor: float = 1,
label_unit_name: str = 'm',
storm: str = None,
):
probabilities = node_prob_field.probabilities

Expand Down Expand Up @@ -655,6 +656,20 @@ def plot_selected_probability_fields(
map_axis.set_xlim(xlim)
map_axis.set_ylim(ylim)

if storm is not None:
if not isinstance(storm, VortexTrack):
try:
storm = VortexTrack.from_file(storm)
except FileNotFoundError:
storm = VortexTrack(storm)

map_axis.plot(
storm.data['longitude'], storm.data['latitude'], 'k--', label=storm.name,
)

if storm.name is not None:
map_axis.legend(fontsize=6)

pyplot.subplots_adjust(wspace=0.02, right=0.96)
cax = pyplot.axes([0.95, 0.55, 0.015, 0.3])
cbar = figure.colorbar(im, extend='neither', cax=cax)
Expand Down

0 comments on commit ae00a93

Please sign in to comment.