How to label the probe names in gstar

The gstar code was developed to give us a quick way of moving a guide probe on to a suitable star that is specified with a ds9 gui that displays a DSS image of the VIRUS field. In Jan2016 I was asked to draw in all of the probes, and then it became apparent that it is desirable to each probe labeled. In the course of adding this features to gstar, I found a lot of my documentation lacking. This doc is an attempt to rectify that state.

  1. Introduction: The Problem.
  2. Generating the VIRUS information files.
  3. My general approach to VIRUS plotting in ds9.



Introduction: The Problem.

I wanted to draw some text label markers on top of my probe positions painted by gstar. In doing this I was drawn into a number of different scripts that were not documented so well. In my review I re-learned:

  1. The gcpic_draw is used by gstar to gather data and draw the ds9 image.
  2. To overplot the VIRUS stuff (IFU boxes, names, etc...) the gcpic_draw code calls "virus_mark_all".
  3. The virus_mark_all code calls "mark_ifu_boxes". This code must use some file produced upstream, and it uses the basic routines that I will (finally) use to overplot the probe names.
  4. Most of the "upstream" files are created by one of my OTW routines named vir_ifu_pat.sh. To my horror, I found that even as late as Jan2016, there was no scocodes entry for this important routine. I correct that here.
Basically, inside mark_ifu_boxes are an example of the lines of code that I'll use to draw my probe labels:
 
# Label the IFU names
# transform the linesegs file
text_trans.sh vir_ifu_pat.ifu_names $pa $ps $xc $yc >A_names.pix
text_file_ds9.py A_names.pix yellow 12 > ifu_names.reg
cat ifu_names.reg | xpaset ds9 regions -format ds9
I'll explain these pieces of code. The place to start is the first argument of the first line: vir_ifu_pat.ifu_names. This is an ASCII files that gives the position and name of each VIRUS ifu. It is made by the routine "vir_ifu_pat.sh".




Generating the VIRUS information files.

I developed vir_ifu_pat.sh to generate files that give information about the VIRUS IFU units. The idea here was to have one central source for generating VIRUS metrology. As cahnges are made, or new things are learned, only changes to this code should be required.




My general approach to VIRUS plotting in ds9.

Now we begin to disect the snippet of code I showed at the start of this document:

 

# Label the IFU names
# transform the linesegs file
text_trans.sh vir_ifu_pat.ifu_names $pa $ps $xc $yc >A_names.pix
text_file_ds9.py A_names.pix yellow 12 > ifu_names.reg
cat ifu_names.reg | xpaset ds9 regions -format ds9

Basically, in this example I want to generate text for positions that I will scale, shift, and rotate. I use the same approach for pieces of text as I do for circle marker and line segments. I have rather simple ASCII files that specify the marker properties (i.e. some of the files generated above with vir_ifu_pat.sh). I use a set of *_trans codes that perform the coordinate transformations and then I use (mostly python) codes that generate the ds9 region files I'll need to overplot on my image. I describe the coordinate transformation scripts for region files in the *_trans scocodes document. There I give sample runs and examples of input files for each type of region (line segments, closed-boundary region, circles, text). Next, I build the ds9 regions file with the the text_file_ds9.py code and then cat this file to the ds9 window to display the contents.




Back to gstar page