#!/bin/csh -f #+ # pmfm -- set/show the amount of focus mode in the telescope primary # # Purpose: # With no argument, show the currently amount of primary mirror # focus mode. With a argument, set the amount of primary mirror # focus mode to the specified number of nanometers. # # Usage: # pmfm [x] # # Arguments: # x = amount of "focus mode" to introduce [nanometers] # # Exit values: # 0 = normal completion # 1 = wrong number of arguments # # Example: # 1) show the current amount of pmfm: # pmfm # # 2) apply 500 nm of primary mirror focus mode: # pmfm 500 # # 3) make pmfm change in background: # pmfm 500 1) then echo "Usage: pmfm [x]" exit 1 endif if (${#argv} == 1) then set want = $1 shift endif set rcmd = "rsh k2server -l k2ruts" # set/show the amount of pmfm... if ( $?want ) then while (1) $rcmd modify -s acs pmfm = $want set buf = `$rcmd show -s acs -terse pmfm` set got = `calc "nint($buf)"` set want2 = `calc "nint($want)"` if ( "$got" == "$want2" ) break printf "[$cmd] WARNING: requested PMFM=$want but got PMFM=$got -- trying again!\n" sleep 1 end else $rcmd show -s acs -terse pmfm endif