On Fri, 20 Aug 2010, Adam Ginsburg wrote:
> First, Re: nanahope Splat not starting: Thanks for the addition to the
> install page, Peter.
>
> A question about usage - is there a good way to apply a filter to
> multiple spectra simultaneously? As far as I can tell, I have to click
> "Filter" or "Filter (replace)" once per spectrum. Since I have a series
> of many oversampled spectra I'd like to compare, this is tedious. I
> gather that it should be possible to write a script similar to
> $SPLAT_DIR/fitgauss, but since this seems like it would be a common task
> I was hoping someone had already written it. If not, is there a good
> reference for the scripting language, in particular one that would
> include the commands from the filtering window?
Hi Adam,
if you understand Beanshell/Java and can work from that example then the
internal classes of SPLAT should be exposed in:
showme -f $STARLINK_DIR/starjava/docs/splat/javadocs/index.html
look for the Filters in the uk.ac.starlink.splat.util package and the
SpecFilter class in uk.ac.starlink.splat.iface. The source code for SPLAT
is at:
http://starjava.jach.hawaii.edu/viewvc/trunk/splat/src/main/uk/ac/starlink/splat/
for examples about how I use these classes in Java (see SpecFilterFrame).
Having said all that, if you just want to do this quickly you'd probably
be better of just writing a simple KAPPA script and displaying your
spectra in a normal graphics windows. I've attached a simple sh script
that accepts a list of NDFs (simple to fix up for FITS), which it smooths
and displays. Press <Return> to move on to next.
Have fun,
Peter.
(ps, going offline for a while so you're on your own)
#!/bin/sh
# Filter and plot all the spectra given on the command line.
if test "$1" = ""; then
echo "usage: $0 spectrum1 spectrum2 ..."
exit
fi
xmake xwindows -width 900 -height 600 -geometry 900x600
# Uncomment the following to display FITS spectra.
#. $CONVERT_DIR/convert.sh
$KAPPA_DIR/gdclear device=xwindows
for f in $*; do
# Strip file extension (assumes you have NDFs, change .sdf to .fits if needed).
b=`echo $f | sed 's,.sdf,,'`
echo "Processing: $b"
$KAPPA_DIR/gausmooth in=$f out=${b}_sm fwhm=5 accept
$KAPPA_DIR/linplot ndf=$f clear=true device=xw style="colour(curves)=green"
$KAPPA_DIR/linplot ndf=${b}_sm clear=false device=xw style="colour(curves)=red"
read ok
done
exit
|