nguy / AWOT

Airborne Weather Observations Toolkit - A python-based package
http://nguy.github.io/AWOT/
GNU General Public License v2.0
16 stars 9 forks source link

fill_between_quantiles #48

Closed cjjhnst2 closed 7 years ago

cjjhnst2 commented 8 years ago

Hello.

I tried using the new fill_between_quantiles qmask_above_height, qmask_between_height, and qmask_below_height. For some reason, it is masking the entire filled quantile area. Do you have any idea what might be going on?

TEST BLOCK

Plot color filled (between quantile 25 and 75) CFADs (reflectivity and vertical radial velocity) for flight legs 1 and 5

figC, (ax1Z, ax1W) = plt.subplots(1, 2, figsize=(20,10))

ax1Z.set_axis_bgcolor('white') ax1W.set_axis_bgcolor('white')

ax1Z.set_title(r"Reflectivity CFAD", y=1.01, fontsize=16)

ax1W.set_title(r"Vertical Radial Velocity CFAD", y=1.01, fontsize=16)

ax1Z.tick_params(axis='x', labelsize=16) ax1W.tick_params(axis='x', labelsize=16) ax1Z.tick_params(axis='y', labelsize=16) ax1W.tick_params(axis='y', labelsize=16)

majorLocator = MultipleLocator(500) majorFormatter = FormatStrFormatter('%d') minorLocator = MultipleLocator(100) ax1Z.yaxis.set_major_locator(majorLocator) ax1W.yaxis.set_major_locator(majorLocator) ax1Z.yaxis.set_major_formatter(majorFormatter) ax1W.yaxis.set_major_formatter(majorFormatter) ax1Z.yaxis.set_minor_locator(minorLocator) ax1W.yaxis.set_minor_locator(minorLocator)

majorLocator = MultipleLocator(5) majorFormatter = FormatStrFormatter('%d') minorLocator = MultipleLocator(1) ax1Z.xaxis.set_major_locator(majorLocator) ax1Z.xaxis.set_major_formatter(majorFormatter) ax1Z.xaxis.set_minor_locator(minorLocator)

majorLocator = MultipleLocator(1) majorFormatter = FormatStrFormatter('%d') minorLocator = MultipleLocator(0.2) ax1W.xaxis.set_major_locator(majorLocator) ax1W.xaxis.set_major_formatter(majorFormatter) ax1W.xaxis.set_minor_locator(minorLocator)

levsWwcr = [.1, 1, 2, 5, 7, 10, 15, 20, 25]

cfadwcrZ = wcrut2.fill_between_quantiles('reflectivity', height_axis=1, #plot_percent=True, x_min=-30., x_max=20., y_min=0., ymax = altmax, ypad=10, xlab= r"Reflectivity (dB${Z}$${e}$)", ylab="Height above MSL (km)", xpad=10, xlabFontSize=16, ylabFontSize=16,

title="Reflectivity CFAD Flight Leg 1 IOP2b",

                       titleFontSize=16,
                       qmask_above_height = sfcleg1_maskabove, 
                       qmask_between_height=sfcleg1_maskbetween,
                       qmask_below_height = sfcleg1_maskbelow,  
                       #quantiles=[25, 50, 75], qcolor='none', qfillcolor='darkblue', qfillalpha=0.3,
                       quantiles=[25,50,75], qcolor='darkblue', qfillcolor='darkblue', qfillalpha=0.3,
                       start_time=s1, end_time=e1, 
                       ax=ax1Z)

cfadwcrW = wcrut2.fill_between_quantiles('velocity_corrected', height_axis=1, x_min=-6., x_max=6., y_min=0., y_max = altmax, ypad=10, xlab= r"Vertical Radial Velocity (m s$^{-1}$)", xpad=10, xlabFontSize=16, ylabFontSize=16,

title="Vertical Radial Velocity CFAD Flight Leg 1 IOP2b",

                       titleFontSize=16,
                       qmask_above_height = sfcleg1_maskabove, 
                       qmask_between_height=sfcleg1_maskbetween,
                       qmask_below_height = sfcleg1_maskbelow,  
                       #quantiles=[25, 50, 75], qcolor='none', qfillcolor='darkblue', qfillalpha=0.3,
                       quantiles=[25,50,75], qcolor='darkblue', qfillcolor='darkblue', qfillalpha=0.3,
                       start_time=s1, end_time=e1,
                       ax=ax1W)

