John's Special Python Scripts

Updates

On 20150207, the name_hdfextract.py scripts have learned the path to older telemetry downtown. For telemetry from current until ~2 months old, you can use them on any mountain workstation from /home/lbcobs/supportscripts/TelemetrySupport/. For telemetry from ~2 days old until ~2 years old, you can use them on shell.tucson.lbto.org (where older telemetry is stored) from /home/jhill/supportscripts/TelemetrySupport/.

With the advent of HDF-based telemetry on 20130131, a new set of scripts name_hdfextract.py have been implemented. The name_webextract.py scripts are still functional for older data as long as the MySQL database remains intact.

The various name_telextract.py scripts have been replaced by name_webextract.py scripts to use the current version of telemetry extraction (2011). The various display scripts like Guider have been replaced with sided names like Left_Guider (2011).

Plotting tool for observers

LBTplot.py

(Nov 2012) I'm pleased to announce the availability of an on-the-fly plotting GUI for making plots of TT Offloads (from tcslog), Guiding Statistics for SX/DX/LBC (from tcslog), DIMM measurements (from telemetry) and Telescope Temperatures (from telemetry). The main improvement over previous individual scripts that make similar plots is that this GUI auto-refreshes the plots at specified intervals.

To launch the GUI on the mountain workstations:

/home/lbcobs/supportscripts/ObserverSupport/LBTplot.py

(You will want to make an alias.)

Then click the button to display the plot you want. WARNING: Some plots will fail during the daytime - e.g. when there is no guiding data, dimm data, etc.

Default settings are to plot data for the last hour, and to refresh the plot every 45 seconds. Command line flags are available to set the lookback time and the refresh interval or a specific plot. A spin button on the GUI can also adjust the lookback time.

lbcobs@obs1 ~/supportscripts/ObserverSupport$ ./LBTplot.py -h

   Example:  ./LBTplot.py  -b -12.0   (makes a plot of the last 12 hours)
   command line arguments for plotting
    -b TIME or --backhour TIME  lookback time in UT hours (default -1)
    -r TIME or --refresh TIME   refresh interval in seconds (default 60)
    -h or --help                print this help message

The window is resizable by dragging the corner. The plots are generated at 1500x1000 pixels and then rescaled to fit your window.

The LBTplot GUI is safe for multiple users on the same or different workstations. You can safely run multiple copies of the LBTplot GUI making different plots, but running multiple copies as one user making the same plot could get you in trouble (crashing the plotting scripts).

Python scripts for making telemetry plots

daq_hdfextract.py

This Python script extracts temperature telemetry and makes a plot of the telescope temperatures for the current day. It leaves a JPEG image in /tmp that can be viewed with a web browser or with the eog tool. Solid lines = steel; dotted lines = air, dashed lines = mirror (glass or air).

>>> ./daq_webextract.py -h
Example:  ./daq_webextract.py  -b -12.0   (makes a plot of the last 12 hours)
general command line arguments for plotting
 -d YYYMMDD or --day YYYYMMDD date to plot (default today)
 -e TIME or --endhour TIME    end time in UT hours (default now)
 -b TIME or --backhour TIME   hours before end time (default 24)
 -x '[XMIN,XMAX]' or --xlimits '[XMIN,XMAX]' plot range (IDL style)
 -y '[YMIN,YMAX]' or --ylimits '[YMIN,YMAX]' plot range (IDL style)
 -s XX or --side XX           which mirror side to plot SX/DX
detailed arguments to control script behaviour
 -p or --plotonly             make plot but don't extract new telemetry
 -n or --nodisplay            extract new telemetry but don't plot
 -m or --mute                 don't display the plot with eog
 -o DIR or --outpath DIR      put plot files in this directory path
 -h or --help                 print this help message

The script lives in /home/lbcobs/supportscripts/TelemetrySupport/ on the mountain workstations.

Cron tasks running these scripts make plots at regular intervals in /home/jhill/public_html/xplot/plots/.

dimm_hdfextract.py

Works the same as daq_hdfextract.py, but plots the seeing values measured by the DIMM.

pmc_hdfextract.py

