#!/bin/sh # Run the real pix2wcs script using the gaia_swish binary. # The gaia_swish binary runs the gaiaMain.tcl script as soon as it # starts, so the only way we can stop GAIA from running up is by # replacing the commands that gaiaMain invokes. # Need a directory to put all the files we need. Use /tmp. script_dir="${TMPDIR:-/tmp}/pix2wcs${USER}$$" if test -f ${script_dir}; then \rm -r -f ${script_dir} fi mkdir -p ${script_dir} # Local directory is GAIA_LIBRARY so that we can pick up Tcl code. GAIA_LIBRARY=${script_dir} export GAIA_LIBRARY # Make sure we remove this all on exit. trap 'rm -r -f ${script_dir};exit' 0 1 2 3 9 15 # Add the intermediary files we need. # # - tclIndex cat > ${script_dir}/tclIndex < ${script_dir}/GaiaImageName.tcl < ${script_dir}/GaiaProperties.tcl < ${script_dir}/pix2wcs.real < -1 } { set nitems [llength \$line] if { \$nitems > 0 } { foreach {x y} \$line { incr id \$rtdimage convert coords \$x \$y image ra dec wcs puts \$outfile "\$id\t \$ra\t \$dec\t \$x\t \$y" } } } close \$infile close \$outfile exit EOF #- start_script echo > ${script_dir}/start_script.tcl 'itcl::class gaia::Gaia {' echo >> ${script_dir}/start_script.tcl ' public proc startGaia {} {' echo >> ${script_dir}/start_script.tcl " source ${script_dir}/pix2wcs.real" echo >> ${script_dir}/start_script.tcl ' }' echo >> ${script_dir}/start_script.tcl '}' # Now run up script. $GAIA_DIR/gaia_swish $* exit