#!/bin/bash

for im0 in */*.fit;do
  field=`dirname $im0`
  im=`basename $im0`
  cat=${im%.*}.cat
  info1=`gethead $im0 DATE-OBS MJD EXPTIME CCDTEMP CRVAL1 CRVAL2`
  info2=`grep $cat quality.txt|awk '{print $4,$5,$7}'`
  echo $field $im $cat $info1 $info2 >> obs.txt
done

  