Works the same as daq_hdfextract.py, but makes a plot with more detail about mirror temperatures and mirror ventilation.

psfm1_hdfextract.py

psfm1tt_hdfextract.py

psfm2_hdfextract.py

psfm2tt_hdfextract.py

focusm1_hdfextract.py

zernlo_hdfextract.py

zernlo_hdfextract.py

zeello_hdfextract.py

mcspu_hdfextract.py

Use this one very carefully as it can consume massive quantities of disk space!

Other Python scripts

ptspiral - Spiral Search from the TO-station

Steve has added the spiral function to his PointNear GUI, so this script will rarely be used.

A faster and easier way to make a spiral search is to use the script /home/lbcobs/supportscripts/ObserverSupport/ptspiral.py which applies offsets to the pointing zeropoints IE and CA directly. On a machine (to-station) that is running TCS, say ptspiral and ^C the script when you see the star. Command line arguments are available to control the pitch and the total extent of the spiral, say ptspiral -h to see the options. If the spiral completes without a ^C, then the pointing zeropoints are restored to the starting values.

ptspiral -h
Example:  /home/lbcobs/supportscripts/ObserverSupport/ptspiral.py  -p [xx] -m [mm]
command line arguments
 -p [xx]                spiral pitch in arcsec
 -m [mm]                number of half spiral loops
 -d [ss]                sleep delay in seconds
 -s [0/1/2]             left/right/both binocular side (ignore for none)
 -h or --help           print this help message

Use -s flag for the equivalent binocular function of ptspiral. Binocular spiraling is significantly faster if you use side "both" to move the mount.

guideplot - On-the-fly plots of guiding performance

I made a Python+IDL script for making plots of guiding (FWHM, ellipticity, flux) as a function of time. You can try it as:

/home/lbcobs/supportscripts/ObserverSupport/guideplot.py -s SX

Users telescope, lbcobs and LBTO have aliases in their .cshrc file so they need only say:

guideplot

or if you want to plot SX last night for 2 hours before 10:30 UT:

guideplot -d 20120211 -e 10.5 -b 2.0 -s SX

or to see all the flags:

guideplot -h

Example:  /home/lbcobs/supportscripts/ObserverSupport/guideplot.py  -b -12.0   (makes a plot of the last 12 hours)
general command line arguments for plotting
 -d YYYMMDD or --day YYYYMMDD date to plot (default today)
 -e TIME or --endhour TIME    end time in UT hours (default now)
 -b TIME or --backhour TIME   hours before end time (default 24)
 -x '[XMIN,XMAX]' or --xlimits '[XMIN,XMAX]' plot range (IDL style)
 -s XX or --side XX           which mirror side to plot SX/DX (default both)
detailed arguments to control script behaviour
 -p or --plotonly             make plot but don't extract new telemetry
 -n or --nodisplay            extract new telemetry but don't plot
 -m or --mute                 don't display the plot with eog
 -o DIR or --outpath DIR      put plot files in this directory path
 -h or --help                 print this help message

guidelbc.py - a version of guideplot for LBC guiding.

ttoffload.py - plots the tip, tilt, focus offloads requested by AOS.

hooffload.py - plots the HO offloads requested by AOS.

Guider, Left_Guider, Right_Guider

If you run the script /home/lbcobs/supportscripts/ObserverSupport/Guider.py, it will automatically launch a ds9 and display the latest guider images (at the moment any guider*fits image in /Repository/GCSfiles/dailyimages/). A different directory to watch may be specified as the first command line argument. Guider (appropriately aliased in the .cshrc file) also displays the acquisition image at the start of guiding. A second copy of the script Guider2 may be run to allow non-conflicting displays on the mountain and downtown simultaneously.

Acquire, Left_Acquire, Right_Acquire

If you run the script /home/lbcobs/supportscripts/ObserverSupport/Acquire.py, it will automatically launch a ds9 and display the latest acquisition image (at the moment any auto* image in /Repository/GCSfiles/dailyimages/). A different directory to watch may be specified as the first command line argument.

WFS, Left_WFS, Right_WFS

