LIBFLAG(1) IFRSOFT LIBRARY LIBFLAG(1) NAME initFlag, putRecordFlag, putAntennaFlag, putBaselineFlag, putDataFlag, getRecordFlag, getAntennaFlag, getBaselineFlag, getDataFlag, getDataFlagGrid - editing functions for GMRT LTAfile. SYNOPSIS #include long initFlag(fp, scanNum) FILE *fp; int *scanNum; int putRecordFlag(recNum, flagType) int *recNum, *flagType; int putAntennaFlag(recNum, badAnt, antNum, flagType) int *recNum, *badAnt, *antNum, *flagType; int putBaselineFlag(recNum, badBase, baseNum, flagType) int *recNum, *badBase, *baseNum, *flagType; int putDataFlag(recNum, badBase, baseNum, badChan, chanNum, flagType) int *recNum, *badBase, *baseNum; int *badChan, *chanNum, *flagType; int getRecordFlag(recNum) int *recNum; int getAntennaFlag(recNum, antInfo) int *recNum, *antInfo; int getBaselineFlag(recNum, baseInfo) int *recNum, *baseInfo; int getDataFlag(recNum, baseInfo, baseNum, chanInfo, chanNum) int *recNum, *baseInfo, *baseNum; int **chanInfo, *chanNum; int getDataFlagGrid(recNum, dataGrid) int *recNum, **dataGrid; DESCRIPTION These functions operate on the GMRT LTAfile for editing (flagging or unflagging) the bad data in each record (times- tamp) corresponding to the bad antennas, bad baselines and bad channels. initFlag() initializes the flagging informa- tion. putRecordFlag(), putAntennaFlag(), putBaselineFlag() and putDataFlag() functions are used for editing the LTAfile for bad records, bad antennas, bad baselines and bad data points corresponding to bad baselines and bad channels, respectively. getRecordFlag(), getAntennaFlag(), getBasel- ineFlag(), getDataFlag() and getDataFlagGrid() functions are NCRA Release Last change: 31 May 1995 1 LIBFLAG(1) IFRSOFT LIBRARY LIBFLAG(1) used for retrieving the editing information from the LTAfile regarding bad records, bad antennas, bad baselines, bad data points corresponding to bad baselines and bad channels, and the bad data points flagging grid (baseline vs. channels), respectively. initFlag() reads the flagging related keywords from GHeader in an LTAfile and positions the file pointer fp at the start of the given scan scanNum. This function returns the posi- tion of the given scan in an LTAfile. The value of scanNum starts from zero. This function is to be called in the pro- gram only once after calling the following functions BeginCL(argc, argv); beginheader(); initScan(fp); where the argument types are int argc; char *argv[]; FILE *fp; putRecordFlag() edits the given record recNum. It flags if flagType is 1 and unflags if it is 0. It returns the flag- Type value which tells whether the record is flagged or unflagged. putAntennaFlag() edits the field for bad antennas. It flags if flagType is 1 and unflags if it is 0. It returns the flagType value which tells whether the record is flagged or unflagged. Arguments to this function are record number recNum to be edited, pointer to the bad_antenna_indices badAnt, number of bad antennas antNum and the type of flag flagType. putBaselineFlag() edits the field for bad baselines (includ- ing the baselines related to bad antennas). It flags if flagType is 1 and unflags if it is 0. It returns the flag- Type value which tells whether the record is flagged or unflagged. Arguments to this function are record number recNum to be edited, pointer to the all_bad_baselines bad- Base, number of bad baselines baseNum and the type of flag flagType. putDataFlag() edits the field for bad data points corresponding to the bad baselines (including baselines related to bad antennas) and bad channels. It flags if flag- Type is 1 and unflags if it is 0. It returns the flagType value which tells whether the record is flagged or unflagged. Arguments to this function are record number recNum to be edited, pointer to the all_bad_baselines bad- Base, number of bad baselines baseNum, pointer to the bad_channels badChan, number of bad channels chanNum and the type of flag flagType. NCRA Release Last change: 31 May 1995 2 LIBFLAG(1) IFRSOFT LIBRARY LIBFLAG(1) getRecordFlag() returns the flagword (of type size_t) which tells whether the record recNum is flagged (1) or unflagged (0). getAntennaFlag() fills the antInfo array, for each record recNum, with the flagged antenna indices and returns the number of bad antennas. getBaselineFlag() fills the baseInfo array, for each record recNum, with all the flagged baselines and returns the total number of bad baselines. getDataFlag() fills the baseInfo array, for each record rec- Num, with all the flagged baselines and chanInfo 2D array with all the flagged data point indices (in baseline- channels order). This also sets baseNum pointer to the total number of bad baselines and chanNum pointer to the total number of bad channels. This function returns the total number of bad data points in the given record. getDataFlagGrid() fills the dataGrid 2D array, for each record recNum, with all the bad channels for the correspond- ing baselines. dataGrid array contains binary information, 1 for good data point and 0 for bad data point. This func- tion can be used in the analysis program to use the good data points and neglect the bad data points. This function returns the total number of bad data points corresponding to the last baseline. SEE ALSO Note on BeginCL(), beginheader(), and libscan(1), editor(1), showflag(1) NOTE Contact Shyam Khobragade if there are any problems while using this library. NCRA Release Last change: 31 May 1995 3