Example #1
0
ens = ensemble(**vargs)

# p = proxy(sitename, lon, lat, dpath=dpath, dataset=dataset, variable=variable,
#           season=season, value=value, period=period, climatology=climatology, calc_anoms=calc_anoms, detrend=detrend)
"""
instantiate the analog classes with the proxy for each dataset + variable we
want to map
"""

# ==============================================================================
"""
SST
"""

sst = analogs(ens, 'ersst', 'sst').composite()

f = scalar_plot(sst, test=0.1, proj='cyl').plot()

f.savefig(os.path.join(opath, 'map_ensemble.png'))

# ==============================================================================
"""
UWND at 850 and 200 hPa
"""

uwnd = analogs(ens, 'ncep', 'uwnd_200').composite()

f = scalar_plot(uwnd, test=0.05, proj='cyl').plot()

f.savefig(os.path.join(opath, 'map2_ensemble.png'))
Example #2
0
p.proxy_repr()

"""
instantiate the analog classes with the proxy for each dataset + variable we
want to map
"""

"""
if the attached dataset is the VCSN dataset, we plot the corresponding composite
anomalies for the variable the proxy is sensitive to
"""

dataset = p.dataset
variable = p.variable

compos = analogs(p, dataset, variable).composite()

if dataset in ['vcsn']:
    f = scalar_plot(compos, test=0.1, proj='cyl', res='h').plot(subplots=False)
else:
    f = scalar_plot(compos, test=0.1, proj='cyl', res='i').plot(subplots=False)

images.append({'id': '{}_{}'.format(dataset, variable), 'title' : '{} seasonal {}'.format(dataset, variable), 'filename': '{}_{}_proxy.png'.format(dataset, variable)})

plt.close(f)

data_var = {}
data_var['ncep'] = ['hgt_1000','hgt_850','uwnd_1000']
data_var['ersst'] = ['sst']
data_var['gpcp'] = ['Rain']
# p = proxy(sitename, lon, lat, dpath=dpath, dataset=dataset, variable=variable,
#           season=season, value=value, period=period, climatology=climatology, calc_anoms=calc_anoms, detrend=detrend)


"""
instantiate the analog classes with the proxy for each dataset + variable we
want to map
"""

# ==============================================================================
"""
SST
"""

sst = analogs(ens, 'ersst', 'sst').composite()

f = scalar_plot(sst, test=0.1, proj='cyl').plot()

f.savefig(os.path.join(opath, 'map_ensemble.png'))

# ==============================================================================
"""
UWND at 850 and 200 hPa
"""

uwnd = analogs(ens, 'ncep', 'uwnd_200').composite()

f = scalar_plot(uwnd, test=0.05, proj='cyl').plot()

f.savefig(os.path.join(opath, 'map2_ensemble.png'))
Example #4
0
plt.close(f)

"""
instantiate the analog classes with the proxy for each dataset + variable we
want to map
"""

"""
if the attached dataset is the VCSN dataset, we plot the corresponding composite
anomalies for the variable the proxy is sensitive to
"""
if p.dataset == 'vcsn':
    if verbose:
        save_progress(opath, 'VCSN', 15)
    if p.variable == 'Rain':
        vcsn = analogs(p, 'vcsn', 'Rain').composite()
        f = scalar_plot(vcsn, test=0.1, proj='cyl', res='h').plot(subplots=False)
        f.savefig(os.path.join(opath,'VCSN_rain_proxy.png'))
        images.append({'id': 'vcsn_rain', 'title' : 'VCSN seasonal rainfall', 'filename': 'VCSN_rain_proxy.png'})
        plt.close(f)

    if p.variable == 'TMean':
        vcsn = analogs(p, 'vcsn', 'TMean').composite()
        f = scalar_plot(vcsn, test=0.1, proj='cyl', res='h', vmin=-1.5, vmax=1.5).plot(subplots=False)
        f.savefig(os.path.join(opath,'VCSN_tmean_proxy.png'))
        images.append({'id': 'vcsn_tmean', 'title' : 'VCSN seasonal Temperatures', 'filename': 'VCSN_tmean_proxy.png'})
        plt.close(f)


# ==============================================================================
"""