def mark_selection(coords, fwhm): mark = ui.marker(coords, color=ui.GREEN) if math.isnan(fwhm) or math.isinf(fwhm): fwhm = 10.0 radius = abs(fwhm) circle = ui.circle(coords, radius) return [mark, circle]
def handle_exact_location(self, pos): self.undo_previous_selection() overlay = ui.marker(pos.get_position(), color=ui.GREEN) self.undo = [overlay] info("Object selected at (%.1f, %.1f)" % tuple(pos.get_position())) xpos, ypos = pos.get_position() - self.get_offset() return ui.CursorPosition(xpos, ypos, pos.get_frame(), pos.get_keystroke())
def draw_slit(midpoint, width): # mark the center mark = ui.marker(midpoint, color=ui.MAGENTA) # display a box box = get_predicted_slit(midpoint, width) line = ui.polyline(points=box, color=ui.MAGENTA) return [mark, line]
def handle_exact_star(self, point): self.undo_midway_through_exact_acquisition_box() self.undo_box_discard() self.undo_previous_star_selection() self.star_selection = MosaicTileExactSelection(point, self.mosaic_box) overlay = ui.marker(self.star_selection.get_mosaic_center(), color=ui.GREEN) self.star_selection_overlay = [overlay]
def draw_box(self): points = self.get_mosaic_predicted_borders() border = ui.polyline(points=points, color=ui.MAGENTA) point = self.get_mosaic_center() debug("...drawing box with center at %r" % point) center = ui.marker(point, color=ui.MAGENTA) self.box_overlay = [border, center]
def handle_exact_location(self, pos): self.maybe_undo() coords = pos.get_position() if self.left_side is None: self.left_side = coords mark = ui.marker(coords, color=ui.MAGENTA) self.overlays = [mark] else: midpoint = (self.left_side + coords) / 2.0 slit = draw_slit(midpoint, self.slitimage_ad.get_mask_width_in_pixels()) self.slit_measurement = ManualSlitMeasurement(midpoint) self.overlays = slit
def handle_exact_box(self, point): self.undo_box_discard() self.undo_previous_star_selection() self.undo_previous_box() if getattr(self, "first_corner", None) is None: overlay = ui.marker(point, color=ui.MAGENTA) self.first_corner = point - self.mosaic_box.get_mosaic_offset() self.box_overlay = [overlay] else: self.acq_box = MosaicTileExactBox(self.first_corner, point - self.mosaic_box.get_mosaic_offset()) self.first_corner = None self.draw_box() self.automatically_detect_star_in_box()
def __init__(self, acqimage, verbose, mark_center=None, pixel_buffer=None, circle_radius=None, offset=np.array((0.0, 0.0))): self.acqimage = acqimage self.verbose = verbose self.pixel_buffer = pixel_buffer self.circle_radius = circle_radius self.offset = offset self.undo = [] self.custom_center = None self.object_position = None if mark_center is not None: nx, ny = mark_center debug("...marked center nx=", nx, " ny=", ny) self.marked_center = ui.marker(mark_center, ui.MAGENTA)
def handle_exact_location(self, pos): self.undo_previous_selection() overlay = ui.marker(pos.get_position(), color=ui.GREEN) self.undo = [overlay] self.fiber = pos.get_position()
def handle_custom_center(self, pos): self.undo_marked_center() self.marked_center = ui.marker(pos.get_position(), color=ui.MAGENTA)