User Tools

Site Tools


public:catalinas:bigelow:kuiper_61:mont4k:watcher

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

public:catalinas:bigelow:kuiper_61:mont4k:watcher [2019/06/07 11:39]
davner created
public:catalinas:bigelow:kuiper_61:mont4k:watcher [2024/09/19 16:36] (current)
egreen updated
Line 1: Line 1:
-Postprocessing with Watcher and Merge4k+                       Postprocessing with watcher and merge4k
  
-Watcher is a script that automatically converts each incoming Extended FITS images from bigccd into a normal FITS image on Gerard, using merge4k, then displays the newly merged fits image in the ds9 window.  After the image is displayed, watcher can also optionally execute any other script that the observer wishes to run.  +watcher is a script that automatically converts each incoming extended FITS images from bigccd into a normal (single) FITS image on gerard using merge4k, then displays the newly merged fits image in the ds9 window.  After the image is displayed, watcher can also optionally execute any other script that the observer wishes to run.  
  
-(Note that the previous quicklook display had fatal bugs, so it is currently turned off by default at startup; you can also turn it off by typing "quicklook off" in any window.) +In order to keep watcher from crashing due to interference from iraf processes in other windows, watcher starts up in separate watcher subdirectory (/home/bigobs/watcher/with its own uparm subdirectory.  
- +
-In order to make watcher more robust - so it doesn't crash due to interference with processes in other windows, misses fewer incoming images, etc - a watcher subdirectory has been created with its own separate uparm directory.  +
  
 To start watcher correctly, open a terminal window, and type  To start watcher correctly, open a terminal window, and type 
 +  ./watcher_window
  
-./watcher_window+This pops up a new IRAF window starting in the watcher subdirectory, with the tasks and definitions that watcher needs already loaded.  It is also useful to type "cl < mont4k.tasks" in the gerard home directory when you open other iraf windows you may use with your images.
  
-This will pop up a new IRAF window that is already cd'ed to the watcher subdirectory.  In this window, the tasks and definitions that watcher needs are already loaded.+If you aren't running an optional post-processing script, either epar watcher to set extras="" or else type watcher.extra=""
  
-lpar watcher+If you're observing light curves, you should set extras = auto_plot, and epar auto_plot to customize it for your target. (You can see the results in a separate iraf window with "!tail -f auto_plot.log")
  
-If you don't want to run an optional script, either epar watcher to set extras=""or else type +Before starting watcher, cd to your data directory - this MUST be the same directory where bigccd will send the images - and start watcher: 
 +   watcher . 
  
-watcher.extra="" +As each new image is transferred to gerardwatcher will run merge4k on that image. merge4k converts/combines the raw extended FITS images into a normal single FITS image, after first correcting each side separately for the crosstalk and subtracting the two overscan regions.  The original extended FITS image is saved in a subdirectory named "raw", and the merged image is renamed with same name in the original directory.  After merge4k has finished with the image, watcher displays the combined image in the ds9 window, optionally runs the requested extra script, then starts watching for the next image.  
- +
-If you're doing light curves, you should set extras = auto_plot +
- +
-You can either cd to your data directory first (the same directory where bigccd will send the images ) and type +
- +
-watcher .  +
- +
-Or just type watcher +
- +
-and it will request the name of your data directory.  You may specify the directory names in full, or relative to /home/bigobs (e.g. "sdb/15mar11/hwvir.raw") or relative to your current directory (e.g. "." or "../16mar11"/pg1336.raw). +
- +
-Watcher will announce "watcher started" Then it will sit and wait for a new image to be transferred to Gerardwhereupon it will run merge4k on that image.   Merge4k converts/combines the raw Extended FITS images into a normal single FITS image, after first correcting each side separately for the crosstalk and for the overscan regions.  The original Extended FITS image is saved in a subdirectory named "raw", and the merged image is renamed to have the same name in the original directory.  When mere4k is completed for that image, the watcher script will display the image in the ds9 window, optionally run the requested extra script, then start watching for the next image.  +
  
 It is useful to reduce the watcher window to a few lines in height and place it under the ds9 image, so that you can see what it's doing as it detects, converts, and displays your images.  It is useful to reduce the watcher window to a few lines in height and place it under the ds9 image, so that you can see what it's doing as it detects, converts, and displays your images. 
  
-If you need to stop watcher, type control-c in the watcher window, followed by a flpr or two. +If you need to stop watcher, type control-c in the watcher window, followed by a flpror better: flprflpr
- +
-Merge4k was written to work properly with images of arbitrary numbers of columns and rows and binningit reads the header and works with whatever image size and binning exist.   +
- +
-=> Until the version of IRAF running on Gerard gets updated, you will see that 3x3 binned images are 1365 pixels in the x direction instead of 1364; there is an extra (junk) column on the far right +
- +
-Every now and then, watcher will miss an image.  You can discover whether this has happened to any of your images by typing: +
- +
-imhead *.fits | grep FX+
  
-Any unmerged or improperly merged images give an error that looks like: <image_name>:FXF: must specify which FITS extension (<image_name> All you have to do is to run merge4k on the images manuallyeg:+The current version of IRAF has a bug that would cause watcher to crash spectacularly; a memory limit is set too low to allow watcher to indefinitely run the loop that looks for new images.  The pragmatic fix is to have watcher stop itself cleanly every 200+ images, after printing out a message telling the user to hit the up-arrow key and restart watcher.
  
-merge4k <image_name>+  
 +merge4k was written to work properly with images of arbitrary numbers of columns and rows and binning; it reads the image header and works with whatever image size and binning exist.  
  
-Merge4k can be run in any IRAF window (where tasks can be loaded).+=> The M4K CCD is read out by two amplifiers; there are a few unread columns between the two sides of the CCD which are not read out, so one should either avoid placing targets of interest on the center seam or dither the telescope position with multiple exposures; 1x1, 2x2 and 4x4 binned images don't show the missing columns; 3x3 binned images have one "zero" column between the two sides of the image (although the area of missed sky is somewhat wider than the single displayed empty column).
  
-If you find an image that is damaged or unreadablefirst check to see if the original image made it to the raw subdirectory+If gerard is very busy (especially if it's running firefox), watcher will (rarely) miss an image.  At the end of the night, check to see whether all of your images were merged by typing "imhead *.fits | grep FX" Any unmerged image will produce an error of the form "<image_name>:FXF: must specify which FITS extension (<image_name>)" Rerun merge4k on the image manually in the watcher window (or in any iraf window where mont4k.tasks was defined): 
 +  merge4k <image_name>
  
-dir raw/<image_name>+If you find an image that is damaged or unreadable (again, rare but possible if gerard is running lots of other tasks), check to see if the original image made it to the raw subdirectory: 
  
-If it is there, you can almost always successfully reprocess that image by moving the raw image to the observing directory and reprocessing it.  +  dir raw/<image_name>
  
-del <image_name> +If the raw image exists, you can usually successfully remerge it by deleting the botched image in the observing directory, moving the raw image back up from the raw subdirectory to the observing directory and rerunning merge4k on it: 
-rename raw/<image_name>+  del <image_name> 
-merge4k <image_name>+  rename raw/<image_name>
 +  merge4k <image_name>
public/catalinas/bigelow/kuiper_61/mont4k/watcher.1559932790.txt.gz · Last modified: 2019/06/07 11:39 by davner