plt.hold(True)

cfadwcrZ = wcrut3.fill_between_quantiles('reflectivity', height_axis=1, #plot_percent=True, x_min=-30., x_max=20., y_min=0., ymax = altmax, ypad=10, xlab= r"Reflectivity (dB${Z}$${e}$)", ylab="Height above MSL (km)", xpad=10, xlabFontSize=16, ylabFontSize=16,

title="Reflectivity CFAD Flight Leg 1 IOP2b",

                       titleFontSize=16,
                       qmask_above_height = sfcleg5_maskabove, 
                       qmask_between_height=sfcleg5_maskbetween,
                       qmask_below_height = sfcleg5_maskbelow, 
                       #quantiles=[25, 50, 75], qcolor='none', qfillcolor='darkgreen', qfillalpha=0.3,
                       quantiles=[25,50,75], qcolor='darkgreen', qfillcolor='darkgreen', qfillalpha=0.3,
                       start_time=s5, end_time=e5, 
                       ax=ax1Z)

cfadwcrW = wcrut3.fill_between_quantiles('velocity_corrected', height_axis=1, x_min=-6., x_max=6., y_min=0., y_max = altmax, ypad=10, xlab= r"Vertical Radial Velocity (m s$^{-1}$)", xpad=10, xlabFontSize=16, ylabFontSize=16,

title="Vertical Radial Velocity CFAD Flight Leg 1 IOP2b",

                       titleFontSize=16, 
                       qmask_above_height = sfcleg5_maskabove, 
                       qmask_between_height=sfcleg5_maskbetween,
                       qmask_below_height = sfcleg5_maskbelow, 
                       #quantiles=[25, 50, 75], qcolor='none', qfillcolor='darkgreen', qfillalpha=0.3,
                       quantiles=[25, 50, 75], qcolor='darkgreen', qfillcolor='darkgreen', qfillalpha=0.3,
                       start_time=s5, end_time=e5,
                       ax=ax1W)

Force change labels for x-axis

labels = [item.get_text() for item in ax1Z.get_yticklabels()] labels[1] = '0' labels[2] = '0.5' labels[3] = '1.0' labels[4] = '1.5' labels[5] = '2.0' labels[6] = '2.5' ax1Z.set_yticklabels(labels)

Force change labels for x-axis

labels = [item.get_text() for item in ax1W.get_yticklabels()] labels[1] = '0' labels[2] = '0.5' labels[3] = '1.0' labels[4] = '1.5' labels[5] = '2.0' labels[6] = '2.5' ax1W.set_yticklabels(labels)

ax1Z.tick_params(axis='y', which='major', pad=4) ax1W.tick_params(axis='y', which='major', pad=4)

ax1Z.grid(True)

ax1Z.grid(color='black', linestyle=':', linewidth=0.5)

ax1W.grid(True)

ax1W.grid(color='black', linestyle=':', linewidth=0.5)

ymax = (sfcleg1/altmax)

yunder = (htmax1/altmax)

ax1Z.axvspan(-30, 20, ymin=0, ymax=ymax, zorder=200000, edgecolor='white', facecolor='white')

ax1W.axvspan(-8., 8., ymin=0, ymax=ymax, zorder=200000, edgecolor='white', facecolor='white')

ax1Z.axvspan(-30, 20, ymin=yunder, ymax=1, zorder=200000, edgecolor='white', facecolor='white')

figC.tight_layout()

fill_between_quantiles

nguy commented 7 years ago

Fixed in push to master.