Exemple #1
0
    def get_equivalent_widths(self, sub_window):
        # Get ROI stats
        stat_list = []
        x_rois = []
        for roi in sub_window.graph.rois[-2:]:
            if roi is None:
                continue

            x_range, y_range = sub_window.graph._get_roi_coords(roi)
            active_item = sub_window.graph.active_item
            active_data = active_item.item

            region = extract(active_data, x_range)
            stat_list.append(stats(region))
            x_rois.append(x_range)

        # Determine feature bounds
        if x_rois[0][1] < x_rois[1][0]:
            feature_roi = (x_rois[0][1], x_rois[1][0])
        else:
            feature_roi = (x_rois[1][1], x_rois[0][0])

        # Get the equivalent width
        self._results = eq_width(stat_list[0], stat_list[1], extract(active_data, feature_roi))
        print 'Equivelent width = {}'.format(self._results)
Exemple #2
0
    def get_equivalent_widths(self, sub_window):
        # Get ROI stats
        stat_list = []
        x_rois = []
        for roi in sub_window.graph.rois[-2:]:
            if roi is None:
                continue

            x_range, y_range = sub_window.graph._get_roi_coords(roi)
            active_item = sub_window.graph.active_item
            active_data = active_item.item

            region = extract(active_data, x_range)
            stat_list.append(stats(region))
            x_rois.append(x_range)

        # Determine feature bounds
        if x_rois[0][1] < x_rois[1][0]:
            feature_roi = (x_rois[0][1], x_rois[1][0])
        else:
            feature_roi = (x_rois[1][1], x_rois[0][0])

        # Get the equivalent width
        self._results = eq_width(stat_list[0], stat_list[1],
                                 extract(active_data, feature_roi))
        print 'Equivelent width = {}'.format(self._results)
Exemple #3
0
    def get_equivalent_widths(self, sub_window):
        active_item = sub_window.graph.active_item
        active_data = active_item.item

        # Get ROI stats
        stat_list = []
        x_rois = []
        for roi in sub_window.graph.rois[-2:]:
            if roi is None:
                continue

            x_range, y_range = sub_window.graph._get_roi_coords(roi)

            region = extract(active_data, x_range)
            stat_list.append(stats(region))
            x_rois.append(x_range)

        # Determine feature bounds
        if x_rois[0][1] < x_rois[1][0]:
            feature_roi = (x_rois[0][1], x_rois[1][0])
        else:
            feature_roi = (x_rois[1][1], x_rois[0][0])

        # Get the equivalent width
        result = self.ops.eq_width(stat_list[0],
                                   stat_list[1],
                                   extract(active_data, feature_roi))

        # Report
        self.viewer.equiv_width_dock.set_labels(result,
                                                stat_list[0],
                                                stat_list[1],
                                                data_name=active_item.parent.text(),
                                                layer_name=active_item.text())
        self.viewer.equiv_width_dock.show()
Exemple #4
0
    def get_measurements(self, sub_window):
        roi = sub_window.graph._active_roi

        if roi is None:
            return

        x_range, y_range = sub_window.graph._get_roi_coords(roi)
        active_item = sub_window.graph.active_item
        active_data = active_item.item

        region = extract(active_data, x_range)
        stat = stats(region)

        self.viewer.measurement_dock.set_labels(stat,
                                         data_name=active_item.parent.text(),
                                         layer_name=active_item.text())
        self.viewer.measurement_dock.show()
Exemple #5
0
    def get_measurements(self, sub_window):
        roi = sub_window.graph._active_roi

        if roi is None:
            return

        x_range, y_range = sub_window.graph._get_roi_coords(roi)
        active_item = sub_window.graph.active_item
        active_data = active_item.item

        region = extract(active_data, x_range)
        stat = stats(region)

        self.viewer.measurement_dock.set_labels(
            stat,
            data_name=active_item.parent.text(),
            layer_name=active_item.text())
        self.viewer.measurement_dock.show()
        self._results = stat