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


Python DataCollection.merge方法代码示例

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


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

示例1: astropy_tabular_data

# 需要导入模块: from glue.core import DataCollection [as 别名]
# 或者: from glue.core.DataCollection import merge [as 别名]
catalog = astropy_tabular_data(apath('fitted_line_parameters_Chi2Constraints.ipac'),
                               format='ascii.ipac')
catalog.label='FittedLineParameters'
catalog.style.color = 'green'
catalog.style.marker = 'o'
cube = load_data(hpath('APEX_H2CO_303_202_bl.fits'))
cube.label='H2CO 303/202'
cube2 = load_data(molpath('APEX_SiO_54.fits'))
cube2.label='SiO'
cube3 = load_data(hpath('APEX_13CO_matched_H2CO.fits'))
cube3.label='13CO'
higaltem = load_data('/Users/adam/work/gc/gcmosaic_temp_conv36.fits')

dc = DataCollection([cube, catalog, cube2, cube3, higaltem])
dc.merge(cube,cube2,cube3)

dc.add_link(LinkSame(cube.id['Galactic Longitude'], catalog.id['GLON']))
dc.add_link(LinkSame(cube.id['Galactic Latitude'], catalog.id['GLAT']))

def ms_to_kms(x): return x/1e3
def kms_to_ms(x): return x*1e3

dc.add_link(LinkTwoWay(cube.id['Vrad'], catalog.id['center'], ms_to_kms, kms_to_ms))

subset_tem_lt_60 = (catalog.id['temperature_chi2'] < 60) & (catalog.id['temperature_chi2'] > 10) & (catalog.id['area'] < 0.015)

subset_tem_gt_60 = (catalog.id['temperature_chi2'] > 60) & (catalog.id['area'] < 0.015)

app = GlueApplication(dc)
开发者ID:bsipocz,项目名称:APEX_CMZ_H2CO,代码行数:31,代码来源:glue_cat.py

示例2: load_data

# 需要导入模块: from glue.core import DataCollection [as 别名]
# 或者: from glue.core.DataCollection import merge [as 别名]
dendcube.label='Dendrogram Cube' # this label is redundant, it will be deleted upon merge
# cube contains real WCS information; dendcube does not
h2cocube = load_data(hpath('APEX_H2CO_303_202_bl.fits'))
h2cocube.label='H2CO 303202 Cube'
catalog = astropy_tabular_data(hpath('PPV_H2CO_Temperature.ipac'), format='ipac')
catalog.label='Fitted Catalog'


h2cocube.add_component(dendcube.get_component('structure'), 'structure')

dc = DataCollection(dendrogram)
dc.append(h2cocube)
dc.append(catalog)
dc.append(dendcube)

dc.merge(h2cocube,dendcube)
dc.merge(dendro, catalog)

app = GlueApplication(dc)

cube_viewer = app.new_data_viewer(ImageWidget)
cube_viewer.add_data(h2cocube)

h2cocube.join_on_key(dendro, 'structure', dendro.pixel_component_ids[0])

scatter = app.new_data_viewer(ScatterWidget)
scatter.add_data(dendro)
scatter.yatt = dendro.id['temperature_chi2']
scatter.xatt = catalog.id['r321303']

dendview = app.new_data_viewer(DendroWidget)
开发者ID:bsipocz,项目名称:APEX_CMZ_H2CO,代码行数:33,代码来源:dendro_glue.py


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