本文整理汇总了Python中coverage_model.parameter.ParameterContext.long_name方法的典型用法代码示例。如果您正苦于以下问题:Python ParameterContext.long_name方法的具体用法?Python ParameterContext.long_name怎么用?Python ParameterContext.long_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类coverage_model.parameter.ParameterContext
的用法示例。
在下文中一共展示了ParameterContext.long_name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _make_coverage
# 需要导入模块: from coverage_model.parameter import ParameterContext [as 别名]
# 或者: from coverage_model.parameter.ParameterContext import long_name [as 别名]
def _make_coverage(path):
tcrs = CRS([AxisTypeEnum.TIME])
scrs = CRS([AxisTypeEnum.LON, AxisTypeEnum.LAT, AxisTypeEnum.HEIGHT])
tdom = GridDomain(GridShape('temporal', [0]), tcrs, MutabilityEnum.EXTENSIBLE)
sdom = GridDomain(GridShape('spatial', [0]), scrs, MutabilityEnum.IMMUTABLE) # Dimensionality is excluded for now
pdict = ParameterDictionary()
t_ctxt = ParameterContext('time', param_type=QuantityType(value_encoding=np.int64))
t_ctxt.axis = AxisTypeEnum.TIME
t_ctxt.uom = 'seconds since 1970-01-01'
t_ctxt.fill_value = 0x0
pdict.add_context(t_ctxt)
lat_ctxt = ParameterContext('lat', param_type=QuantityType(value_encoding=np.float32))
lat_ctxt.axis = AxisTypeEnum.LAT
lat_ctxt.uom = 'degree_north'
lat_ctxt.fill_value = 0e0
pdict.add_context(lat_ctxt)
lon_ctxt = ParameterContext('lon', param_type=QuantityType(value_encoding=np.float32))
lon_ctxt.axis = AxisTypeEnum.LON
lon_ctxt.uom = 'degree_east'
lon_ctxt.fill_value = 0e0
pdict.add_context(lon_ctxt)
cat = {0:'lemon',1:'apple',2:'banana',99:'None'}
cat_ctxt = ParameterContext('category', param_type=CategoryType(categories=cat))
cat_ctxt.long_name = "example of category"
pdict.add_context(cat_ctxt)
dens_ctxt = ParameterContext('quantity', param_type=QuantityType(value_encoding=np.float32))
dens_ctxt.uom = 'unknown'
dens_ctxt.fill_value = 0x0
pdict.add_context(dens_ctxt)
const_ctxt = ParameterContext('constant', param_type=ConstantType())
const_ctxt.long_name = 'example of a parameter of type ConstantType'
pdict.add_context(const_ctxt)
rec_ctxt = ParameterContext('boolean', param_type=BooleanType())
rec_ctxt.long_name = 'example of a parameter of type BooleanType'
pdict.add_context(rec_ctxt)
rec_ctxt = ParameterContext('range', param_type=ConstantRangeType())
rec_ctxt.long_name = 'Range example'
rec_ctxt.fill_value = 0x0
pdict.add_context(rec_ctxt)
rec_ctxt = ParameterContext('record', param_type=RecordType())
rec_ctxt.long_name = 'example of a parameter of type RecordType, will be filled with dictionaries'
rec_ctxt.fill_value = 0x0
pdict.add_context(rec_ctxt)
serial_ctxt = ParameterContext('array', param_type=ArrayType())
serial_ctxt.uom = 'unknown'
serial_ctxt.fill_value = 0x0
pdict.add_context(serial_ctxt)
guid = create_guid()
guid = guid.replace("-", "")
cov = SimplexCoverage(path, guid, name="sample_cov", parameter_dictionary=pdict, temporal_domain=tdom, spatial_domain=sdom)
return (cov,path+os.sep+guid)