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


Python OcgOperations.get_base_request_size方法代码示例

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


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

示例1: test_get_base_request_size_multifile_with_geom

# 需要导入模块: from ocgis.api.operations import OcgOperations [as 别名]
# 或者: from ocgis.api.operations.OcgOperations import get_base_request_size [as 别名]
 def test_get_base_request_size_multifile_with_geom(self):
     rd1 = self.test_data.get_rd('cancm4_tas')
     rd2 = self.test_data.get_rd('narccap_pr_wrfg_ncep')
     rds = [rd1,rd2]
     ops = OcgOperations(dataset=rds,geom='state_boundaries',select_ugid=[23])
     size = ops.get_base_request_size()
     self.assertEqual(size,{'variables': {'pr': {'level': {'kb': 0.0, 'shape': None, 'dtype': None}, 'temporal': {'kb': 228.25, 'shape': (29216,), 'dtype': dtype('float64')}, 'value': {'kb': 21341.375, 'shape': (1, 29216, 1, 17, 11), 'dtype': dtype('float32')}, 'realization': {'kb': 0.0, 'shape': None, 'dtype': None}, 'col': {'kb': 0.0859375, 'shape': (11,), 'dtype': dtype('float64')}, 'row': {'kb': 0.1328125, 'shape': (17,), 'dtype': dtype('float64')}}, 'tas': {'level': {'kb': 0.0, 'shape': None, 'dtype': None}, 'temporal': {'kb': 28.515625, 'shape': (3650,), 'dtype': dtype('float64')}, 'value': {'kb': 171.09375, 'shape': (1, 3650, 1, 4, 3), 'dtype': dtype('float32')}, 'realization': {'kb': 0.0, 'shape': None, 'dtype': None}, 'col': {'kb': 0.0234375, 'shape': (3,), 'dtype': dtype('float64')}, 'row': {'kb': 0.03125, 'shape': (4,), 'dtype': dtype('float64')}}}, 'total': 21769.5078125})
开发者ID:tatarinova,项目名称:ocgis,代码行数:9,代码来源:test_operations.py

示例2: test_get_base_request_size_multifile

# 需要导入模块: from ocgis.api.operations import OcgOperations [as 别名]
# 或者: from ocgis.api.operations.OcgOperations import get_base_request_size [as 别名]
 def test_get_base_request_size_multifile(self):
     rd1 = self.test_data.get_rd('cancm4_tas')
     rd2 = self.test_data.get_rd('narccap_pr_wrfg_ncep')
     rds = [rd1,rd2]
     ops = OcgOperations(dataset=rds)
     size = ops.get_base_request_size()
     self.assertEqual({'variables': {'pr': {'level': {'kb': 0.0, 'shape': None, 'dtype': None}, 'temporal': {'kb': 228.25, 'shape': (29216,), 'dtype': dtype('float64')}, 'value': {'kb': 1666909.75, 'shape': (1, 29216, 1, 109, 134), 'dtype': dtype('float32')}, 'realization': {'kb': 0.0, 'shape': None, 'dtype': None}, 'col': {'kb': 1.046875, 'shape': (134,), 'dtype': dtype('float64')}, 'row': {'kb': 0.8515625, 'shape': (109,), 'dtype': dtype('float64')}}, 'tas': {'level': {'kb': 0.0, 'shape': None, 'dtype': None}, 'temporal': {'kb': 28.515625, 'shape': (3650,), 'dtype': dtype('float64')}, 'value': {'kb': 116800.0, 'shape': (1, 3650, 1, 64, 128), 'dtype': dtype('float32')}, 'realization': {'kb': 0.0, 'shape': None, 'dtype': None}, 'col': {'kb': 1.0, 'shape': (128,), 'dtype': dtype('float64')}, 'row': {'kb': 0.5, 'shape': (64,), 'dtype': dtype('float64')}}}, 'total': 1783969.9140625},size)
开发者ID:tatarinova,项目名称:ocgis,代码行数:9,代码来源:test_operations.py

示例3: test_get_base_request_size_test_data

