The MOP Command Line Cookbook

Contents

Introduction

This page contains a number of "recipes" for performing a variety of tasks from the command line using MOP. Although they still work, most of these procedures are deprecated; the preferred method in most cases is to use the GUI.

Some commands in the recipes are there only to keep the GUI from getting confused. Commands and options only used to coordinate the command line process with the GUI process are shown in italics.

Prepare to observe using the GUI

Ideally, you should be following the procedures page instead of this cookbook.

mt> startDa -murmur
Show the window with the murmur log.
mt> ptConnect
Establish a connection to TCS and the filter wheel box.
mt> initNight -poolInit
Initialize the pool. This will erase everything on the pool!
mt> initializeTelescope
Initialize TCS, making sure it has the right date and time.
mt> iack
Initialize the camera.
mt> startupGUI
Start the GUI.

Shutting down MOP

Ideally, you should be following the procedures page instead of this cookbook.

mt> shutdownGUI
Close the GUI, making sure semaphores and everything are happily cleaned up.
mt> exit
exit MOP.

Autofocus

mt> setAutoFocus -on
turns on autofocus, and
mt> setAutoFocus -off
turns it off.

When autofocus is on, each time takeSequence is run using the -checkForStars option (or a sequence is observed from the GUI), MOP will examine the r exposure and make a focus adjustment, if necessary, based on the ellipticity of the stars in that exposure.

Changing the focus

For more complete description including how to determine the proper focus, see the "Focus the telescope manually" recipe.

mt> focusPT $desiredFocus
where $desiredFocus is the desired focus value. Sets the focus on the PT properly.

Initialize the filter wheel box

This needs to be done every time the filter wheel box is power cycled or rebooted.

mt> fack
initialized the filter wheel box.

Initialize the CCD

mt> initializeCCD -cleanCCD -informGUI
Initialize the CCD, and clears off extra charge.

Taking dome flats

After using TCS to point the telescope at the dome screen,

mt> fflamp on
turns on the flat field lamp.
mt> doDome $numberOfDomeSequences
takes $numberOfDomeSequences sequences of 5 exposures of dome flats.
mt> fflamp off
turns off the flat field lamp.

Taking bias frames

mt> doBias $desiredNumberOfBiasFrames -informGUI
takes $desiredNumberOfBiasFrames bias frames.

Taking twilight flats (manual method)

mt> pointToTwilight
determines the ideal position for taking twilights and slews the PT there.
mt> doTwilight $filter $exposureTime -informGUI
takes an $exposureTime second exposure through the $filter filter. The header and mdReport entry will be appropriate for a twilight exposure. After the completion of the exposure, MOP automatically calculates the count level of the exposure and cleans the CCD if it is over-exposed. At the conclusion of the exposure, the telescope position is offset by 30 arcseconds, to prevent contaminating stars in consecutive exposures from appearing in the same place in each twilight frame.

If the GUI is used to keep the log, the exposure level will be reported there.

Repeat doTwilight for each desired twilight frame.

Taking twilight flats (automatic method)

mt> autoTwilight -informGUI
slews to the twilight position and takes a series of twilight exposures. By default, it attempts to obtain 5 good twilight exposures in u. It begins by continually taking 1 (in the evening) or 30 (in the morning) second exposures until there are two consecutive exposures at acceptable flux levels. At this point, it creates a model from the good exposures, and uses that model to determine future exposure times.

The filter, target number of exposures, initial exposure time, and maximum number of attempts before giving up are all optional parameters; see the autoTwilight help string for more detail.

Slewing the telescope

To slew the PT to a desired set of coordinates:

mt> ptConnect
Establish a connection to TCS. If one is already established you can skip this, of course.
mt> nextObject $RAhours $RAminutes $RAseconds $decDegrees $decMinutes $decSeconds $epoch
Ask TCS to prepare to slew to the given set of coordinates. Note that the different elements in the coordinates are space separated, not ":" separated. For example to slew an object with J2000 coordinate of 12:30:39.4, 12:23:28.0, one would use this command:

mt> nextObject 12 30 39.4 12 23 28.0 2000

After this command completes, you should see the coordinates you entered (as well as the airmass of these coordinates) listed as destination coordinates on the TCS display, and TCS should further report that it is "ready to slew."

mt> dfmSlew
Once the coordinates are loaded with nextObject, dfmSlew will actually sent the telescope there. (If the coordinates are too obnoxious, TCS may refuse.)
mt> dfmCoords -informGUI
dfmCoords updates MOP's internal array, dfmData, keeping track of where the telescope is. This step is not necessarily essential, because most procedures which require that this array be up to date force an update when they are run.