If you run the script /home/lbcobs/supportscripts/ObserverSupport/WFS.py, it will automatically launch a ds9 and display the latest wavefront sensor images (at the moment any wfs*fits image in /Repository/GCSfiles/dailyimages/). A different directory to watch may be specified as the first command line argument. A second copy of the script WFS2 may be run to allow displays on the mountain and downtown.

gotoWFS (now obsolete with GCS doing this automatically)

While the GCS guider is running, you can use the script /home/lbcobs/supportscripts/ObserverSupport/gotoWFS.py (on a machine where TCS is running) to drive the guiding hotspot to the location of the wavefront sensor (292,255). The script should ideally be executed while the guiding loop is running at 1 Hz or faster.

agw_collimate - Python wrapper which calls Doug's IDL routine

agw_collimate.py has been recast internally to call Doug's new routine collimate_multiple .

[telescope@obs2 ObserverSupport]$ ./agw_collimate.py -h
Example:  ./agw_collimate.py  -p /Repository -r -s
command line arguments 
 -n or --nodisplay      (not implemented)
 -p DIR or --path DIR   (not implemented)
 -s or --send           send corrections to PSF w/o asking
 -e or --exposure TIME  exposure time in seconds
 -f STN or --focal STN  name of focal station (LFBG or LDG)
 -l LOG or --log LOG    append to the following log file
 -h or --help           print this help message

agw_wfsc_multiple - Python wrapper which calls Doug's IDL routine (obsolete)

[telescope@obs2 ObserverSupport]$ ./agw_wfsc_multiple.py -h
Example:  ./agw_wfsc_multiple.py  -p /Repository -r -s
command line arguments (maybe not all implemented yet)
 -n or --nodisplay      don't display the image in LBCFPIA in idl
 -p DIR or --path DIR   look for files in this directory path
 -s or --send           send corrections to the mirror when science exposure arrives (not implemented)
 -e or --exposure TIME  exposure time in seconds
 -f STATION or --focal STATION    name of focal station ('LFBG' or 'LDG')
 -l LOG or --log LOG    append to the following log file
 -h or --help           print this help message

John's Special IRAF scripts

These IRAF scripts located in /home/LBTO/iraf are to do things that have not yet been implemented in LBTtoolsIRTC or are cheating around some problem that the other scripts don't handle.

Collect IRTC/AGw Transformation Data (mostly obsolete)

cl> transtar (3) where 3 is the guide star number. Fieldname and position angle are specified in the IRAF parameters.

transtar presets the telescope to the specified star using LBTtools.IRTC.pointto, then it reads the data from the AGW using the getdat scripts, then it uses LBTtools/IRTC/takeseq to collect IRTC data. The script lives in /home/LBTO/iraf/transtar.cl.

Take a sequence of IRTC Pointing Data

cl> gopoint (1) where 1 is the grid sequence number.

gopoint uses Pointingstars5 to select a star in the specified grid. Then it presets the telescope to the specified star using LBTtools.IRTC.pointto, then it reads the data from then it uses LBTtools/IRTC/takeseq to collect IRTC data. The ploop parameter will cause it to cycle onto the next grid sequence number. The script lives in /home/LBTO/iraf/gopoint.cl.

Spiral Search from IRAF (obsolete)

To take a series of images in a spiral pattern to locate the star when it missed the field of IRTC:

cl> cl < home$spiral.cl

This script does hardwired offsets on 30 arcsec centers. To make a slightly tighter spiral on 25 arcsec centers:

cl> cl < home$spiral25.cl

Watch on IRTC in movie mode or on the guider in ACQUIRE mode, and ^C the script when you see the star. This works in TRACK mode not in GUIDE mode. After you find the star, you need to back out your RADEC offsets that the script did while the operator replaces them with pointing corrections to IE,CA.

Sequences of Intra/Extra/Sky images (now obsolete)

A bug in Jose's GetImageSequence call crashes the LBTtoolsIRTC script takeEFpair.cl, so until that is fixed, you have to use "cl < inex_seq.cl" which does the same thing, but ignores error returns. You have to edit the script to change exposure time or the amplitude of the extrafocal offset.

-- JohnHill - 18 Apr 2008
Topic revision: r31 - 07 Feb 2015, JohnHill
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback