Display Classes
azcam.server.tools.display.Display
Bases: Tools
, ObjectHeaderMethods
The base display tool for server and consoles. Usually implemented as the "display" tool.
display(image, extension_number=-1)
Display a file on the image display. If specified for an MEF file, only extension_number is displayed.
:param image: a filename or an image object :param int extension_number: FITS extension number of image, -1 for all :return None:
initialize()
Initialize display.
set_display(display_number)
Set the current display by number.
:param int display_number: Number for display to be used (0->N) :return None:
azcam.server.tools.ds9display.Ds9Display
Bases: Display
Azcam's interface to SAO's ds9 image display tool.
delete_all_rois()
Delete all ROIs.
:return None:
display(image, extension_number=-1)
Display a file in ds9, making a copy so locking does not occur. If specified for an MEF file, only extension_number is displayed.
:param image: a filename or an image object :param int extension_number: FITS extension number of image, -1 for all :return None:
draw_box(xy, size=[51, 51], angle=0)
Draw a box on the display.
:param list xy: [x,y] coords of box to be drawn in image coordinates :param list size: [xwidth,ywidth] of box :param float angle: Angle of box. :return None:
exam(box_size=20, loop=1)
Interactive: Get info around blinking cursor position. print() is allowed here as interactive only.
:param int box_size: Size of examine box :param bool Loop: True for keep looping until q pressed :return list: [KeyPressed,X,Y] or [] in case or error. KeyPressed is a character.
find_displays()
Returns a list of ds9 servers. The returned list is like: ['a00009c:50064', 'a00009c:59734'], which is host:port. If not servers are found, the returned list is empty.
:return list: Display info from XPA
get_box()
Get position of the first box in image coords.
:return None:
get_data(roi_number=0)
Returns [Status,[pixel1,pixel2,...]] in display ROI.
:param int roi_number: Number of ROI to get data :return list: [status,[pixel1,pixel2,...]] for ROI
get_last_point(coordinate_mode='physical')
Returns coordinates of the last point selected.
:param str coordinate_mode: Coorinate mode, wcs or pysical :return list: Coords of point as [x,y] or [] if none
get_number_rois()
Returns the number of defined ROI's.
:return int: Number of ROI's specified by ds9
get_regions(coordinate_type='image')
Returns a list of regions, each a list of [shape,coords...].
:param str coordinate_type: Type of coords as defined by the display server ['image','detector', 'amplifier'] :param list: List of ROI info in ds9 format
get_roi_string(roi_number=0, coordinate_type='')
Get an ROI descriptor formatted as a string with integer values.
:param int roi_number: roi_number to return :param str coordinate_type:
:return list: List of ROIs
get_rois(roi_number=-1, coordinate_type='default')
Returns the Region Of Interest from the display tool and sets the internal ROI descriptors to the values read. If roi_number is not specified then a list of all defined ROI's is returned.
:param int roi_number: roi number to be returned :param str CoorinateType: Type of coords as defined by the display server ['image','detector', 'amplifier'] :return list: The list of ROIs
get_stats(roi_number=-1)
Returns statistics [status,mean,sdev] of an ROI Also sets display.mean and display.sdev global variables.
:param int roi_number: Number of ROI to get status :return list: [status,mean,sdev] for ROI
initialize()
Initialize Ds9.
:return None:
read_rois()
Read and internally save image, detector, and amplifier all Rois.
:return None:
reset()
Reset the tool.
save_fits(filename='display.fits')
Save displayed image as a FITS file.
:param str filename: filename of image to be saved. :return None:
save_image(filename='display.png')
Save displayed image as a PNG snapshot.
:param str filename: filename of image to be saved. :return None:
set_cursor_mode(mode='point', clear_rois=0)
Set the display cursor mode.
:param str mode: Cursor mode ("point", "crosshair") :param bool clear_rois: True to clear all ROIs
set_display(display_number=-1)
Set the current ds9 display by number.
:param int display_number: Number for display to be used (0->N) :return None:
show_stats(roi_number=0)
Interactive: Print stats from an ROI in a real-time loop until q is pressed. print() is allowed here as interactive only.
:param int roi_number: Number of ROI to get status :return list: [status,mean,sdev] for ROI
start(flag=0)
Starts a display process.
xpaget(command)
Issue xpaget command for ds9. Returns data as a list of space deliminated items.
:param str command: command string for xpaget command :return: Return value
xpaset(command)
Issue xpaset command for ds9.
:param str command: command string for xpaset command
zoom(scale=0)
Set display zoom factor relative to current zoom.
:param int Scale: Scale factor for zoom, 0 "to fit" :return None: