DIS: The Double Imaging Spectrograph

1st June 1995

The Table of Contents is at the end

Introduction

The DIS was built at Princeton by Jim Gunn, Michael Carr, Brian Elms, Ricardo Lucinio, Robert Lupton, and George Pauls. It is a medium dispersion double spectrograph, which can either be used in a direct imaging mode, or as a spectrograph. Among the objects observed on its first night on the telescope was 3C273.

This manual was converted from TeXinfo using texi2html and perl.

Description of Instrument

The optical path consists of a slit-mask assembly, a shutter, a dichroic (with a transition wavelength of 5350 angstroms), and two independent collimators and cameras for the blue and red sides. The gratings and mirrors are mounted on a grating turret holding two mirrors (red and blue) and two sets of two gratings. The detectors are a thinned, uv-coated SITe (formerly Tektronics) 512x512 CCD with 27 micro pixels on the blue side, and a thinned 800x800 TI chip with 15 micron pixels on the red side. The gain on the blue side is 0.96 electrons/DN; on the red side it is 1.47 electrons/DN; and the readnoise is about 9.5 electrons. The electronics on the blue side misbehave for very over-full wells; the signal is set to 0, and the pixels to the side of the offending pixels are also set to 0. The way that the CCDs are mounted results in the dispersion in the two chips running in opposite directions.

The collimator focal lengths on the blue and red side are both 963mm; the camera focal lengths are 140.3mm and 141.7mm on the blue and red sides respectively; the resulting reduction is 6.865 in the blue and 6.798 in the red (the measured values are within 1/2% of this value, and vary slightly with collimator focus). The measured scales are 1.086 arcsec/pixel in the blue and 0.610 arcsec/pixel in the red. The beam diameter is 100mm, and the angle between the collimator and camera optical axes is 35 degrees. There are commands to centre given wavelength on the chips.

Because the dichroic is not in a parallel beam there is a ghost image on the blue side, produced by light reflecting off the back surface of the dichroic. It's displaced by about 20 pixels to the red. When the slit is illuminated with an He arc the amplitude is about 10%; inserting the g filter totally removes the ghost. We are considering coating the back of the dichroic to reduce this effect. When using the gratings, this ghost is of course dispersed off the chip. There are also ghosts when you are taking spectra; they will also be improved by AR coating.

When being used as a spectrograph, the entrance aperture can be either a long slit or a slit mask; the total slit length is 6', and slits of width 1.5 and 1 arcsec are installed in slit mask wheels A and B in positions A1 and B1 respectively. In imaging mode the ends of the slit are at approximately (125,250.7) and (492,251.4) in the blue chip, and (120,433.8) and (775,434.2) in the red. At the time of writing, the FWHM at the centre of the slit are about 1.4 and 1.8 pixels.

Two sets of gratings are currently installed: a 150/300 lines/mm pair, and an 830.8/1200 lines/mm pair; the blaze angles are ??. All gratings are run in first order. The low-resolution pair have dispersions of 6.2 A/pix and 7.0 A/pix for the blue and red sides; the high resolution gratings' dispersions are thus approximately 1.1 A/pix and 1.7 A/pix to within a cosine. When used for imaging, the field of view is 4'x6'.

The shutter is a rotating half-circle; this means that there is no aperture correction, even for the shortest exposures.

The slit mask assembly contains five masks; of these the first usually contains a long slit, and the second is clear. The other three are available for user-created slit masks. There are two slit wheels, which can be easily changed by on-site personnel during the night. All other operations can be controlled by the remote observer.

The CCDs are cooled by liquid nitrogen. The cameras are automatically filled from a storage dewar when empty; provided that the storage dewar is pressurised and not empty, the cameras will remain cold. The red side runs at approximately -125 Celsius; the blue side at about -100 Celsius.

