/* Copyright (c) 1993 Association of Universities for Research * in Astronomy. All rights reserved. Produced under National * Aeronautics and Space Administration Contract No. NAS5-26555. */ /* GETHDR * * PURPOSE: * Routine to read FITS header into structure using file name and * location information already in header structure. * * CALLING SEQUENCE: * retval=gethdr(h) * * INPUTS: * h (* Header) header structure * * OUTPUTS: * h modified to include all header info for this plate * retval returns 0 if successful, -1 to indicate error * * MODIFICATION HISTORY * Created from scratch, R. White, 5 August 1991 * Modified to handle VMS fixed length records, R. White, 16 June 1992 * Modified to handle Ultrix uppercase filenames, R. White, 26 May 1993 */ #include #include #include #include "qfile.h" #include "header.h" extern void readhdr(); extern int gethdr(h) Header *h; { char *filename; QFILE *infile; /* * create filename from header_dir (directory pointer) and plate_name */ filename = malloc(sizeof(h->header_dir)+sizeof(h->plate_name)+4); strcpy(filename, h->header_dir); strcat(filename, h->plate_name); #ifdef ULTRIX strcat(filename, ".HHH"); #else strcat(filename, ".hhh"); #endif /* * open file with 80 byte records, no carriage control */ infile = qopen(filename, 80, 0); /* * read header */ readhdr(infile, h); qclose(infile); free(filename); return(0); }