当前位置: 首页>>代码示例>>Python>>正文


Python Data.get_climatology方法代码示例

本文整理汇总了Python中pycmbs.data.Data.get_climatology方法的典型用法代码示例。如果您正苦于以下问题:Python Data.get_climatology方法的具体用法?Python Data.get_climatology怎么用?Python Data.get_climatology使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pycmbs.data.Data的用法示例。


在下文中一共展示了Data.get_climatology方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Data

# 需要导入模块: from pycmbs.data import Data [as 别名]
# 或者: from pycmbs.data.Data import get_climatology [as 别名]
# -*- coding: utf-8 -*-
"""
This file is part of pyCMBS.
(c) 2012- Alexander Loew
For COPYING and LICENSE details, please refer to the LICENSE files
"""
from pycmbs.data import Data
from pycmbs.plots import map_difference
import matplotlib.pyplot as plt

file_name = '../../../pycmbs/examples/example_data/air.mon.mean.nc'
A = Data(file_name, 'air', lat_name='lat', lon_name='lon', read=True, label='air temperature')
B = A.copy()
B.mulc(2.3, copy=False)
a = A.get_climatology(return_object=True)
b = B.get_climatology(return_object=True)

# a quick plot as well as a projection plot
f1 = map_difference(a, b, show_stat=False, vmin=-30., vmax=30., dmin=-60., dmax=60.)  # unprojected
plt.show()
开发者ID:marcelorodriguesss,项目名称:pycmbs,代码行数:22,代码来源:fig_map_difference.py

示例2: map_plot

# 需要导入模块: from pycmbs.data import Data [as 别名]
# 或者: from pycmbs.data.Data import get_climatology [as 别名]
f=plt.figure()
ax1=f.add_subplot(221)
ax2=f.add_subplot(222)
ax3=f.add_subplot(223)
ax4=f.add_subplot(224)
R,S,I,P = D.temporal_trend(return_object=True)
map_plot(R, use_basemap=True, ax=ax1)
map_plot(S, use_basemap=True, ax=ax2)
map_plot(I, use_basemap=True, ax=ax3)
map_plot(P, use_basemap=True, ax=ax4)
f.suptitle('Example of temporal correlation analysis results', size=20)


print 'Calculate climatology and plot ...'
# get_climatology() returns 12 values which are then used for plotting
map_season(D.get_climatology(return_object=True), use_basemap=True, vmin=-20., vmax=30.)

print 'Map difference between datasets ...'
map_difference(D,P)

print 'ZonalPlot ...'
Z=ZonalPlot()
Z.plot(D)

print 'Some LinePlot'
L=LinePlot(regress=True, title='This is a LinePlot with regression')
L.plot(D, label='2m air temperature')
L.plot(P, label='Precipitable water', ax=L.ax.twinx(), color='green')  # use secondary axis for plotting here
L.legend()

print 'Scatterplot between different variables ...'
开发者ID:jian-peng,项目名称:pycmbs,代码行数:33,代码来源:example-02.py


注:本文中的pycmbs.data.Data.get_climatology方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。