def plot_hodograph(axes, z, u, v): """Plot Hodograph data This plots u and v winds vs height on a hodograph. :parameter z: height values (1D array) :parameter u: U component of wind at z heights (1D array) :parameter v: V component of wind at z heights (1D array) :paramter axes: The axes instance to draw on """ # plot hodograph z6km = 0 while z[z6km] <= 12000: z6km += 1 axes.plot(u[0:z6km], v[0:z6km], color='black', linewidth=1.5) for zlvl in np.arange(0, 7000, 1000): ulvl = pymeteo.interp.linear(z, u, zlvl) vlvl = pymeteo.interp.linear(z, v, zlvl) #print('calculating winds at height {0} = ({1},{2})'.format(zlvl,ulvl,vlvl)) label_h(ulvl + 1, vlvl - 1, str(int(zlvl / 1000)), 'black', 0, axes) axes.plot(ulvl, vlvl, color='black', markersize=5, marker='.') #TODO: fix this try: ucb = dyn.storm_motion_bunkers(u, v, z) axes.plot(ucb[0], ucb[1], markersize=4, color='black', marker='x') axes.plot(ucb[2], ucb[3], markersize=4, color='black', marker='x') except: print( "Error calculating sounding stats, storm motion marker not plotted" )
def calc_hodograph_stats(_z, _u, _v): ucb = dyn.storm_motion_bunkers(_u,_v,_z) # SRH srh01 = dyn.srh(_u, _v, _z, 0., 1000., ucb[0], ucb[1]) srh03 = dyn.srh(_u, _v, _z, 0., 3000., ucb[0], ucb[1]) erh01 = dyn.srh(_u, _v, _z, 0., 1000., 0., 0.) erh03 = dyn.srh(_u, _v, _z, 0., 3000., 0., 0.) shear01 = dyn.uv_to_deg(*dyn.shear(_u, _v, _z, 0., 1000.)) shear03 = dyn.uv_to_deg(*dyn.shear(_u, _v, _z, 0., 3000.)) shear06 = dyn.uv_to_deg(*dyn.shear(_u, _v, _z, 0., 6000.)) shear12 = dyn.uv_to_deg(*dyn.shear(_u, _v, _z, 1000., 2000.)) shear23 = dyn.uv_to_deg(*dyn.shear(_u, _v, _z, 2000., 3000.)) shear34 = dyn.uv_to_deg(*dyn.shear(_u, _v, _z, 3000., 4000.)) shear45 = dyn.uv_to_deg(*dyn.shear(_u, _v, _z, 4000., 5000.)) shear56 = dyn.uv_to_deg(*dyn.shear(_u, _v, _z, 5000., 6000.)) dict = { 'bunkers' : ucb, 'srh01' : srh01, 'srh03' : srh03, 'erh01' : erh01, 'erh03' : erh03, 's01' : shear01, 's03' : shear03, 's06' : shear06, 's12' : shear12, 's23' : shear23, 's34' : shear34, 's45' : shear45, 's56' : shear56 } return dict
def plot_hodograph(axes, z, u, v): """Plot Hodograph data This plots u and v winds vs height on a hodograph. :parameter z: height values (1D array) :parameter u: U component of wind at z heights (1D array) :parameter v: V component of wind at z heights (1D array) :paramter axes: The axes instance to draw on """ # plot hodograph z6km = 0 while z[z6km] <= 12000: z6km += 1 axes.plot(u[0:z6km],v[0:z6km], color='black', linewidth=1.5) for zlvl in np.arange(0,7000,1000): ulvl = pymeteo.interp.linear(z,u,zlvl) vlvl = pymeteo.interp.linear(z,v,zlvl) #print('calculating winds at height {0} = ({1},{2})'.format(zlvl,ulvl,vlvl)) label_h2(ulvl+1,vlvl-1,str(zlvl/1000), 'black', 0, axes) axes.plot(ulvl,vlvl, color='black', markersize=5, marker='.') #TODO: fix this ucb = dyn.storm_motion_bunkers(u,v,z) axes.plot(ucb[0],ucb[1],markersize=4,color='black',marker='x') axes.plot(ucb[2],ucb[3],markersize=4,color='black',marker='x')
def calc_hodograph_stats(_z, _u, _v): try: ucb = dyn.storm_motion_bunkers(_u, _v, _z) # SRH srh01 = dyn.srh(_u, _v, _z, 0., 1000., ucb[0], ucb[1]) srh03 = dyn.srh(_u, _v, _z, 0., 3000., ucb[0], ucb[1]) except: print("Error calculating storm motion") ucb = [0., 0., 0., 0.] srh01 = 0. srh03 = 0. try: erh01 = dyn.srh(_u, _v, _z, 0., 1000., 0., 0.) erh03 = dyn.srh(_u, _v, _z, 0., 3000., 0., 0.) except: print("Error calculating erh") erh01 = 0. erh03 = 0. shear01 = dyn.uv_to_deg(*dyn.shear(_u, _v, _z, 0., 1000.)) shear03 = dyn.uv_to_deg(*dyn.shear(_u, _v, _z, 0., 3000.)) shear06 = dyn.uv_to_deg(*dyn.shear(_u, _v, _z, 0., 6000.)) shear12 = dyn.uv_to_deg(*dyn.shear(_u, _v, _z, 1000., 2000.)) shear23 = dyn.uv_to_deg(*dyn.shear(_u, _v, _z, 2000., 3000.)) shear34 = dyn.uv_to_deg(*dyn.shear(_u, _v, _z, 3000., 4000.)) shear45 = dyn.uv_to_deg(*dyn.shear(_u, _v, _z, 4000., 5000.)) shear56 = dyn.uv_to_deg(*dyn.shear(_u, _v, _z, 5000., 6000.)) dict = { 'bunkers': ucb, 'srh01': srh01, 'srh03': srh03, 'erh01': erh01, 'erh03': erh03, 's01': shear01, 's03': shear03, 's06': shear06, 's12': shear12, 's23': shear23, 's34': shear34, 's45': shear45, 's56': shear56 } return dict
def calc_hodograph_stats(_z, _u, _v): ucb = dyn.storm_motion_bunkers(_u, _v, _z) # SRH srh01 = dyn.srh(_u, _v, _z, 0., 1000., ucb[0], ucb[1]) srh03 = dyn.srh(_u, _v, _z, 0., 3000., ucb[0], ucb[1]) erh01 = dyn.srh(_u, _v, _z, 0., 1000., 0., 0.) erh03 = dyn.srh(_u, _v, _z, 0., 3000., 0., 0.) shear01 = dyn.uv_to_deg(*dyn.shear(_u, _v, _z, 0., 1000.)) shear03 = dyn.uv_to_deg(*dyn.shear(_u, _v, _z, 0., 3000.)) shear06 = dyn.uv_to_deg(*dyn.shear(_u, _v, _z, 0., 6000.)) shear12 = dyn.uv_to_deg(*dyn.shear(_u, _v, _z, 1000., 2000.)) shear23 = dyn.uv_to_deg(*dyn.shear(_u, _v, _z, 2000., 3000.)) shear34 = dyn.uv_to_deg(*dyn.shear(_u, _v, _z, 3000., 4000.)) shear45 = dyn.uv_to_deg(*dyn.shear(_u, _v, _z, 4000., 5000.)) shear56 = dyn.uv_to_deg(*dyn.shear(_u, _v, _z, 5000., 6000.)) dict = { 'bunkers': ucb, 'srh01': srh01, 'srh03': srh03, 'erh01': erh01, 'erh03': erh03, 's01': shear01, 's03': shear03, 's06': shear06, 's12': shear12, 's23': shear23, 's34': shear34, 's45': shear45, 's56': shear56 } return dict