Repository: ARM-DOE/ACT

Issue:
Usability Issue: plot_barbs_from_spd_dir takes in direction, speed
For example:

`TimeSeriesDisplay.plot_barbs_from_spd_dir(dir_field, spd_field, pres_field=None, dsname=None, **kwargs)`

It would make sense to change the input to spd_field, dir_field or rename the function for consistency. 


Discussion:

Resolving patch:
diff --git a/act/plotting/timeseriesdisplay.py b/act/plotting/timeseriesdisplay.py
--- a/act/plotting/timeseriesdisplay.py
+++ b/act/plotting/timeseriesdisplay.py
@@ -620,7 +620,9 @@ def plot(
 
         return ax
 
-    def plot_barbs_from_spd_dir(self, dir_field, spd_field, pres_field=None, dsname=None, **kwargs):
+    def plot_barbs_from_spd_dir(
+        self, speed_field, direction_field, pres_field=None, dsname=None, **kwargs
+    ):
         """
         This procedure will make a wind barb plot timeseries.
         If a pressure field is given and the wind fields are 1D, which, for
@@ -633,12 +635,12 @@ def plot_barbs_from_spd_dir(self, dir_field, spd_field, pres_field=None, dsname=
 
         Parameters
         ----------
-        dir_field : str
+        speed_field : str
+            The name of the field specifying the wind speed in m/s.
+        direction_field : str
             The name of the field specifying the wind direction in degrees.
             0 degrees is defined to be north and increases clockwise like
             what is used in standard meteorological notation.
-        spd_field : str
-            The name of the field specifying the wind speed in m/s.
         pres_field : str
             The name of the field specifying pressure or height. If using
             height coordinates, then we recommend setting invert_y_axis
@@ -677,12 +679,12 @@ def plot_barbs_from_spd_dir(self, dir_field, spd_field, pres_field=None, dsname=
             dsname = list(self._obj.keys())[0]
 
         # Make temporary field called tempu, tempv
-        spd = self._obj[dsname][spd_field]
-        dir = self._obj[dsname][dir_field]
+        spd = self._obj[dsname][speed_field]
+        dir = self._obj[dsname][direction_field]
         tempu = -np.sin(np.deg2rad(dir)) * spd
         tempv = -np.cos(np.deg2rad(dir)) * spd
-        self._obj[dsname]['temp_u'] = deepcopy(self._obj[dsname][spd_field])
-        self._obj[dsname]['temp_v'] = deepcopy(self._obj[dsname][spd_field])
+        self._obj[dsname]['temp_u'] = deepcopy(self._obj[dsname][speed_field])
+        self._obj[dsname]['temp_v'] = deepcopy(self._obj[dsname][speed_field])
         self._obj[dsname]['temp_u'].values = tempu
         self._obj[dsname]['temp_v'].values = tempv
         the_ax = self.plot_barbs_from_u_v('temp_u', 'temp_v', pres_field, dsname, **kwargs)


Test patch:
diff --git a/act/tests/test_plotting.py b/act/tests/test_plotting.py
--- a/act/tests/test_plotting.py
+++ b/act/tests/test_plotting.py
@@ -297,7 +297,7 @@ def test_barb_sounding_plot():
     BarbDisplay.plot_time_height_xsection_from_1d_data(
         'rh', 'pres', cmap='coolwarm_r', vmin=0, vmax=100, num_time_periods=25
     )
-    BarbDisplay.plot_barbs_from_spd_dir('deg', 'wspd', 'pres', num_barbs_x=20)
+    BarbDisplay.plot_barbs_from_spd_dir('wspd', 'deg', 'pres', num_barbs_x=20)
     sonde_ds.close()
 
     try:
@@ -857,10 +857,17 @@ def test_assessment_overplot_multi():
 
     # Plot data
     display = TimeSeriesDisplay(ds, subplot_shape=(1,), figsize=(10, 6))
-    display.plot(var_name1, label=var_name1, assessment_overplot=True,
-                 overplot_behind=True, linestyle='')
-    display.plot(var_name2, day_night_background=True, color='green',
-                 label=var_name2, assessment_overplot=True, linestyle='')
+    display.plot(
+        var_name1, label=var_name1, assessment_overplot=True, overplot_behind=True, linestyle=''
+    )
+    display.plot(
+        var_name2,
+        day_night_background=True,
+        color='green',
+        label=var_name2,
+        assessment_overplot=True,
+        linestyle='',
+    )
 
     ds.close()
     try: