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


Python RectangularROI.update_limits方法代码示例

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


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

示例1: test_spectrum

# 需要导入模块: from glue.core.roi import RectangularROI [as 别名]
# 或者: from glue.core.roi.RectangularROI import update_limits [as 别名]
    def test_spectrum(self):
        roi = RectangularROI()
        roi.update_limits(0, 0, 3, 3)

        expected = self.x[:, :3, :3].mean(axis=1).mean(axis=1)
        _, actual = Extractor.spectrum(self.data, self.data.id["x"], roi, (0, "x", "y"), 0)
        np.testing.assert_array_almost_equal(expected, actual)
开发者ID:rguter,项目名称:glue,代码行数:9,代码来源:test_spectrum_tool.py

示例2: test_collapse

# 需要导入模块: from glue.core.roi import RectangularROI [as 别名]
# 或者: from glue.core.roi.RectangularROI import update_limits [as 别名]
    def test_collapse(self, tmpdir):

        roi = RectangularROI()
        roi.update_limits(0, 2, 0, 2)
        self.tool._update_profile()

        self._save(tmpdir)
开发者ID:antonl,项目名称:glue,代码行数:9,代码来源:test_spectrum_tool.py

示例3: test_apply_roi

# 需要导入模块: from glue.core.roi import RectangularROI [as 别名]
# 或者: from glue.core.roi.RectangularROI import update_limits [as 别名]
 def test_apply_roi(self):
     data = self.add_data_and_attributes()
     roi = RectangularROI()
     roi.update_limits(*self.roi_limits)
     x, y = self.roi_points
     self.client.apply_roi(roi)
     assert self.layer_data_correct(data.edit_subset, x, y)
开发者ID:antonl,项目名称:glue,代码行数:9,代码来源:test_scatter_client.py

示例4: test_spectrum

# 需要导入模块: from glue.core.roi import RectangularROI [as 别名]
# 或者: from glue.core.roi.RectangularROI import update_limits [as 别名]
    def test_spectrum(self):
        roi = RectangularROI()
        roi.update_limits(0.5, 1.5, 2.5, 2.5)

        expected = self.x[:, 1:3, 2:3].mean(axis=1).mean(axis=1)
        _, actual = Extractor.spectrum(
            self.data, self.data.id['x'], roi, (0, 'x', 'y'), 0)
        np.testing.assert_array_almost_equal(expected, actual)
开发者ID:stscieisenhamer,项目名称:glue,代码行数:10,代码来源:test_spectrum_tool.py

示例5: test_apply_roi_results

# 需要导入模块: from glue.core.roi import RectangularROI [as 别名]
# 或者: from glue.core.roi.RectangularROI import update_limits [as 别名]
 def test_apply_roi_results(self, roi_limits, mask):
     # Regression test for glue-viz/glue#718
     data = self.add_data_and_attributes()
     roi = RectangularROI()
     roi.update_limits(*roi_limits)
     x, y = self.roi_points
     self.client.apply_roi(roi)
     np.testing.assert_equal(data.edit_subset.to_mask(), mask)
开发者ID:antonl,项目名称:glue,代码行数:10,代码来源:test_scatter_client.py

示例6: test_apply_roi_adds_on_empty

# 需要导入模块: from glue.core.roi import RectangularROI [as 别名]
# 或者: from glue.core.roi.RectangularROI import update_limits [as 别名]
 def test_apply_roi_adds_on_empty(self):
     data = self.add_data_and_attributes()
     data._subsets = []
     data.edit_subset = None
     roi = RectangularROI()
     roi.update_limits(*self.roi_limits)
     x, y = self.roi_points
     self.client.apply_roi(roi)
     assert data.edit_subset is not None
开发者ID:antonl,项目名称:glue,代码行数:11,代码来源:test_scatter_client.py

示例7: test_extract

# 需要导入模块: from glue.core.roi import RectangularROI [as 别名]
# 或者: from glue.core.roi.RectangularROI import update_limits [as 别名]
    def test_extract(self):

        roi = RectangularROI()
        roi.update_limits(0, 0, 2, 3)

        expected = self.data['x'][:, :2, :3, 1].mean(axis=1).mean(axis=1)
        _, actual = Extractor.spectrum(self.data, self.data.id['x'],
                                       roi, (0, 'x', 'y', 1), 0)

        np.testing.assert_array_equal(expected, actual)
