#!/bin/bash # # Note: This is *not* used for importing data any more. # res/liesgrammar.f now does what this was intended for. # # A port/modification of the old "run" tcsh script. # This is to be called with a catpv; it will then create a temp dir, # copy over the necessary files, compile the matcher, arrange the # runs, and finally copy the *.id and *.nid to the original catpv directory # # You must have run make in arigfh/ident/identframe for this to work # You must have a directory arigfh/run/refcats for this to work, # containing the reference catalogs mentioned in Libuse.f, subroutine data set -e die() { echo $* exit 1 } if [ t`echo "$1" | grep "^t[0-9][0-9][0-9][0-9]p[0-9][0-9]$"` != "t$1" ]; then die "Usage: $0 catpv (i.e., tnnnnpnn)" fi # GFHROOT is normally set by ident-all, but fall back for stand-alone op. if [ -z $GFHROOT ]; then GFHROOT=`gavo config inputsDir`/arigfh fi CATSRC=$GFHROOT/cats/arigfh/$1 echo echo "***** Id'ing $1" cd $GFHROOT/run rm -rf gfhtmp mkdir gfhtmp cd gfhtmp cp $CATSRC/{katalog,lies.f,input} . cp $GFHROOT/ident/identframe/main.f . # we should have parallel options here and in identframe/Makefile. Hm. cat < Makefile %.o: %.f gfortran -finit-local-zero -g -std=legacy -c \$< identify: lies.o main.o gfortran -o \$@ \$^ -L $GFHROOT/ident/identframe -lidfuncs EOF make ./identify > ident.protocol echo echo "***** Done id'ing $1" if grep "^@" ident.protocol > /dev/null; then grep "^@" ident.protocol else echo "########## Alarm: No identifications" fi for idfile in id1.id id2.id id3.id; do if [ -f $idfile ]; then cp $idfile $CATSRC/$idfile.new fi done # only copy last nidfile (the previous ones contain the same # stars plus some that were identified at later stages) cp `ls *.nid | sort | tail -1` $CATSRC/idfailures.nid