# include # include # include # include "../stis.h" /* Update switch values with 'COMPLETE' in output header. The following switch keywords are to be updated in the output table's primary header from 'PERFORM' to 'COMPLETE': X1DCORR DISPCORR BACKCORR HELCORR FLUXCORR SC2DCORR but only if the input file contains any of the keywords set with the value 'PERFORM'. Returns silently in any case. Revision history: ---------------- 04 Aug 00 - Moved to its own source file (I.Busko) */ void UpdHdrSwitch (char *keyword, Hdr *hdr) { char keyw[STIS_CBUF], value[STIS_CBUF]; int Get_KeyS (Hdr *, char *, int, char *, char *, int); int Put_KeyS (Hdr *, char *, char *, char *c); int streq_ic (char *, char *); /* Can't use UpperAll from library because it is static... */ if (strcasecmp (keyword, "x1dcorr") == 0) strcpy (keyw, "X1DCORR"); else if (strcasecmp (keyword, "dispcorr") == 0) strcpy (keyw, "DISPCORR"); else if (strcasecmp (keyword, "backcorr") == 0) strcpy (keyw, "BACKCORR"); else if (strcasecmp (keyword, "helcorr") == 0) strcpy (keyw, "HELCORR"); else if (strcasecmp (keyword, "fluxcorr") == 0) strcpy (keyw, "FLUXCORR"); else if (strcasecmp (keyword, "sc2dcorr") == 0) strcpy (keyw, "SC2DCORR"); else return; if (Get_KeyS (hdr, keyw, 1, "", value, STIS_CBUF)) return; if (strlen (value) == 0) return; if (streq_ic (value, "PERFORM")) { if (Put_KeyS (hdr, keyw, "COMPLETE", "")) return; } }