Taking ad exposure or sequence of exposures

To take an exposure (or sequence of exposures) and record appropriate values in the header and mdReport file:

mt> ptConnect
Establish a connection to TCS and the filter wheel box. If one is already established you can skip this, of course.
mt> setTarget
setTarget interactively queries the user for some parameters of the observation, and places those values in the targetData variable. The prompt provided is the name of the index of targetData which that prompt sets. These parameters are:
name
The name of the target, used for the fits header. Stored in targetData(name).
flavor
The flavor of the observation, used in the mdReport file and fits header. Stored in targetData(flavor).
ra
The R. A. of the target, in decimal degrees, used (at one time) in the mdReport file and fits header. In recent versions, the value entered here will be ignored in favor of coordinates read from TCS. Stored in targetData(ra).
dec
The declination of the target, in decimal degrees, used (at one time) in the mdReport file and fits header. In recent versions, the value entered here will be ignored in favor of coordinates read from TCS. Stored in targetData(dec).
epoch
The epoch of the ra and dec coordinates entered above. Stored in targetData(epoch).
filterList
The (space separated list) of filters through which to take exposures, one per exposure, in order. If you only wish to take one exposure, just enter the filter name. Sets the value of targetData(filterList).
exposureList
The (space separated list) of exposure times for the desired exposures, one per exposure, in order. If you only wish to take one exposure, just enter the filter name. Sets the value of targetData(filterList).
mt> takeSequence
Actually take the sequence of exposures.

Example: take an exposure of M87

To take a 10 second exposure of M87 in r:

mt> ptConnect
Establish a connection to TCS and the filter wheel box.
mt> nextObject 12 30 39.4 12 23 28.0 2000
Tell TCS where it will be slewing to.
mt> dfmSlew
Tell TCS to send the telescope there. Wait for it to get there.
mt> HMSToDeg 12:30:39.4
Convert the R. A. to degrees using astrotools utilities built into MOP. See the astrotools documentation.
mt> DMSToDeg 12:23:28.0
Convert the declination to degrees using astrotools utilities built into MOP. See the astrotools documentation.
mt> setTarget
Set the parameters for the observation. Where user input is in italics:

name: [] M87

flavor: [] Man

ra: [] 187.664166

dec: [] 12.39111

epoch: [] 2000

filterList: [] r

exposureList: [] 10

mt> takeSequence -informGUI
Actually take the exposure.

Observe a standard field (a FK5 star, Primary field or Secondary patch)

Coordinates, exposure times, and the other necessary information for observing a target field are stored in the mtstds product. The following sequence of commands can be used to observe one of these targets.

mt> loadStandards
Loads the data on primary and secondary fields from the appropriate files in the mtstds product: $MTSTDS_DIR/fk5/fk5mt.abridged, $MTSTDS_DIR/primary/priFieldCenters-APO20.par, $MTSTDS_DIR/secondary/mt_patch.par,and $MTSTDS_DIR/priFieldContents-APO20.dat. Information on these targets is loaded into the targets global array, and the name of the targets are appended to the global tcl list targetList.

If loadStandards has already been executed in the MOP process, you usually should not do it again. If for some reason you feel you need to (if, say, you edited the contents of tergetList and want to set it back to the defaults), use the -replace option to completely reset the relevant arrays.

If you wish to load the priorities of secondary patches (and all parameters of secondary patches not contained in the mtstds product), you can use the -readMOPDB option.

mt> listTargets $targetName
where $targetName is the name of the target field to be observed. listTargets will list a number of parameters for a target or list of targets, one line per target. Verify that the airmass (the third column) is reasonable.
mt> nextTarget $targetName
where $targetName is the name of the target field to be observed. It must be one of the elements in targetList. Verify that TCS is prepared to slew to the desired field.
mt> dfmSlew
Slew to the field.
mt> takeSequence -informGUI
Take the sequence of observations appropriate to that target. (nextTarget sets the values of targetData, set interactively in the "Taking an exposure or sequence of exposures" instructions above, from values loaded from the mtstds product and stored in the targets array.)

Note that if you use the -doit switch on nextTarget, it will go ahead and do the slew and take the sequence.

Observe a manual target field loaded from a file

Observing a manual target loaded from a file follows the same procedure as observing a standard field, except that the file with the manual target must be loaded. So instead (or in addition to) loading the observation parameters using loadStandards, load the file with the desired manual target(s) using

mt> loadTargets $fileName
which will load the targets in file $fileName.

Observe a list of targets in succession

