astropyQTable中的不确定性如何处理?
创始人
2024-09-20 22:00:59
0

在 astropy 中,可以使用 uncertainties 包将不确定性量化为不确定性量和值。在 QTable 中,可以使用 Column 的 meta 属性来标识每个 Column 的不确定性。

示例:

import numpy as np
from astropy.table import QTable, Column
from astropy import units as u
from astropy import uncertainty as unc

# 构造数据
data = {
    'name': ['source1', 'source2', 'source3'],
    'flux': [0.5, 1.2, 2.0] * u.Jy,
    'flux_err': [0.1, 0.2, 0.3] * u.Jy,
    }

# 将值和不确定性量化
flux_col = unc.Quantity(data['flux'])
flux_err_col = unc.Quantity(data['flux_err'])

# 创建 QTable
table = QTable()
table['name'] = Column(data['name'], description='source name')
table['flux'] = Column(flux_col.nominal_values, description='flux', unit='Jy')
table['flux'].meta['uncertainty'] = flux_err_col

在这个示例中,使用 uncertainties 包将 flux 和 flux_err 数组转换为量化值,然后使用 QTable 中的 Column 来表示 flux 和 flux_err。通过设置 meta 属性,将不确定性信息与 flux 关联。

相关内容

热门资讯

透视好友房!aapoker怎么... 透视好友房!aapoker怎么拿好牌(透视)果然是有辅助下载(存在有挂)-哔哩哔哩1、实时aapok...
据玩家消息!红龙poker辅助... 据玩家消息!红龙poker辅助工具(透视)好像是有辅助软件(证实有挂)-哔哩哔哩1、实时红龙poke...
透视最新!xpoker辅助工具... 透视最新!xpoker辅助工具(透视)本来有辅助神器(有挂辅助)-哔哩哔哩1、起透看视 xpoker...
透视游戏!wepoker钻石怎... 透视游戏!wepoker钻石怎么看底牌(透视)果然有辅助平台(有挂工具)-哔哩哔哩wepoker钻石...
透视挂!wepoker透视脚本... 透视挂!wepoker透视脚本免费下载(透视)本来有辅助软件(有挂实锤)-哔哩哔哩1)wepoker...
据目击者称!wejoker透视... 据目击者称!wejoker透视方法(透视)果然是真的辅助工具(了解有挂)-哔哩哔哩1、许多玩家不知道...
透视系统!hhpoker免费辅... 透视系统!hhpoker免费辅助器(透视)原来是真的辅助插件(有挂实锤)-哔哩哔哩1.hhpoker...
透视教学!we poker游戏... 透视教学!we poker游戏下(透视)切实有辅助修改器(有挂教程)-哔哩哔哩1、让任何用户在无需w...
透视好牌!拱趴游戏破解器(透视... 透视好牌!拱趴游戏破解器(透视)切实是真的辅助插件(竟然有挂)-哔哩哔哩1)拱趴游戏破解器辅助插件:...
近年来!wepoker正确养号... 近年来!wepoker正确养号方法(透视)好像是真的辅助app(有挂详细)-哔哩哔哩1、每一步都需要...