Commit b9e9e756 authored by Salko Jr, Robert's avatar Salko Jr, Robert
Browse files

Expand on plot script inputs

parent d9fe8168
Loading
Loading
Loading
Loading
+11 −7
Original line number Diff line number Diff line
@@ -363,7 +363,7 @@ class PlotTools(object):
       me._chanPlotMaxWrapper('massflux_tot', "Mass flux [kg/m**2/s]", state, ch, figname)


   def plotPinCoupling(me, pin, dataset, state=None, figname=None, axialBounds=None, maxTemp=None):
   def plotPinCoupling(me, pin, dataset, state=None, figname=None, axialBounds=None, minData=None, maxData=None):
      """ Makes a contour plot of rod surface data

      Passed dataset must be a coupling dataset (has prefix of "coupling")
@@ -376,7 +376,8 @@ class PlotTools(object):
         axialBounds (float) : List of 2 values.  Specify min and max axial locations to include
            in plot.  Specify "None" to use the dataset min or max.  First value is the min and
            second is the max.
         maxTemp (float) : Maximum temp to show in contour plot [C]
         minData (float) : Minimum value to show in contour plot
         maxData (float) : Maximum value to show in contour plot

      """
      if state is None:
@@ -405,11 +406,14 @@ class PlotTools(object):
      if axialBounds_[1] is None:
         axialBounds_[1] = max(axial)

      if maxTemp is None:
         maxTemp_ = np.max(data)
      if maxData is None:
         maxData_ = np.max(data)
      else:
         maxTemp_ = maxTemp
      minTemp_ = np.min(data)
         maxData_ = maxData
      if minData is None:
         minData_ = np.min(data)
      else:
         minData_ = minData

      fig, ax = plt.subplots()
      plt.title(location)
@@ -419,7 +423,7 @@ class PlotTools(object):
      #v = np.linspace(minTemp_, maxTemp_, 7, endpoint=True)
      #c1 = ax.contourf(azimuthal, axial, data, v)
      #cbar = plt.colorbar(c1)
      im = ax.pcolor(azimuthal, axial, data, vmin=minTemp_, vmax=maxTemp_)
      im = ax.pcolor(azimuthal, axial, data, vmin=minData_, vmax=maxData_)
      ax.grid()
      cbar = fig.colorbar(im)
      dataset = dataset.replace('_',' ')
+2 −1
Original line number Diff line number Diff line
@@ -9,12 +9,13 @@ def main():
   parser.add_argument('--figname', type=str, nargs="?", help="Name of figure.  Defaults to name based on location.")
   parser.add_argument('--min_axial', type=float, help="Lower axial bound of plot (defaults to minimum axial location).")
   parser.add_argument('--max_axial', type=float, help="Upper axial bound of plot (defaults to maximum axial location).")
   parser.add_argument('--min', type=float, help="Lower bound for data")
   parser.add_argument('--max', type=float, help="Upper bound for data")
   args = parser.parse_args()

   plotter = PlotTools(args.h5name)

   plotter.plotPinCoupling(args.pin, 'coupling_surface_tke', args.state, args.figname, [args.min_axial, args.max_axial], args.max)
   plotter.plotPinCoupling(args.pin, 'coupling_surface_tke', args.state, args.figname, [args.min_axial, args.max_axial], args.min, args.max)

if __name__=='__main__':
   main()
+2 −1
Original line number Diff line number Diff line
@@ -9,12 +9,13 @@ def main():
   parser.add_argument('--figname', type=str, nargs="?", help="Name of figure.  Defaults to name based on location.")
   parser.add_argument('--min_axial', type=float, help="Lower axial bound of plot (defaults to minimum axial location).")
   parser.add_argument('--max_axial', type=float, help="Upper axial bound of plot (defaults to maximum axial location).")
   parser.add_argument('--min', type=float, help="Lower bound for temperature data [C]")
   parser.add_argument('--max', type=float, help="Upper bound for temperature data [C]")
   args = parser.parse_args()

   plotter = PlotTools(args.h5name)

   plotter.plotPinCoupling(args.pin, 'coupling_surface_temperature', args.state, args.figname, [args.min_axial, args.max_axial], args.max)
   plotter.plotPinCoupling(args.pin, 'coupling_surface_temperature', args.state, args.figname, [args.min_axial, args.max_axial], args.min, args.max)

if __name__=='__main__':
   main()
+2 −0
Original line number Diff line number Diff line
@@ -49,6 +49,8 @@ runScriptTest "../SubKit/process/plotPinRadialTemp.py unitTests/dummy.h5 --state

runScriptTest "../SubKit/process/plotCouplingSurfTKE.py unitTests/coupling.h5 1"
runScriptTest "../SubKit/process/plotCouplingSurfTKE.py unitTests/coupling.h5 1 --state=1 --figname=custom.png --min_axial=0.0 --max_axial=1.0 --max=0.1"
runScriptTest "../SubKit/process/plotCouplingSurfTKE.py unitTests/coupling.h5 1 --state=1 --figname=custom.png --min_axial=0.0 --max_axial=1.0 --min=0.05 --max=0.1"

runScriptTest "../SubKit/process/plotCouplingSurfTemp.py unitTests/coupling.h5 1"
runScriptTest "../SubKit/process/plotCouplingSurfTemp.py unitTests/coupling.h5 1 --state=1 --figname=custom.png --min_axial=0.0 --max_axial=1.0 --max=0.1"
runScriptTest "../SubKit/process/plotCouplingSurfTemp.py unitTests/coupling.h5 1 --state=1 --figname=custom.png --min_axial=0.0 --max_axial=1.0 --min=0.05 --max=0.1"