obs_time = modules.date_process(obs_date,obs_time) #process model #---------------------------------------- #read in model data model_dict = {'4x5':'/work/home/db876/plotting_tools/binary_logs/v90103_4x5_GRID_O3.npy','2x2.5':'/work/home/db876/plotting_tools/binary_logs/v90103_2x2.5_GRID_O3.npy'} model_version = raw_input('\nChoose Model Version.\n%s\n'%(' '.join(i for i in model_dict))) model_f = model_dict[model_version] model_data = read = np.load(model_f) model_time = np.arange(0,2191,1./24) #get model grid dims. for sim. type lat_c,lat_e,lon_c,lon_e = modules.model_grids(model_version) gridbox_count = len(lat_c)*len(lon_c) #get model gridbox for obs site gridbox_n = modules.obs_model_gridbox(lat_e,lon_e,obs_lat,obs_lon) model_var = model_data[gridbox_n::gridbox_count] model_var = model_var*1e9 #---------------------------------------- model_time = model_time[valids] model_var = model_var[valids] #take lomb for obs and model ofac = raw_input('\nChoose oversampling factor. (Typically 4.)\n')
model_dict = { '4x5': 'binary_logs/4x5_GRID_O3.npy', '2x2.5': 'binary_logs/2x2.5_GRID_O3.npy' } model_version = raw_input('\nChoose Model Version.\n%s\n' % (' '.join(i for i in model_dict))) model_f = model_dict[model_version] model_data = read = np.load(model_f) if model_version == '2x2.5': model_time = np.arange(0, 2191, 1. / 24) else: model_time = np.arange(0, 2190, 1. / 24) #get model grid dims. for sim. type lat_c, lat_e, lon_c, lon_e = modules.model_grids(model_version) gridbox_count = len(lat_c) * len(lon_c) #get model gridbox for obs site gridbox_n = modules.obs_model_gridbox(lat_e, lon_e, obs_lat, obs_lon) model_var = model_data[gridbox_n::gridbox_count] model_var = model_var * 1e9 #---------------------------------------- #align obs and model periods #obs_time,model_time,obs_var,model_var = modules.align_periods(obs_time,model_time,obs_var,model_var) #take lomb for obs and model ofac = raw_input('\nChoose oversampling factor. (Typically 4.)\n')
import plotly.plotly as py from plotly.graph_objs import * from plotly import tools import numpy as np from mpl_toolkits.basemap import Basemap import modules # Create random data with numpy import numpy as np N = 1000 random_x = np.random.randn(N) random_y = np.random.randn(N) lat_c, lat_e, lon_c, lon_e = modules.model_grids('GEOSCHEM_4x5') data = np.random.rand(len(lat_c), len(lon_c)) # Create a trace trace1 = Heatmap( z=data, x=lon_e, y=lat_e, colorscale="RdBu", zauto=False, # custom contour levels zmin=0, # first contour level zmax=1 # last contour level => colorscale is centered about 0 ) m = Basemap()