# include # include "../acs.h" /* This function parses the CCDAMP string from the image header and returns a new string which only specifies those amps used by the CCDCHIP being processed. */ void parseWFCamps (char *acsamps, int chip, char *ccdamp) { /* Parameters: char *acsamps i: keyword from image header int chip i: value of CCDCHIP from image header char *ccdamp o: string with amps used by chip */ int i,j,k; int out_max; char wfcamps[3]; i = 0; k = 0; out_max = 2; wfcamps[0] = '\n'; /* Set up string of possible amps used with the chip */ if (chip == 1) strcpy (wfcamps,AMPSTR1); else strcpy (wfcamps,AMPSTR2); /* Pick out only those amps actually used... */ for (j = 0; j < out_max ; j++) { if (strchr (acsamps, wfcamps[j]) != NULL) *(ccdamp+j) = *(acsamps+j); } /* Null terminate the string... */ *(ccdamp + out_max) = '\0'; }