本文整理汇总了Python中nansat.Nansat.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Nansat.__init__方法的具体用法?Python Nansat.__init__怎么用?Python Nansat.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nansat.Nansat
的用法示例。
在下文中一共展示了Nansat.__init__方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from nansat import Nansat [as 别名]
# 或者: from nansat.Nansat import __init__ [as 别名]
def __init__(self, fileName, logLevel=30, cloudBits=None, debug=False, GCP_COUNT=10):
'''
Check if image is small or taken at night, add mask
'''
RasterYSize, RasterXSize, day_night_flag, mapperName = self.get_size_day_mapper(fileName)
isday = day_night_flag == 'Day'
isbig = (RasterXSize > 200) * (RasterYSize > 200)
if not isday:
print 'Night image'
time.sleep(0.5)
raise Exception('Night image!')
if not isbig:
print 'Too little image!'
time.sleep(0.5)
raise Exception('Too little image!')
Nansat.__init__(self, fileName, logLevel=logLevel, mapperName=mapperName, GCP_COUNT=GCP_COUNT)
# good bits for amazon plume studying
if cloudBits is None:
#cloudBits=[4, 5, 6, 10, 15, 20, 23, 30]
# good bits for NRT
cloudBits = [1, 6, 10, 16, 29]
#cloudBits=[1, 4, 5, 6, 9, 10, 13, 15, 20, 21, 23, 28, 29, 30]
# yellow sea:
#cloudBits = [1, 4, 5, 6, 9, 10, 15, 20, 29]
#cloudBits=[1, 4, 5, 6, 9, 10, 15, 20, 21, 29]
# for china
#cloudBits=[1, 5, 6, 9, 10, 13, 15, 20, 23, 28, 29, 30]
self.add_mask(cloudBits, debug=debug)
# replace cdom_index and sst with cdom_a and SST
self.rename_band('cdom_index', 'cdom_a')
self.rename_band('sst', 'SST')