# 需要导入模块: from ocgis.api.operations import OcgOperations [as 别名]
# 或者: from ocgis.api.operations.OcgOperations import get_base_request_size [as 别名]
 def test_get_base_request_size_test_data(self):
     for key in self.test_data.keys():
         rd = self.test_data.get_rd(key)
         try:
             ops = OcgOperations(dataset=rd)
         ## the project cmip data may raise an exception since projection is
         ## not associated with a variable
         except DimensionNotFound:
             rd = self.test_data.get_rd(key,kwds=dict(dimension_map={'R':'projection','T':'time','X':'longitude','Y':'latitude'}))
             ops = OcgOperations(dataset=rd)
         ret = ops.get_base_request_size()
         self.assertTrue(ret['total'] > 1)
开发者ID:tatarinova,项目名称:ocgis,代码行数:14,代码来源:test_operations.py

示例4: test_get_base_request_size_with_geom

# 需要导入模块: from ocgis.api.operations import OcgOperations [as 别名]
# 或者: from ocgis.api.operations.OcgOperations import get_base_request_size [as 别名]
 def test_get_base_request_size_with_geom(self):
     rd = self.test_data.get_rd('cancm4_tas')
     ops = OcgOperations(dataset=rd, geom='state_boundaries', select_ugid=[23])
     size = ops.get_base_request_size()
     self.assertEqual(size, {'variables': {'tas': {'level': {'kb': 0.0, 'shape': None, 'dtype': None},
                                                   'temporal': {'kb': 28.515625, 'shape': (3650,),
                                                                'dtype': dtype('float64')},
                                                   'value': {'kb': 171.09375, 'shape': (1, 3650, 1, 4, 3),
                                                             'dtype': dtype('float32')},
                                                   'realization': {'kb': 0.0, 'shape': None, 'dtype': None},
                                                   'col': {'kb': 0.0234375, 'shape': (3,),
                                                           'dtype': dtype('float64')},
                                                   'row': {'kb': 0.03125, 'shape': (4,),
                                                           'dtype': dtype('float64')}}}, 'total': 199.6640625})
开发者ID:HydroLogic,项目名称:ocgis,代码行数:16,代码来源:test_operations.py

示例5: test_get_base_request_size

# 需要导入模块: from ocgis.api.operations import OcgOperations [as 别名]
# 或者: from ocgis.api.operations.OcgOperations import get_base_request_size [as 别名]
    def test_get_base_request_size(self):
        rd = self.test_data.get_rd('cancm4_tas')
        ops = OcgOperations(dataset=rd)
        size = ops.get_base_request_size()
        self.assertEqual(size, {'variables': {'tas': {'level': {'kb': 0.0, 'shape': None, 'dtype': None},
                                                      'temporal': {'kb': 28.515625, 'shape': (3650,),
                                                                   'dtype': dtype('float64')},
                                                      'value': {'kb': 116800.0, 'shape': (1, 3650, 1, 64, 128),
                                                                'dtype': dtype('float32')},
                                                      'realization': {'kb': 0.0, 'shape': None, 'dtype': None},
                                                      'col': {'kb': 1.0, 'shape': (128,), 'dtype': dtype('float64')},
                                                      'row': {'kb': 0.5, 'shape': (64,), 'dtype': dtype('float64')}}},
                                'total': 116830.015625})

        with self.assertRaises(DefinitionValidationError):
            OcgOperations(dataset=rd, regrid_destination=rd).get_base_request_size()
开发者ID:HydroLogic,项目名称:ocgis,代码行数:18,代码来源:test_operations.py

示例6: test_get_base_request_size_with_calculation

# 需要导入模块: from ocgis.api.operations import OcgOperations [as 别名]
# 或者: from ocgis.api.operations.OcgOperations import get_base_request_size [as 别名]
 def test_get_base_request_size_with_calculation(self):
     rd = self.test_data.get_rd('cancm4_tas')
     ops = OcgOperations(dataset=rd,calc=[{'func':'mean','name':'mean'}],
                         calc_grouping=['month'])
     size = ops.get_base_request_size()
     self.assertEqual(size['variables']['tas']['temporal']['shape'][0],3650)
开发者ID:tatarinova,项目名称:ocgis,代码行数:8,代码来源:test_operations.py


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