There are two optical systems that must be focused in a spectrograph, the collimators and the telescope. We do not expect users to have to focus the collimators (and it can't be done remotely in any case). The telescope is focused in the usual way. Because it is not yet possible to take multiple exposures, you will have to read out the DIS after each movement of the secondary.

There are a total of nine mechanisms that can be commanded remotely: the four grating angles (see section Selecting Mirrors or Gratings, and Grating Tilts); the position of the grating turret (see section Selecting Mirrors or Gratings, and Grating Tilts) and the detent (which we hereinafter ignore); the filter wheel (see section Selecting a Filter); the slit-mask wheel (see section Selecting a Slit Mask); and the shutter (See section Taking an Exposure; see section Homing the Shutter).

The computer systems used to run the DIS are typically baroque. The observer sends commands to a programme called the MC which is responsible for book-keeping and routing commands; in fact, there may well be another layer above the MC -- for example, I use mirella(1) to send commands to the MC, and others may use Bob Loewenstein's mac interface. The MC then passes the commands on to an instrument control computer (icc); in the case of the DIS this involves two more processes. The DIS icc is a PC, and it sends commands over an RS232 line to a TDS microcomputer that is physically on board the instrument.

Command Summary

All commands should be preceded by `dis', and all commands can be asked for help (e.g. dis grating help).

You should not attempt to send a second command to the DIS before a first has completed. The sole exception is expose, when it is safe to send commands after the shutter has been opened (the integrating for n seconds message). Commands return a completion code (of :) to the MC when they have finished.

If the instrument is power-cycled, all responses that it returns will include the remark, "spectrograph micros are not initialiased!". If you see this, you should use the init (see section Initialising the PC and Onboard-Micro) to initialise things. This will also reset the nitrogen filltimes, a detail that will concern few observers.

Please note that, as of the time of writing, these commands had been used for nearly a week of `remote' observing. They are not well tested, and some of the MC-related parts still need work.

The available command are:

Hardware Control of the Cameras

camera [red|blue] prep

Prep the chips (i.e. read them to get rid of old and unwanted charge). If you don't specify a colour (or specify both) both chips are prepped. The chips are automatically prepped before each exposure.

camera skiplines=n

Read out n lines and throw the data away. This is most often used for focussing.

camera status

Print some status information for the cameras.

camera wipe[=on|off]

Continuously read the chips until told to stop with camera wipe=off.

This command should always be used while the chips are cooling, as it gets trapped charge out of the oxide layer.

Taking an Exposure

The expose commands are used to take data and transfer it to the Unix host, currently tycho. At present the files have minimal headers and appear by default in the directory `/export/home/dis/data'. The file format can be either Mirella (the default) or FITS (see section Specifying the File Format).

Header keywords are described below, See section Keywords in DIS Disk Files..

As explained above (see section Specify the Output File), the DIS usually puts files in a well-known place on the unix host, expecting the MC to massage them suitably (e.g. adding RA and dec to the headers) and safely archiving them somewhere. Until this is done, we have added a temporary command file and an option to the expose command to choose file names.

If you don't use these facilities, mirella format files are called `dispic_b.hdr', `dispic_b.img', `dispic_r.hdr', and `dispic_r.img' for the blue and red images respectively. These files are very close to IRAF 2-file formats (.img files are identical to .hhd; .hdr and .hhh are the same to within whitespace); nonetheless without some massage IRAF cannot handle these files, and you should proceed to the next paragraph.

FITS files are called `dispic_b.fts' and `dispic_r.fts' for the blue and red images respectively.

These files are overwritten everytime that you take an exposure! You are responsible for saving them. If you are using the mirella interface there are words to do this for you -- ask RHL for details.

expose abort

Abort an exposure, either in progress or already stopped (with expose pause).

expose help

Provide a summary of expose options.

expose pause

Pause an exposure, i.e. close the shutter but don't read the chips. You can resume the exposure later; abort it, or read the data.

expose read [bin] [red[=0|1]|blue[=0|1]] [old]

Read an exposure; either one that you paused or one that is in progress that you'd like to halt prematurely. If you want to abandon an exposure entirely, use expose abort.

You can specify which chip to read and the desired binning; if you don't specify anything the values used to start the exposure will be used. The arguments are discussed in more detail under dis expose time=n

You can also read an exposure that has already finished (or even one that has been aborted, but about which you've had a change of heart). This is slightly dangerous, as if a chip has already been read reading it again will replace your data with a bias frame. In consequence, you must explicitly specify the old flag if you want to read chips after an exposure has been completed; in addition the way that colour flags is interpreted is a little different. If you omit a colour specification neither chip will be read -- the chips specified in the original expose command are ignored. The same goes for binning; if you want the data binned you must explicitly say so.

expose resume [bin] [red[=0|1]|blue[=0|1]] [time=t]

Restart a paused exposure. You can specify which chip to read and the desired binning; if you don't specify anything the values used to start the exposure will be used.

The arguments are discussed in more detail under dis expose time=n

If the time specified is different from the original exposure time the integration time will be adjusted (although the total time may differ from that requested by up to half a second); if it is shorter than the time already elapsed the chip will be read immediately.

expose status

Report on exposures in progress or recently completed.

expose [bin] [dark] [file=name] [red[=0|1]|blue[=0|1]] bias|time=t|snap

Actually start an exposure. The time is in seconds and must be provided. If you specify 0, a snapshot will be taken (snap is an alias). This is the shortest exposure possible, and opens the shutter for 0.6s. If you specify bias instead of time a bias frame will be taken; if you specify dark (as well as a time) a dark frame will be taken.

Optional arguments are:

bin[=0|1]

Bin the data 2x2.

dark
Don't open the shutter, but thus take a dark frame.

file=name
Write the data to files named `name_b' and `name_r' on the unix host. As an alternative, consider the file command (see section Specify the Output File); this flag overrides any filename specifications made there (but it obeys any dir=name settings).

red[=0|1]|blue[=0|1]

Only read the red or blue chip. If you don't specify a colour, both are read. If you don't specify a value it defaults to 1, meaning that that colour should be read.

Specify the Output File

It is not the job of an instrument control computer to decide where to put datafiles on the unix host; it is the job of the MC -- which should know almost nothing about the instrument. At present at APO the MC is structured to make this difficult, and therefore as an interim measure the I have added the commands in this section. There is also an interim flag, file that expose (see section Taking an Exposure) understands.

You can specify a filename, e.g. `ngc6205', or request the DIS to generate names for you; in this case you can specify the base part (e.g. `bias') and the starting record number (e.g. 100), in which case files will be named `bias00100', `bias00101', `bias00102', and so forth. The red and blue sides are distinguished by having a `_r' or `_b' appended, so if you are using FITS format (as specified using the format command (see section Specifying the File Format)), the next red file would actually be called `bias00103_r.fts'.

No attempt is made to ensure that the file doesn't already exist on the unix disk! Caveat scrivor.

file auto[=on|off]
Name datafiles with a unique record number, which is automatically increased after each exposure. If you specify off, this is (of course) disabled.

file dir=name
Place the files in the directory name on tycho. If name doesn't start with a / it is interpreted relative to `~dis'. The directory must be writeable by the dis account.

file file=name
Call the output file name. If auto is turned off, this is equiavalent to specifying file=name to expose, but if you are using the automatic generation of filenames, it is used as the base part of the filename.

file recnum=####
The recordnumber for the next automatically generated filename is set to ###.

file status
Report the current status of filename generation

Selecting a Filter

Both the keywords filter and filters are accepted.

filter 1
filter clear

Put in the clear filters. Actually there are no filters at all in this position.

filter 2
filter gr

Put in the real filters; Gunn-Thuan g and r on the blue and red sides respectively.

filter home

Home the filter wheel (to the empty position).

filter status

Inquire the status of the filter wheel.

Specifying the File Format

The DIS can currently write files on the unix host in either Mirella or FITS formats. The Mirella format is very similar to IRAF, but apparently not quite identical. At some point, quite soon now, the files will be written using standard APO procedures.

format fits
Write files in FITS (`*.fts') format.

format mirella
Write files in mirella (`*.{hdr,img2') format.

format status
Report the file format that the DIS is currently using.

Selecting Mirrors or Gratings, and Grating Tilts

Commands to select gratings or mirrors, and manipulate the grating tilts. gratings or turret is acceptable as an alias for grating.

It takes about 50 seconds to switch between the high resolution and the low resolution gratings; about 30 seconds to go from grating set 1 to the mirrors; and about a 100 seconds to change from grating set 2 to the mirrors. When you tilt the gratings they are first homed, to avoid problems with missed steps, and it takes about 30 seconds to go from step 2100 to step 2101 (a wavelength of about 1.2 microns for the high resolution red grating; about 6.8 microns on the low resolution side). Times for more moderate tilts are somewhat shorter.

grating 1

Select grating set 1, currently the low-resolution (150/300 lines/mm)pair.

grating 2

Select grating set 2, currently the high-resolution (830.8/1200 lines/mm) pair.

grating change1

Move the turret to the correct position to change grating set 1.

grating change2

Move the turret to the correct position to change grating set 1.

grating home

Home the grating turret after a crash or other problem, and home all the gratings. Use ghome to home an individual grating.

grating col=[r|red|b|blue] n=[1|2] [lambda=l|step=n]

Set a given grating to a given position. You can either specify a step or a wavelength (in angstroms) to set at the centre of the chip. The n refers to the grating pairs. Most users will not want to use the step form, as it requires a familiarity with the stepping motors used to tilt the gratings.

grating col=[r|red|b|blue] n=[1|2] ghome=1

Home a specified grating.

grating ok

Tell the DIS that the gratings that it thinks are in the turret are indeed the ones loaded. You need to issue this command after the grating turret door has been opened. If you changed any gratings it is your responsibility to update the DIS's idea of grating parameters; as there are currently only two sets of gratings available, there is no way for naive users to do this.

grating status

What is the status of the gratings and turret?

Getting a Summary of Options

help
Print a help message. Note that all commands accept help as an option, e.g. dis gratings help.

Homing all Mechanisms

home
Send all the mechanisms home; you'll have to init (see section Initialising the PC and Onboard-Micro) the DIS first. You will have to home the instrument after powering up the micro, and after the TDS micro on the instrument has crashed. You can restore the instrument to the state it had before the crash with the tds command (see section Recovering from TDS Problems/Reboots).

Initialising the PC and Onboard-Micro

init
Initialise the instrument computers. You'll have to do this before you can do anything else. If the spectrograph micro has crashed, you'll have to home everything before you can send mechanisms such as gratings to specified positions (see section Homing all Mechanisms).

Liquid Nitrogen Commands

Control or inspect the liquid nitrogen system. The dewars run at liquid nitrogen temperatures (78K), the blue camera runs at about -100C, and the red camera at about -125C.

ln2 cool=t
Keep the nitrogen system on until the dewar temperatures reach some predetermined value (currently 85K). The command will keep trying for t minutes before the desired temperature is reached or it gives up. Don't give it too long a time -- if the supply dewar is empty you'll have lost control of the instrument until the time finally elapses (or until someone at APO hits ^C on the PC running the instrument). We start the CCDs wiping for you.

ln2 off

Turn nitrogen filling off. The chips will eventually warm up.

ln2 on

Turn the nitrogen system back on.

ln2 status

What is the status of the LN2, and the temperature of the chips?

ln2 top

Force a nitrogen fill (top up the dewars).

Selecting a Slit Mask

Control the slit mask assembly.

mask 1
mask slit

Select mask 1, which should be a long slit.

mask 2
mask clear
Select mask 2, which should always be empty.

mask 3

Select mask 3.

mask 4

Select mask 4.

mask 5

Select mask 5.

mask home

Home the slit mask wheel.

mask status

Where is the mask wheel?

Inserting the Mirrors

mirrors
Put in the mirrors.

There is an optional argument:

[home]

Send the grating turret home.

Seeing if all Computers are Alive

ping
Request each of the many computers in the chain of command to acknowledge their existence. If all is well you'll get a Descartian assertion from the forth TDS micro on the spectrograph.

Set a Special MID for `Orphaned' Messages

The casual user can probably safely ignore this command.

set-special-mid
Set a special MID to receive messages from the DIS that are not associated with any known MID, such as device timeouts (and also syntax errors -- don't ask why they end up MID-less).

Mirella users can use the word init-dis to initialise the DIS and set the special MID with one simple, easily typed, word.

Homing the Shutter

shutter home

Home the shutter.

shutter status

What is the shutter status?

Finding the Status of the Hardware

status devices

Report the status of all the mechanical parts of the spectrograph.

status version

Report the version of the code on the TDS micro.

Syncing the MC with the PC

This command is not currently available. It shouldn't be needed.

sync
If the client appears to be totally confused over how to talk to the MC, this command should fix things up.

Recovering from TDS Problems/Reboots

The DIS remembers the status of the instrument micro, the TDS. You can use this command to inquire what it thinks its status should be, or reset it to that status. We expect this to be used as

dis status
dis init
dis home
dis tds status
dis tds restore
The first command (status) reports that the micro is not initialised; the second (init) initialises it; the third (home) homes it (as it has no idea where its mechanisms are); the fourth (tds status) reads the saved status information, and gives you a chance to see if it makes any sense; and the final (tds restore) sends commands to the instrument to restore the desired values.

Getting Started with the Instrument

As a zeroth step, logon to some machine that can communicate with the MC; for example if you are at APO logon to tycho and start the MC command line interface. If you are indeed using the raw MC interface (as opposed to, for example, the mirella interface) you may well want to start a dis window -- open a window (an xterm or shelltool) and type ~apotop/bin/dis-window &.

First check that you can communicate with the instrument:

dis ping
You should get a number of replies, ending with
COMPUTO ERGO SUM !
If you don't, some part of the chain of command to the instrument is broken.

Next, you'll have to initialise things. Try the command

dis init
If you get complaints about needing to home the mechanisms do that:
dis home

Everything should be ready to go. See where things are:

dis status
and what the camera temperatures are:
dis ln2 status
If it all looks reasonable, you can start observing.

You shouldn't have to focus the instrument, which is fortunate as doing so is impossible for the remote user. To focus the telescope you can either take a number of exposures, reading the chip between each; or close the shutter as you move the focus and telescope, finally reading the chips; or close the shutter and clock some charge as you move the focus.

To take four exposures without reading the chip, but moving the image by 15 lines in the blue and 22 lines in the red between exposures, say

dis mirrors
dis mask clear
  (set initial focus position)
dis expose red=0 blue=0 time=10
dis camera blue skiplines=15
dis camera red skiplines=22
  (change the focus)
dis expose red=0 blue=0 old time=10
dis camera blue skiplines=15
dis camera red skiplines=22
  (change the focus)
dis expose red=0 blue=0 old time=10
dis camera blue skiplines=30
dis camera red skiplines=44
  (change the focus, note that we skipped double before the last exposure)
dis expose old time=10
The old keyword tells the DIS not to erase the previous (unread) image; the red=0 blue=0 tells the DIS not to read the chip.

As an alternative, the final dis expose old time=10 could be written as dis expose red=0 blue=0 old time=10 like the other exposures, followed by dis old bias which has the effect of reading the chips; the initial exposure could be replaced by dis red=0 blue=0 bias to initialise the exposure, followed by dis expose red=0 blue=0 old time=10. If you follow both these pieces of advice all of the `real' expose commands are identical, which means that you can put them in a loop ....

You'll need to find where the slit is; if you aren't using custom multi-slits, you'll want to use the slit in mask position 1; you can refer to this as either dis mask 1 or, as here, by name:

dis mirrors
dis mask slit
dis expose time=30
(assuming that you can see it against the sky in 30s).

Next acquire a target (I'll assume that a 10s exposure is enough); to save time let's only read the red chip:

dis mask clear
dis expose time=10
That'll put the data from both cameras on the unix host in mirella format, in the files `/export/home/dis/data/dispic_b' and `/export/home/dis/data/dispic_r'; for details See section Taking an Exposure. If you'd rather use FITS files, say
dis format fits
before the expose command. The use of standard names for the datafiles is all very well for scratch exposures, in fact it's rather convenient, but for real data you obviously want some way to give your precious frames distinct names. We'll see how to do this in the next-but-one paragraph.

Next, slew the telescope to put the image where the slit is, put the slit back in and see if the target falls on it:

dis mask slit
dis expose red=1 time=30
If it's there, put in the gratings; I'll assume that you want the low-resolution set, with the blue set to have 4400A at the centre of the chip, and 7700A in the red (both reasonable numbers):
dis gratings 1
dis gratings col=blue n=1 lambda=4400
dis gratings col=red  n=1 lambda=7700
dis expose time=100 file=my_first_spectrum
And you should have your first DIS spectra.

Note that we explicitly specified that the data be saved as `my_first_spectrum' -- this means as files like `my_first_spectrum_b.fts'. You can't simply repeat the command using some history mechanism as your second spectrum would overwrite your first, so you have to remember to specify unique file names. Another way to proceed is to ask the DIS to think of names for you. For example, to use a set of filenames of the form `R00000', `R00001', and so forth you'd say

dis file file=R recnum=1 auto
and not specify file to the expose command.

When you come to take arcs, arrange for someone on the mountain to attach an arc to the front of the telescope and turn it on. We've had success with an Hg/Ar arc and 100s exposures with the low resolution gratings. Incandescent flats are acquired in a similar way. As I type this (within an hour of the 1st of October 1994) Jim is drilling holes in pieces of aluminium trying to make arcs and flats remotely operable.

Comparison Spectra -- Taking and Interpreting

Currently (1st October 1994) we can nearly, but not quite, control the arc and flat field lamps mounted on the secondary from the telescope.

Eventually we expect to provide detailed plots and line lists, but for now all that we have is one low resolution spectrum of an Ar-Hg lamp. Click here to see the graph

Interactions with the MC

The DIS has been used from Robert Lupton's mirella interface to the telescope. Your mileage may vary (including changing sign) if used in other ways.

You should be able to send the DIS commands from the MC by prefixing your command strings with dis; if you are talking to the MC perl directly, response strings will come back via the mc-window as usual. If you are using RHL's mirella interface, responses to commands are sent back from the MC on the same MID as they were sent on.

In addition, all DIS messages are sent to a special distributed class called dis, which you can subscribe to like any other class.

Messages that correspond to no known MID, such as device timeouts, are also sent to class dis, prefixed by the string Orphan text:. Alternatively, you can use the DIS command set-special-mid (see section Set a Special MID for `Orphaned' Messages).

Keywords in DIS Disk Files.

The state of the instrument is given in the header; keywords are:

CCDNUM
1 for the blue chip; 2 for the red chip.

EXPOSURE
Length of the exposure in seconds. If you have paused and restarted the exposure the value may be incorrect by up to half a second. If the exposure time is negative the shutter was not opened, and you have a dark frame. Bias frames have exposure times of 0 (which isn't really a special case).

FILTER1
Which filter is in; FILTER0 (empty) or FILTER1 (Gunn-Thuan g/r).

FILTER2
Always EMPTY (there is only one filter wheel).

GLAMBDA1
GLAMBDA2
GLAMBDA3
GLAMBDA4
The position of the four gratings (B1, R1, B2, and R2) in Angstroms. The values are only approximate, and are derived from the values of GSTEPn.

GRATING1
GRATING2
GRATING3
GRATING4
Identification strings for the four gratings, consisting of lines:blaze where lines is the number of lines/mm for the grating, and blaze is the wavelength (in Angstroms) of the blaze.

N.B as of early June, the blaze wavelengths were not known.

GSTEP1
GSTEP2
GSTEP3
GSTEP4
The position of the four gratings (B1, R1, B2, and R2) in units of steps of the stepping motors.

MASK
The number of the current grating mask.

TIME
Ending time of the exposure in UT.

TURRET
The position of the grating turret, e.g. MIRRORS.

What To Do if there are Problems

A multitude of things can go wrong with the instrument, so your problem is probably not discussed here. Still, it might be. If you think that it might help you can try calling RHL at work (609-258-3811) or at home (609-466-2431); JEG's numbers are 609-258-3802 and 609-924-1304 respectively. You had better think hard before calling us at home, and please remember that there is a two hour time difference from APO.

Can't ping the instrument.
There are four places that this command might fail, each further into the depths of the system than the last:
No reply
This means that the MC isn't responding. This isn't a DIS problem at all, so I am afraid that all that I can suggest is the usual sequence of kills and restarts.

Only the MC is alive message
This means that the client that communicates between the MC and the instrument isn't running (either never started or dead), or is non-responsive. If mc status thinks that the dis_s isn't running, start it (starticc dis) and try again. If that doesn't help, kill all the processes that are connected with the client and then try starting it; you can do this with the unix command /home/apotop/start-dis -r (if you want to issue the command from the mc you'll need to preface it with a !). From the mirella interface you can restart things with the command restart-dis-icc. This litany may not work if the MC or Hub is playing up; in this case intersperse start-dis -r commands with the usual MC black magic. You will need to set the special MID used for orphaned messages (see section Set a Special MID for `Orphaned' Messages).

Only the MC and Client is alive messages
This means that the DIS's PC isn't responding. Get someone at APO to go and look at the PC. Ask them to type host; if that works (i.e. there are no complaints) then Mirella is up and in a suitable state. If it doesn't, the simplest thing to do is to reboot the machine -- press the three keys ALT-CTRL-DEL all at once (DEL is the keypad .). If that doesn't do anything, press the white button on the front panel. Does host work now? If not, proceed to check the cabling.

Only the MC, Client, and Mirella is alive messages
The instrument micro is down, or communications are confused. Eventually the latter condition (should) timeout, so go and reboot the micro (the easiest and best way is turn off the power to the electronics box. Not the power to the whole instrument.) You may have to play with the baudrate of the connection (see next item). If that doesn't work, try rebooting the PC (see previous paragraph). Can you ping it now? If not, check the cables, and then give up.

  • The PC can't talk to the TDS after a power-cycling We usually run the serial line to the TDS at 2400, but it comes up at 9600, so after the TDS is power-cycled there's an inconsistency. Say:
    ndis 2400 setbaud
    
    to fix it. You may have to repeat this command a few times, and wait for various errors to timeout on the PC. Eventually you should get a message
    I trying 9600 baud...
    
    followed by no error messages (if you use setbaud a second time the success message will be I trying 2400 baud...).

  • The mirrors or gratings won't move.

    Try power-cycling the logic box on the DIS (that's the one with the smaller power switch).

  • Images from the DIS are all zeros The first thing to check is that the data coming from the instrument is zeros. Type
    dis camera prep
    
    and go and look at the DIS PC. The left hand column of numbers is a counter; the rest reflect the data coming from the chips. You can examine just one chip with
    dis camera blue prep
    
    or
    dis camera red prep
    

    If the data is all zeros, the problem is probably either in the PC or the onboard micro, or in the cabling. Try power-cycling the PC (push the reset button on the front panel). If this doesn't help, power-cycle the logic box on the instrument (the one with the smaller power switch). Then check the coax cables. Then talk to Jim Gunn.

  • The DIS doesn't seem to understand commands For example, it might reply pre-ping ? to a dis ping command. This is caused by mirella on the PC getting stuck in an inappropriate vocabulary. Usually repeating the command will fix it (in fact repeating any command -- I usually use dis ping).

  • Notes for Expert Users

    Are you sure that you should be reading this?

    Sending Commands Directly to the DIS PC

    Usually commands sent to the PC are mangled into a suitable form; You can disable this with the DIS command set-passthrough, and re-enable it with set-nopassthrough. So you can set the serial port timeout to 5 seconds on the PC with the commands

    dis set-passthrough
    dis 5000 serialtimeout !
    dis set-nopassthrough
    

    If you use mirella, this is done for you by the command ndis:

    ndis 5000 serialtimeout !
    

    It is possible to use this facility to cut yourself off from the instrument, for example

    ndis bye
    
    kills mirella on the PC, and it is mirella that listens to you.

    Sending Commands Directly to the Onboard TDS micro

    The PC can send commands to the TDS, so once you know how to send un-mangled commands to the PC you are almost there (see section Sending Commands Directly to the DIS PC). The litany on the PC is:

    " command" >micro ct
    
    so from mirella you could say
    ndis " DOORRESET" >micro ct
    
    to reset the door latch interlock. Many of the most popular commands can be more simply executed by first loading the forth file `3_5micro.m' on the PC (ndis reload 3_5micro), and then issuing the commands as if you were talking directly to the micro, for example
    ndis 1 ?P
    
    to enquire the position of grating one's stepping motor.

    How to Reboot the Computers

    It is possible to reboot either of the computers remotely, but it may not be a good idea. If you insist, the PC can be rebooted with

    ndis % c:/bin/rebootb c
    
    (omitting the final c gives a warm boot), and the TDS with
    ndis " COLD" >micro ct
    
    This last command in particular seems to sometimes leave the remote observer unable to talk to the instrument, so please be careful.

    System Parameters on the DIS PC

    There are times when you might want to change the code that runs on the PC, for example to temporarily change the number of lines/mm for a grating.

    The PC is programmed in forth (well, actually it is running mirella but you won't be changing any C), so any changes that you have to make will involve typing (trivial) forth commands; for example the command

    30000 serialtimeout !
    
    stores 30000 into the integer variable serialtimeout. You can print the current value with
    serialtimeout ?
    
    Using the mirella interface to the MC this would be achieved by saying ndis serialtimeout ? (see section Sending Commands Directly to the DIS PC).

    Variables that you might be interested in are:

    Grating Lines/mm
    There is an array called lines/mm with the values for the four standard gratings. To set the value for the 2nd grating to 1234.5 say 1234.5 4 lines/mm f!; print it with 4 lines/mm f?. Note that the number must contain a decimal point, and that you use f! and f? rather than ! and ?.

    Grating Zero Points
    The zero-point positions of the gratings are stored in an array called zero_order. These are the values in steps for the stepping motors that control grating tilt that put the zero-order image of the slit into the centre of the chip. They are used when you specify a wavelength to the grating command. The value for the third grating could be set to 100 with the command 100 3 zero_point !, and inspected with 3 zero_point?.

    Serial Timeout
    The RS232 line to the instrument from the PC times out after serialtimeout milliseconds. The default is 30000ms, if you wanted to set it to a minute you'd send the command 60000 serialtimeout !; to print the current value

    Unix Host
    The machine that images are transferred to is given by the variable unixhost, and the directory (relative to the home directory of the dis user account) by unixdatadir. You could set the host with " kepler" unixhost cs!, and print the current value with unixhost ct; how to set unixdatadir should be obvious. If you fiddle with these value you will have to ensure that the .rhosts files are set up correctly to allow the user dis on the machine dis to transfer files.

    Verbosity
    If the variable verbose is 1 some extra chatter is produced (e.g. a message that commands have been received).

    Keywords Passed to the MC's dis Subscription

    The DIS passes information to the MC in the form of messages prefixed by diskeys=. These are intended to allow the MC to maintain a mirror of the DIS's current state; currently they are merely passed out on a subscription called dis, along with all other DIS output. You can view them in a unix window with the command

    dis-window | sed -ne "s/.*ys='\(.*\)'*/\1/p"
    

    A given diskeys string may contain a number of white-space separated keywords; if values are provided and contain whitespace they are quoted with ".

    The following list is complete at the time of writing (30th September 1994):

    directory=name
    Name of directory on unix host where data will be stored.

    expose:abort=true
    An exposure has just been aborted

    expose:dark
    This is a dark exposure.

    expose:finished=true
    The current exposure is finished.

    expose:none=true
    No exposure is in progress (the result of a query).

    expose:paused=true
    The current exposure is paused.

    expose:resumed
    The current exposure has just been resumed.

    file:auto=off
    Automatic generation of filenames is turned off.

    file:auto=on
    Automatic generation of filenames is turned on.

    file=name
    The next date file will be called name.

    filter=name
    The current filter is name (one of Empty, Gunn-Thuan gr, and Unknown).

    format=type
    The current file format is type (one of Mirella or FITS).

    grating:Name:lambda=####
    The approximate central wavelength for the grating is ####A. Name is The name of a grating, e.g. GR1 for the red grating in set 1.

    grating:Name:step=####
    The stepping motor position for the grating is ####. Name is The name of a grating, e.g. GB2 for the blue grating in set 2.

    ln2:blueCam=###C
    The temperature of the blue camera in C (as specified in the keyword).

    ln2:blueFill=true
    The blue dewar is filling.

    ln2:blueLn2=###K
    The temperature of the blue dewar in K (as specified in the keyword).

    ln2:elapsedTime=time
    The time since the last nitrogen fill cycle.

    ln2=off
    The nitrogen fill system is turned off.

    ln2=on
    The nitrogen fill system is turned on.

    ln2:redCam=###C
    The temperature of the red camera in C (as specified in the keyword).

    ln2:redFill=true
    The red dewar is filling.

    ln2:redLn2=###K
    The temperature of the red dewar in K (as specified in the keyword).

    ln2:topping=true
    The dewars are being topped off.

    mask=#
    The number of the current mask (1--5). As noted above, a slit should always be in mask 1, and mask 2 should be clear.

    mask=invalid
    The current mask position is invalid.

    receptive=false
    The DIS will accept no more commands until the current exposure is over (it will enforce this -- this keyword is just for your information).

    receptive=true
    During an integration the DIS can accept commands; this keyword means that it's ready to accept them now.

    shutter:fault=true
    An enquiry as to the shutter's status reveals a fault.

    shutter=closed
    The shutter is closed.

    shutter=open
    The shutter is open.

    status=powercycled
    The TDS has been powercycled.

    status=uninitialised
    The PC has not been initialised.

    tds:date=str
    The TDS status information was recorded at time str.

    tds:filter=#
    The TDS status information indicates that filter # was in use.

    tds:grating1=#
    The TDS status information indicates that grating 1 was at step #.

    tds:grating2=#
    The TDS status information indicates that grating 2 was at step #.

    tds:grating3=#
    The TDS status information indicates that grating 3 was at step #.

    tds:grating4=#
    The TDS status information indicates that grating 4 was at step #.

    tds:mask=#
    The TDS status information indicates that mask # was in use.

    tds:turret=#
    The TDS status information indicates that the grating turret was at position #.

    time:elapsed=###
    The time remaining in the integration (can be greater than the total length if the enquiry comes after the shutter is closed).

    time:remaining=###
    The time remaining in the current integration.

    time:specified=###
    The specified integration time.

    turret:door=open
    The grating turret door is open.

    turret:door=wasopen
    The grating turret door has been opened.

    turret=name
    The turret is at position name; possibilities are grating1, grating2, mirrors, change1, change2, and unknown.

    version=str
    Return the version string from the TDS. Each line of the original multi line string is separated by ||.

    wipe=off
    The chips are being wiped.

    wipe=on
    The chips are not being wiped.

    Things on RHL's stack

    Things that have changed

    21st April 1994
    Added format command to support writing FITS files.

    22nd April 1994
    The lost message problem is under control. You can either get them directly (see section Set a Special MID for `Orphaned' Messages), or subscribe to class dis. For details, See section Interactions with the MC.

    25th April 1994
    Monitor the turret grating latch, and invalidate grating parameters if the door has been opened.

    Look at the claimed position of the gratings to see if the TDS micro has been power-cycled.

    Added the tds command to restore the spectrograph to a saved state.

    26th April 1994
    Measured zero-points of high resolution gratings.

    16th May 1994
    Fixed the stepping motor problems; this was the problem that was giving us trouble with grating tilts. It is not clear if the grating zero points are correct.

    16th May 1994
    Put DIS status information into the headers.

    10th-12th June 1994
    Changed directory names from gunnspec to dis.

    You can now read the other chip after expose red=1 ....

    pause/read/resume seem to work. You can specify a new time, binning mode, or selection of chips to read.

    You can clock the chips some number of lines, (camera skiplines) permitting focus frames. An example is in the cookbook.

    You can take bias and dark frames.

    The selection of grating tilt by central wavelength now works correctly.

    The camera cont has been replaced by camera wipe, which can be turned off.

    Added aliases for time=0 (snap), mask 1 (mask slit), and mask 2 (mask clear).

    Wrote lots of Cunning forth for mirella users (e.g. to take a set of spectra with the high resolution gratings that cover the entire spectral range of the instrument).

    28th September -- 1st October 1994
    Recovered from the lightening strike that destroyed the DIS's PC.

    Installed the filters (only the g, but the r as added a day or two later).

    Added the file command to specify where the datafiles should be put. This is a temporary measure.

    Added a file=name command to expose. Also temporary.

    Made the DIS report its status on the dis subscription stream, preceeded by `diskeys='. This is intended to make life easier for Bob Loewenstein.

    The gratings are now always homed before being tilted.

    More Cunning forth, of course.

    31st May -- 1st June 1995

    Fixed floating point stack overflow bug

    An expose abort command now returns an error completion for the original expose command.

    Reset the grating zero points to requested wavelengths should once more be correct.

    Table of Contents

    1st June 1995

    Footnotes

    Footnote (1)

    mirella is a C and forth image processing system that Jim Gunn and I use. We run it on the DIS's icc PC, and as a command language to observe at APO (as well as for scientific analysis)