Observing a list of targets using this method should still work, but using the GUI is a much better method. The doTargetList procedure cannot presently play nice with the GUI.

mt> set plannedTargets [list $target1 $target2 $target3 $target4]
where $target?s are the targets to observe, in order. There can be any number of targets.
mt> listTargets $plannedTargets -projectAirmass
lists a table of information on the planned targets. The -projectAirmass option causes listTargets to use extrapolated times of observation.
mt> doTargetList $plannedTargets
slews to and takes a sequence of exposes on each target in turn. Between each sequence, it checks to see if the file "stopnow" exists in the current directory, and aborts if it does. Yes, this is an ugly hack.

Correct the pointing

First, take an exposure of an FK5 star using the "Observe a standard field" recipe above. To determine a suitable FK5 field, you may need to substitute the listTargetsWithAirmass procedure:

mt> listTargetsWithAirmass 1.0 1.2 FK5
which lists the important information (in the same format as listTargets) for all FK5 star targets with a current airmass between 1.0 and 1.2

for the listTargets commands described in that recipe.

Take note of the exposure number; it will be printed by the takeSequence command, and reported in the logViewer (if the -informGUI options is used).

Then, determine the coordinates of the FK5 star in that image:

mt> set pointingImage [quickDisplay $exposureNumber -debais]
brings up an fSAOimage displaying the desired image. See the "Display an image" recipe for more details on quickDisplay. The handle of the region containing your image is now stored in $pointingImage.
Position the cursor over the FK5 star in the displayed image, and record the row and column. Then,
mt> centerThis $row $column
offsets the telescope so that a star at $row, $column would be appear in the center of the CCD if an exposure were taken.
mt> zpointTarget $targetName
where $targetName is the name of the FK5 field at which you are currently pointed, tells TCS the PT is currently pointed directly at $targetName, and that it should correct the pointing appropriately.
mt> regDel $pointingImage
deletes the region holding our image, now that we are done with it.

Focus the telescope manually

This can be done while the telescope is pointing anywhere with stars. There is some dependence of focus on zenith distance, so taking a focus frame with a zenith distance typical of your targets is a good idea.

mt> doFocus $startingFocus 10 -informGUI
will take a focus frame. $startingFocus should be the highest focus value considered. The focus frame consists of 5 offset exposures, each offset by 1 focus setting. A larger offset separates the last and second to last (with the lowest and second lowest focus values) allowing on to easily distinguish which image corresponds to which focus value. Note the exposure number of the focus frame; it will be printed in the terminal, and will appear in the logGUI if the -informGUI switch is used.
mt> set focusImage [quickDisplay $exposureNumber -debais]
brings up an fSAOimage displaying the desired image. See the "Display an image" recipe for more details on quickDisplay. The handle of the region containing your image is now stored in $focusImage. The image in best focus should be the sharpest and also the roundest.
mt> focusPT $newFocus
where $newFocus is the desired focus as determined by examining the image, properly changes the current focus of the PT.
mt> regDel $focsuImage
removes the focus image from memory now that we are done with it.

Display an image

mt> quickDisplay $exposureNumber -delete -debias
displays the exposure with the requested exposure number in an fSAOimage. Note that it takes the exposure number, not the file name. It will bring the file over from the pool if necessary, and so the user does not have to wait for the teamster.

The -delete option deletes the region (allocated memory) in which the image is stored after it is displayed. If you with to do more with the image than just display it, leave off this option and quickDisplay will return the region handle. Remember to delete the region when you are done with it (using regDel).

The -debias causes quickDisplay to do a quick and dirty debias on the image after loading it.

If exposures taken on an MJD other the the current on must use the -mjd option to tell MOP where to look for the image.

Automated exposure checking

When MOP begins to complain about "no (in focus) stars in field," or the auto focus seems to be doing strange things, it can be instructive to run by hand the routine MOP uses to check exposures:

mt> checkForStarInField $exposureNumber -verbose
Where $exposureNumber is the exposure number of the exposure to check. If the -verbose option is left off, it simply returns the number of stars it finds in the image that meets its roundness criteria for in focus stars. When included, it prints information (location, sky background, FWHM of the major axis and minor axis, whether or not MOP classifies it as a star) on each peak it finds in the central 512 by 512 region of the image. (The regions size may be tuned using the -subregionSize switch.) It then prints a list of the axis ratios of the stars found, the index of the star with the median axis ratio, and the median axis ratio itself. This is what MOP uses to determine if the image is in focus.


Last edited by Eric H. Neilsen Jr., 6/29/2001