开发者ID:antonl,项目名称:glue,代码行数:12,代码来源:test_spectrum_tool.py

示例8: test_visibility_sticky

# 需要导入模块: from glue.core.roi import RectangularROI [as 别名]
# 或者: from glue.core.roi.RectangularROI import update_limits [as 别名]
 def test_visibility_sticky(self):
     data = self.add_data_and_attributes()
     roi = RectangularROI()
     roi.update_limits(*self.roi_limits)
     assert self.client.is_visible(data.edit_subset)
     self.client.apply_roi(roi)
     self.client.set_visible(data.edit_subset, False)
     assert not self.client.is_visible(data.edit_subset)
     self.client.apply_roi(roi)
     assert not self.client.is_visible(data.edit_subset)
开发者ID:antonl,项目名称:glue,代码行数:12,代码来源:test_scatter_client.py

示例9: test_apply_roi_doesnt_add_if_any_selection

# 需要导入模块: from glue.core.roi import RectangularROI [as 别名]
# 或者: from glue.core.roi.RectangularROI import update_limits [as 别名]
 def test_apply_roi_doesnt_add_if_any_selection(self):
     d1 = self.add_data_and_attributes()
     d2 = self.add_data()
     d1.edit_subset = None
     d2.edit_subset = d2.new_subset()
     ct = len(d1.subsets)
     roi = RectangularROI()
     roi.update_limits(*self.roi_limits)
     x, y = self.roi_points
     self.client.apply_roi(roi)
     assert len(d1.subsets) == ct
开发者ID:antonl,项目名称:glue,代码行数:13,代码来源:test_scatter_client.py

示例10: test_apply_roi_applies_to_all_editable_subsets

# 需要导入模块: from glue.core.roi import RectangularROI [as 别名]
# 或者: from glue.core.roi.RectangularROI import update_limits [as 别名]
 def test_apply_roi_applies_to_all_editable_subsets(self):
     d1 = self.add_data_and_attributes()
     d2 = self.add_data()
     state1 = d1.edit_subset.subset_state
     state2 = d2.edit_subset.subset_state
     roi = RectangularROI()
     roi.update_limits(*self.roi_limits)
     x, y = self.roi_points
     self.client.apply_roi(roi)
     assert d1.edit_subset.subset_state is not state1
     assert d1.edit_subset.subset_state is not state2
开发者ID:antonl,项目名称:glue,代码行数:13,代码来源:test_scatter_client.py

示例11: test_4d_single_channel

# 需要导入模块: from glue.core.roi import RectangularROI [as 别名]
# 或者: from glue.core.roi.RectangularROI import update_limits [as 别名]
def test_4d_single_channel():

    x = np.random.random((1, 7, 5, 9))
    d = Data(x=x)
    slc = (0, 0, 'x', 'y')
    zaxis = 1
    expected = x[0, :, :, :].mean(axis=1).mean(axis=1)
    roi = RectangularROI()
    roi.update_limits(0, 0, 10, 10)

    _, actual = Extractor.spectrum(d, d.id['x'], roi, slc, zaxis)

    np.testing.assert_array_almost_equal(expected, actual)
开发者ID:antonl,项目名称:glue,代码行数:15,代码来源:test_spectrum_tool.py

示例12: test_collapse

# 需要导入模块: from glue.core.roi import RectangularROI [as 别名]
# 或者: from glue.core.roi.RectangularROI import update_limits [as 别名]
    def test_collapse(self, tmpdir):

        roi = RectangularROI()
        roi.update_limits(0, 2, 0, 2)
        self.tool._update_profile()

        self._save(tmpdir)

        # For some reason we need to close and dereference the image and tool
        # here (and not in teardown_method) otherwise we are left with
        # references to the image viewer.
        self.image.close()
        self.image = None
        self.tool.close()
        self.tool = None
开发者ID:stscieisenhamer,项目名称:glue,代码行数:17,代码来源:test_spectrum_tool.py

示例13: build_spectrum

# 需要导入模块: from glue.core.roi import RectangularROI [as 别名]
# 或者: from glue.core.roi.RectangularROI import update_limits [as 别名]
 def build_spectrum(self):
     roi = RectangularROI()
     roi.update_limits(0, 2, 0, 2)
     self.tool._update_profile()
开发者ID:antonl,项目名称:glue,代码行数:6,代码来源:test_spectrum_tool.py


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