コード例 #1
0
Author: Charlie White
Email: [email protected]
Github: echarliewhite
Description: This script plots the evolution of the standing and travelling
components of geopotential height for a specified heat wave.
"""
import numpy as np
import heat_wave_tools as hwt
import wnfreq_routines_2_0 as wnfreq
import matplotlib.pyplot as plt
import sys

# import geoheight and temp data
z_data, z_time, z_plev, z_lat, z_lon = hwt.import_nc_dir(
    '/Users/charliewhite/Documents/Year4/Thesis/climdata/ERAInterim/dailymean/z/NH/',
    'Z_GDS0_ISBL',
    pbound=(300.0, None),
    latbound=(70.5, 10.5))

g = 9.80665  # global average gravity
z_data /= g  # convert from geopotential into geopotential height

t_data, t_time, t_plev, t_lat, t_lon = hwt.import_nc_dir(
    '/Users/charliewhite/Documents/Year4/Thesis/climdata/ERAInterim/dailymean/t/summersurface/',
    'T_GDS0_ISBL',
    pbound=(1000.0, None))

# get heat wave data
N_points = 0.05 * t_lat.size * t_lon.size  # 5% of grid points
heat_wave_dict = hwt.find_heat_waves(t_data, 97.5, t_lat, t_lon, N_points, 5)
print '%d heat waves detected' % len(heat_wave_dict.keys())
コード例 #2
0
import numpy as np
import heat_wave_tools as hwt
import wnfreq_routines_2_0 as wnfreq
import matplotlib.pyplot as plt
import sys
import gc
import datetime

pressure = 300.0 # the pressure level for all geoheight plots
# specific heat waves to plot together
plot_hwaves = ['year_9_day_49', 'year_32_day_32'] 
init_date = datetime.date(1979,5,1) # May 1, 1979

# import geoheight and temp data
z_data, z_time, z_plev, z_lat, z_lon = hwt.import_nc_dir(
    '/Users/charliewhite/Documents/Year4/Thesis/climdata/ERAInterim/dailymean/z/NH/',
    'Z_GDS0_ISBL', pbound=(pressure,None), latbound=(61.5,13.5))

g = 9.80665 # global average gravity
z_data /= g # convert from geopotential into geopotential height

t_data, t_time, t_plev, t_lat, t_lon = hwt.import_nc_dir(
    '/Users/charliewhite/Documents/Year4/Thesis/climdata/ERAInterim/dailymean/t/summersurface/',
    'T_GDS0_ISBL', pbound=(1000.0,None))

# get heat wave data
N_points = 0.05*t_lat.size*t_lon.size # 5% of grid points
heat_wave_dict = hwt.find_heat_waves(t_data,97.5,t_lat,t_lon,N_points,5)
print '%d heat waves detected' % len(heat_wave_dict.keys())

# climatology