TRES Observing Notes

Created 07/08/09 by TG
Updated 04/29/16 by EF

Perry Berlind (Jan 2008)

There are 9 fibers that exit the front end and go to the spectrograph,
3 each of small (1.4"), M (2.3"), and L (3.2").  For each set, there
is a sky fiber, an object fiber, and a calibration fiber.

The calibration fiber can be illuminated during a science exposure
(continuous th-ar exposure) so that you have a simultaneous th-ar and
target exposure.  On the ccd, the calibration fiber data (th-ar lines)
are effectively overlayed onto the sky fiber orders.  (the spacing of
the fibers changes across the ccd, at the blue end (top) the fibers
are widely spaced and all 3 fibers are not overlapping, down at the
red end the cal fiber is on top of the sky fiber) The command f_total
will flash on the th-ar lamp during the science exposure,
automatically turning on the th-ar lamp for 300-sec during the
exposure, centered on the exposure time. c_cex will take a calibration
fiber comparison exposure.  For normal sky/object data, use cexv and
total commands.

To take cal fiber calibration data: peri out (sky), shutter open (shuton).  

To take object/sky calibration data: peri in (comp), shutter open (shuton).  

To take object/sky science data: peri out (sky), shutter closed (shutoff)  
(to flash in th-ar through the cal fiber, th-ar on, shutter open).

Scripts to take the afternoon calibration data:  There is
a script for each of the 3 primary observing modes.  The scripts do
not take bias frames, so take those manually for now ("bias 5" for
each binning mode).  The scripts are in /home/observer/scripts/
Source filename to run. 

dotresmedium2  medium fiber, binby2  (tested ok)
dotressmall2   small fiber, binby2   (tested ok)
dotressmall1   small fiber, binby1   (not tested!, may need to modify sleeps)

Using the TRES guider:

Setting up on a target and guide star is a multiple step process.  The
general steps are to first mark the fiber position, then a course
centering of your target, selection of a guide star, and then fine
centering of the target.

To use the guider: Vncviewer into tres-guider:2.  The ds9 window will
be launched automatically, and will also automatically re-appear if it

Currently there are 5 scripts to run for guiding setup (./01, ./02,
etc).  These scripts take arguments for fiber selection, guiding and
setup integration times, and chopping interval.  The scripts display
help notes as they are run.  It is possible to guide on either a field
guide star or your target if there is no other guide star.  If you
guide on your target, the tip-tilt mirror will chop the star out of
the fiber at a set interval to check the guiding position.  As the
tip-tilt mirror nears the end of it's travel, you will need to use the
telescope handpaddle to move the star back to the center position.
Scripts are located here:  tres@tres-guider:~/TIP_TILT/GUIDE_LOOP/ 

./ 1              (mark the fiber position)
./ 0.1    (coarse center your target star)
./ 0.5 S    (fine center target)
./ 0.1 S  (select your guide star)
./ 0.1 S 4 (start guiding, guiding on target itself)
./ 0.5 S .5        (start guiding, including repeat of fine setup)
./ 0.5 S        (old guider code, do not use)

For self guiding, tiptilt limits are 25% and 75%.  For normal guiding,
tiptilt limits are 5% and 95%.  Edit the .offset file to tweak guide
star position, but this should not be necessary with the latest guide
code.  The tip-tilt mirror is re-homed every time that you start
guiding.  To force a rehome of the tip-tilt mirror, use the command:
sudo ~/bin/run_tiptilt b400 0 12 1 12 (NOTE: for superusers only!)

To re-home the tip-tilt mirror

Misc Notes:
The integrating sphere has it's own shutter, "shuton" and "shutoff" to control.

Rotate your data files 270 to put blue at the top left.  View
/tdata/tres/2007.0926/.0099_guide.fits or .dat to inspect old guide info

Mg B triplet is at ~1000, 1600
Gabor's favorite th-ar doublet is at ~1800, 550

To focus the guide camera on the fiber:  "./serial &"
tres-guider/STEPPERS/./serial & pops up little controller window.
"absmove=407" to set guide camera focus, default.  Try 406 or 408.

The ccd controller is run on tres-bench.  If the ccd is hung:

use the
restart command: xterm -e ssh -l restart

Type "alias" in telshell to see avalable aliases.

To get qtres to work, remove /home/tresobs/uparm/msdcombie.par and


Mike Calkins (Jul 2009)

Obtaining Observing Lists

TRES observing lists are typically created/prioritized a day or two
before the start of each TRES run.  Once everything is finalized,
Robert Davis at the CFA will place the lists on two computers, flwo60
and flwo60, both of which are at FLWO. The lists on flwo60 can be
found via any xterm window on that machine and are located in the
directory, "/home/tresobs/obsplan".

There is a useful print utility which produces hard-copy verions of the
lists which are much more manageable, as follows.

First, type:
"cd ~/obsplan"
An "ls" of this directory will reveal the current lists. To print a list, 
"print.davis examplelist.mhx"

This command will produce a formatted version that you will likely
find very useful during your run.

Starting the TRES Realtime System

TRES should only be started on flwo60 from a local xterm window that
has a regular command line.  The accounts are password
protected. Please see Ted Groner to obtain the passwords.

Once you are in the window above, and assuming the processes on tres-bench 
are running, type:

This command starts the realtime system, brings up a ds9 window that
automatically displays finding charts centered on the input
coordinates, brings up a tres.err window useful to track down
problems, and starts the NTCS (yellow) window for telescope and
instrument operations.

Starting and using the IRAF package

In an xterm window type:

"cd and then "ecl"

At the IRAF prompt, type:


This command prompts you to choose the acquisition date of the
data you wish to analyze. As indicated in the prompt, you can type
"now" for today's date or another date in the format

After you obtain your first science file, type:

"ctres filenumber"

This displays the spectra. If you have multiple files/exposures of
the same object you can type:

"ctres filenumber,filenumber,filenumber"

Note: the filenumbers must be separated by a comma, not a space.

To exit the display, type "q" repeatedly until the command line
reappears in the IRAF window. While doing this, IRAF will sequentially
display spectra, sky, spectra, sky, depending on the number of files

Some other useful IRAF commands:

"wt" with the cursor slightly above the spectra stretches the display.
"s, return" smooths the spectra. Enter number of "smooths" by 
  typing a number before the return.
"aa" returns the display to its initial state.
")" scrolls through the different apertures; the 
  wavelength solution is visible at the bottom.
"(" scrolls the apertures backward.
"q" exits the current display (may need multiple typings).

Preparing to run the TRES Guider

The TRES Guider can be run in two ways, through a VNC window showing
the TRES Guider desktop, or hosted through the flwo60 desktop.

To open a TRES Guider vncview desktop, type:

"vncviewer tres-guider:2"
(The password is written on the monitor in the 60" control room).

To host TRES Guider on the flwo60 desktop.......

Open an xterm window in flwo60 and type:

"xhost +tres-guider"
"ssh tres@tres-guider"
(The password is written on the monitor in the control room).


"setenv DISPLAY flwo60:0"

Once you have the tres@tres-guider command line, whether it's in a vnc
window or hosted on the flwo60 desktop, you are ready to start the

Starting the TRES Guider

At the tres@tres-guider command line, type:

"cd ~/guidebin"


"./tresguide start"

Note: You can also type "./tresguide start, ./tresguide
restart, or ./tresguide stop" depending on what you wish to

Attention:  The TRES Guider can be finicky. It may require several
attempts to bring up a healthy and cooperative Guider. If you are
hosting on the flwo60 desktop, you may have to repeat those
procedures as well.

When the TRES Guider is first started, you need to:

  • In the Tresbox gui, notice that at the top center the medium fiber is selected. Toggle to another fiber and then back to the medium fiber to "awaken" the green circle in the Guidegui Full Image to correctly identify the medium fiber (the green circle is lost when TRES Guider first starts).
  • Click the "Recenter" button on Tresbox. This will cause the "yellow" to go away and the tip/tilt mirror to find center.
  • Understanding the TRES Guider The TRES Guider is the only interface through which the observer can see and identify the targets she wishes to observe. When launched, TRES-Guider displays three GUIS, the Tresbox gui, the Guidegui, and the Guider Control gui. The Guider Control gui is primarily informational, it is only necessary to confirm that two red boxes are in the bottom left corner of this gui confirming that guiding is active in the two telescope axes. The Tresbox gui and Guidegui are the two guis needed for observations. The Guidegui is composed of three windows which provide different fields of view and can be toggled on and off independantly. As you would guess, the larger window, called "Full Image", provides a full field of view and should always be toggled on when slewing to a field. On bright nights when the backround is sufficient, you can see the three science fibers and three sky fibers in this window. You will also see two green circles. One of these circles is used by TRES-guider to identify which science fiber is active. The other circle is used by the observer to click and drag over a desired guide star. The two smaller windows at the top of the Guidegui are identified as "Target" and "Guide Star". The "Target" view provides a view of the active fiber with a green circle around it. While taking data, the target star should be centered over the fiber, under ideal conditions the star should disappear within the fiber. The Target view should always be toggled on to continuously monitor guiding. The "Guide Star" view corresponds to the other green circle present in the "Full Image" view. This circle can be "clicked and dragged" over an appropriate guide star. This is done within the "Full Image" view and will require an initial click to activate the "Full Image" view when returning from another view (ie: to turn its border blue). The Tresbox is used to manipulate the Guidegui. Within Tresbox you can toggle the different views off and on and change the exposure times for the different views. Within Tresbox you can chose whether to guide off the target, or off a guide star. You can also start and stop guiding. Using the TRES Guider Before slewing to your next field, within tresbox at the top of the gui, toggle on the "Target" view and "Full Image" view. Select an exposure time, if your target is bright, sub-second exposure times are fine. Don't be afraid to use multiple second exposure times if your target is faint. Slew to your field and align your target in the target circle, first in the "Full Image" view, and then in the "Target" view as it becomes available. Now you must decide whether to guide on the target or a guide star...... To Guide on a Star..... Look at the "Full Image" view to identify any possible guide stars. If you see a candidate, click and drag the non-fiber circle over the top of it. Next, within the Tresbox gui, toggle off the "Full Image" view and toggle on the "Guide Star" view (this may require patience, tres-guider is sometimes sluggish to respond). Remember, the "Target" view should almost always be left on. Within Tresbox, select "Guide on Star", this may help awaken the "Guide Star" view if it hasn't shown an image yet. You want a guide star that presents itself as "solid white" object for the guider to recognize. Adjust Guide Star exposure time as necessary to present a "solid white" guide image (experience will make this easier). Now center your target over the fiber (it shouldn't have strayed too far) With the target centered over the fiber, click on the "Guide Star" view on the Guidegui to turn its border blue. Next, click on "Tweak" at the top right of the Guidegui. "Tweak" should center the guide star within its view. Patience IS required. Once guide star is centered (multiple Tweaks may be required) AND the target is centered on the fiber you can select "Start" at the top of Tresbox to start guiding. Also be certain to toggle off "Full Image" view (this will help computer response time). To Guide on the Target...... With the target centered over the fiber, adjust Target view exposure time to present the target as a "solid white" image (experience will make this easier) within the "Target" view. Select "Start" at the top of Tresbox to start guiding. (When guiding on the Target you can toggle off both "Guide Star" and "Full Image" views to increase computer response time). While guiding.....!!! The TRES Guider guides using a tip/tilt mirror. It does not send drive corrections to the telescope axes. As a result, given a sufficiently long exposure time, you may reach the limits of the tip/tilt mirror. If this happens, you'll see a yellow background highlighting the x and y values of the tip/tilt mirror and the target will begin to drift. When it does happen, you'll have to turn off guiding, manually recenter the target on the fiber using the hand paddle, and start guiding again. There is no need to recenter a guide star (if guiding in this mode). This would have been done at the start of guiding. Calibration Scripts Calibration scripts can be found in the TRES Telshell window after typing: "cd ~/scripts" As of 2009.0708, the current afternoon and morning calibration script is: "ted_new1" This script takes approximately an hour to run. Previous calibration scripts include: "dave_evening_calib" "dave_morning_calib2" To run these scripts from the script directory in the Telshell window type: "source ted_new1", etc..... Taking Sky Flats Skyflats can be taken with the sun well above the horizon, typically 2-1.5 hours prior to sunset is an ideal time to obtain them. Gabor Furesz has written a nice script to obtain them, as follows. Make certain dome is open, dome tracking is on, mirror covers are open. In telshell window type: "object test" Make an estimate for an exposure time and type: "total n" Where n is the time estimate in seconds. (Note: 10s a ballpark estimate in clear skies ~1.5-2.0 hours prior to sunset.) Use Ds9 (see below) to measure the number of counts in the spectra. Would like to have ~25,000 counts. Once you have the exposure time figured out, in the Telshell window type: "solar m t" Where m = number of exposures (5 is fine) and t = exposure time. Gabor's script will also take a comp. Using Ds9 to Look at Spectra In an xterm window type: "ds9" When the ds9 display shows, assuming you have files to look at, click on "File > Open Other > Open Mosaic IRAF". In the pop-up that appears, you'll want to be in your current data directory. On the line provided type: "/tdata/tres/yyyy.mmdd" and click okay. This should bring up your data files in the same pop-up window. Select the file you want. Now, go to the ds9 window and click on "Region > Shape > Line". Once again, go back to the ds9 window and click on "Region > Shape > Projection"...... Now you can click and drag across the spectra and a graph will pop up showing the number of counts in the spectra cross-section. Taking Exposures with TRES The protocol for TRES exposures is still not fully worked out, but here are some rules of thumb. Always take odd numbers of exposures. This is preferred by the current reduction pipeline and aids in cosmic ray subtraction. Take comps before exposure. Due to overhead in positioning the comp mirrors, etc, it is possible to do much in setting up guiding while TRES prepares for a comp. This is a time-saving consideration only. Exposure times vs object magnitude: Vmag Exposure Time 14.0......................... 5x600 sec 13.0......................... 5x300 sec 12.0......................... 5x150 sec 11.0......................... 5x100 sec 10.0......................... 3x60 sec (same for brighter) Adjust exposure times for weather, seeing, etc..... Exposure times greater than 600 sec are not wanted due to a radiation source in the bench room. Consider additional exposures instead. TRES makes use of the same commands as FAST and Keplercam To take an exposure type: "total n" where n = exposure time in seconds. To stop an exposure type: "abort" Be patient, it may take a few seconds for TRES to stop the current exposure. To take multiple exposures type: "repeat m total n" where m is the number of exposures and n is the time argument. To take a comparison lamp (comp, arc, etc...), type: "cex" this will take a 3 second comp. "cexv n" will take a comp n seconds long. To take a flat type: "goflat n" n = exposure time in seconds To take multiple flats type: "repeat m flat n" where m is the number of flats and n is the exposure time. To take a dark type: "godark n" n = exposure time in seconds To take multiple darks type: "repeat m dark n" where m is the number of exposures and n is the exposure time. To name the following exposure (which name will appear in the header and log) type: "object name" TRES Troubleshooting If there is a ccd readout problem, for example, the Telshell command line doesn't reappear after taking a comp.... a.)Exit the realtime system. If there is no command line in the Telshell window, open an xterm and type: "killcom". b.) Open a vnc window to tres-bench by typing in an xterm: "vncviewer tres-bench:1" (password is on the monitor in 60" control room). c.) In an xterm window on tres-bench type: "redo". d.) Wait a few minutes, then in the xterm window on tres-bench where you typed redo, do a "cntrl-C" e.) Restart realtime system with "gotres". If the above doesn't work, you will have to rehome the tres-bench stepper motors. To do this, repeat the above steps but in step c.) type: "rehome_motors", enter, then type: "redo".