Inside each mViewer instance is a "view" object (type mvView) which has no methods (other than the standard __str__ and __repr__ for casting the contents into text representations) but which contains all the information defining how the display should be rendered. Once you have created an mViewer object (e.g. as variable "viewer") the view object can be referenced as "viewer.view". Calling "print viewer.view" will print the contents of the structure, as shown below for the full color example.
current_color: '000080' current_coord_sys: 'Equ J2000' current_symbol_size: 12.0 current_symbol_type: 'circle' display_mode: 'color' blue_file: fits_file: 'SDSS_u.fits' stretch_max: 'max' stretch_min: '0.1s' stretch_mode: 'gaussian-log' green_file: fits_file: 'SDSS_g.fits' stretch_max: 'max' stretch_min: '0.1s' stretch_mode: 'gaussian-log' red_file: fits_file: 'SDSS_r.fits' stretch_max: 'max' stretch_min: '0.1s' stretch_mode: 'gaussian-log' image_width: 1801 image_height: 1801 xmin: 0 xmax: 1801 ymin: 0 ymax: 1801 canvas_width: 1000 canvas_height: 1000 factor: 1.801 image_file: 'viewer.jpg' image_type: 'jpg' overlay: color: '8080ff' coord_sys: 'Equ J2000' type: 'grid' visible: True overlay: color: '90ff90' coord_sys: 'Equ J2000' data_file: 'mipssed.tbl' type: 'imginfo' visible: True overlay: color: 'ff9090' coord_sys: 'Equ J2000' data_file: 'irspeakup.tbl' type: 'imginfo' visible: True overlay: color: 'ffff00' coord_sys: 'Equ J2000' data_col: 'j_m' data_file: 'fp_psc.tbl' data_ref: 16 data_type: 'mag' sym_size: 1.0 sym_type: 'circle' type: 'catalog' visible: True overlay: color: 'ffffff' coord_sys: 'Equ J2000' lat: 47.26614 lon: 202.47083 text: 'Messier 051b' type: 'label' visible: True overlay: color: '000080' coord_sys: 'Equ J2000' lat: 47.26614 lon: 202.49829 sym_size: 8.0 sym_type: 'circle' type: 'mark' visible: True overlay: color: 'ffffff' coord_sys: 'Equ J2000' lat: 47.21667 lon: 202.41667 text: 'Messier 051a' type: 'label' visible: True overlay: color: '000080' coord_sys: 'Equ J2000' lat: 47.19517 lon: 202.46963 sym_size: 12.0 sym_type: 'circle' type: 'mark' visible: True
Default printing is alphabetical; we've rearrange the above for clarity, removed some empty (unused) elements, and added newlines.
The overlays (and the view object itself) can be assigned to variables and managed like any other data. The utility functions used in our examples all return such pointers. For example, you can say "mygrid = addGrid('galactic')" when you create the overlay and then later "mygrid.visible = False" to hide it. We have opted for not having an extra utility function for controling visibility; use direct attribute manipulation for that.
You can create your own overlays (and views) from scratch and configure them:
ovly = mvViewOverlay() ovly.type = "grid" ovly.color = "ffff00" ovly.coord_sys = coord_sys ovly.visible = True viewer.view.overlay.append(ovly)
So your application could have a collection of views, overlays and even mViewer instances (multiple displays) and manage the mixing and matching in whatever way it sees fit.