Program: FIXHED Purpose: Add, change, delete or list item(s) in set header Category: HEADER, UTILITY File: fixhed.c Author: M. Vogelaar Keywords: INSET= Give set (, subsets) to work on: Maximum number of subsets is 2048. Usually descriptors are added or changed at top level, but if you work on subset level, it will be possible to work on all given subsets at the same time. ITEM= Give name of header item: [show header] or (after the first prompt): Give name of header item: [end program] This keyword is asked in a loop. You end the program if you press carriage return. Input is a name associated with a keyword in the header. After the first input, the prompt will also show the mode that you are currently working in (see MODE=). The length of the string that you enter may not exceed 8 characters. There are two special entries for ITEM= ITEM=LIST If you enter ITEM=LIST, a list with recommended GIPSY keywords with explanation is displayed. ITEM=HEAD If you specify ITEM=HEAD, the sorted contents of the header at top- or subset level is displayed. ** MODE= Operation mode: A(dd),D(elete),C(hange): [A] You need to specify only one character. FIXHED can Add, Change and Delete header items. If ITEM= is found in the header of INSET= then the default is A(dd). If ITEM= is NOT found in the header of INSET= then the the default is C(hange). If there is some kind of conflict (for example changing an item that isn't present in the header) then the keyword is asked UN-hidden. The mode of operation can be changed within the ITEM= loop (e.g. ITEM=maxbase MODE=d). ** TYPE= Give type of item I/R/D/L/C/T/H: [back to item loop] The type of keyword can be one of: I -Integer numbers R -Real numbers D -Double precision numbers L -Logical variables as T or F in header, but input can be YES, JA and TRUE, NO, NEE and FALSE, or any abbreviations. C -Character variable. A string that can contain spaces. Quotes are added by the program. The string cannot exceed 18 characters H -Commentary FITS keywords COMMENT or HISTORY. Keyword and contents cannot exceed 80 characters. T -Text entry NOT FITS. Only used in special cases! (See description) The keyword TYPE= is hidden if the specified item (and its type) is found in a list (ITEM=LIST) with general keys or in the header of the specified input set. It is possible to apply adding or deleting (not changing) to all subsets. 1) Add on subset level(s): ** ALL= Apply to all remaining levels? Y/[N] ALL=Y can be typed any time to start copying the last entered value of an item to all remaining subset levels. 2) Delete on top level (no subset(s)): ALL= Delete item on ALL levels? Y/[N] 3) Delete on subset level: ** ALL= Delete on all remaining levels? Y/[N] ALL=Y can be typed any time to start deleting the last entered value of an item to all remaining subset levels. For ALL=N you will be prompted at each level with OK= before an item is removed on the current subset level. OK= Subset nr ...: Ok to delete item? Y/N/[stop] Note that 'stop' only stops the current action and returns to the ITEM= loop. VALUE= MODE=Add: Add (type) for (descriptor)= [stop] (on subset level) Subset nr ...: Add (type) for (descriptor)= [stop] MODE=Change: New value for %.*s= [do not change] (on subset level) Subset nr ...: New value for %.*s= [do not change] COMMENT= MODE=Add: Add a comment [none] MODE=Change: Give new comment [do not change] If the operation mode is A(dd), it is possible to create a FITS style comment here. If the mode is C(hange), first the old comment is displayed and the user is prompted to give a new one. There are no comments for the T(ext) and H(istory) type. LINE= Give number of line to change: [stop] If items HISTORY or COMMENT are specified, the old contents at top- or subset level is displayed with a line number. You can change one line at a time. If you press carriage return the changed lines are written to the descriptor file and the program returns to the ITEM= prompt. Description: GIPSY data consists of an image file with floating point numbers and an associated file called 'descriptor' or 'header' file. This file describes structure and coordi- nate system of the image data by means of FITS (Flexible Image Transport System) keywords. Each item is stored in the header in a special format with the basic grammar: keyword = value / comment In GIPSY descriptor files we distinguish the formats: Integer, Real, Double, Logical, Character and the so called commentary formats (HISTORY and COMMENT). There is also one non FITS format implemented in FIXHED called Text. This format will be used only in special cases (See APSET keyword in the examples).. Examples: The number of interferometers used in an observa- tion is stored as an integer, its associated header keyword is 'NINTF'. The maximum of a map is stored as a real in 'DATAMAX'. The total bandwidth of an observation is stored as a double in 'BANDW'. The date of the observation is stored as a character string and its associated keyword is 'DATE-OBS'. The set, subset used for an antenna pattern is stored in text form (one or more character strings). Input looks like: APSET=ANTPAT FREQ 1. This string can be a long string so it can not be stored in character format. It will be stored in Text format. However, the item will not be recognized as a real FITS item and therefore cannot be transported. Two keywords, COMMENT and HISTORY are of type History, but have a text format also. New information is appended to existing data in lines with a maximum of 80 characters. With the program FIXHED you can add, change, delete or list these items on top level (specify only the name of a set at the INSET= prompt) or at subset level (specify name and subsets). For each item of type Integer, Real, Double, Logical or Character, a corresponding FITS comment can be added or changed. The keywords describing the structure of the set must be given with an integer number appended to it like CTYPE3. FIXHED checks name, number and level for these keywords. Only keywords with NAXIS cannot be changed. If ITEM=HEAD all descriptors on current level will be displayed in alphabetical order. If tables are encountered name and type are listed before the list of keywords only if the output mode is set to TEST. Example: Change position angle item (BMPA) in set AURORA on top level, after displaying the contents of its header. Updates: Jul 14, 1990: VOG, Document created. May 18, 1992: VOG, Table detection. May 29, 1994: VOG, Display GDS errors. Update of documentation. Example: FIXHED,INSET=TESTSET Set TESTSET has 3 axes RA-NCP from -9 to 10 DEC-NCP from -9 to 10 FREQ-OHEL from 0 to 9 FIXHED working at top level Use ITEM=HEAD to get a list of ALL descriptors on current level. Use ITEM=LIST to get a list of recommended GIPSY keywords FIXHED,ITEM= HEADER at top level =============================== APSET = GAUSS FREQ 0 BANDW = 0.31250000000000D+00 / total bandwidth of observation BMMAJ = 0.35966360473633D+03 / major axis (FWHM) of beam (arcsec) BMMIN = 0.35966360473633D+03 / minor axis (FWHM) of beam (arcsec) BMPA = 0.00000000000000D+00 / pos. angle of major axis of beam (N->E) BUNIT = 'WU ' / data units (WU,MJY/SR,...) CDELT1 = 0.10000000000000D-01 CDELT2 = 0.10000000000000D-01 CDELT3 = 0.10000000000000D+09 CROTA1 = 0.00000000000000D+00 CROTA2 = 0.00000000000000D+00 CROTA3 = 0.00000000000000D+00 CRPIX1 = 0.10000000000000D+02 ....etc... HISTORY/COMMENT =============== HISTORY : DUMMY SET FOR TESTING 29/11/90 COMMENT : NOT A REAL SET! FIXHED,ITEM=BMPA ============================= FIXHED ======================== FIXHED tries to CHANGE item [BMPA] at set level. Item BMPA (pos. angle of major axis of beam (N->E)) is known and stored as a double. Item found in HEADER at SET level. ============================================================= Old value BMPA= 0.000000 FIXHED,VALUE=45 FIXHED,COMMENT=Vavlue changed from 0 to 45 FIXHED,ITEM= FIXHED - +++ FINISHED +++