[daip] AIPS: is there a way to check for HEADER keyword "existence"?
Eric Greisen
egreisen at nrao.edu
Thu Mar 10 16:25:56 EST 2005
Samuel Conner writes:
> I am building a suite of RUN files to streamline calibration, and I am building some error checks into it to prevent me from making silly mistakes. One of these involves checking for the presence of certain user-generated KEYWORD/VALUE pairs in image headers of images which are to be used as CALIB models. I had hoped to simply perform a GETHEAD on the particular KEYWORDS and note whether KEYVALUE and KEYSTRNG take on reasonable values (or change at all from unreasonable values to which I initialize them). But I find that when GETHEAD does not find the requested KEYWORD, it generates an exception of some kind which crashes the procedure which called it:
>
> AIPS 1: CATKEY: HEADER KEYWORD MODLTYPE NOT FOUND
> AIPS 1: CATKEY: ERROR ON OPCODE=READ VOL,CNO 1 2
> AIPS 1: KEYWORD ='MODLTYPE' NOT RECOGNIZED
> >
> My PROC does not terminate normally when this happens, but seems to die at the statement where the GETHEAD was executed.
>
> QUESTION: Is there a way within AIPS to verify existence of a header KEYWORD without generating an error if the KEYWORD is not present?
>
> If not, it would be nice for GETHEAD to return a value for ERROR rather than generate an exception. I can work around this by making a local version of GETHEAD which does this, but it might be worth considering on a wish list of small features to add to AIPS someday.
>
> I apologize for troubling you with my niggling concerns. I think that AIPS is a fantastic package, and I would be in another line of work without it.
>
This one appealed to me - it will be in tomorrow's MNJ as verb EGETNAME.
Eric Greisen
More information about the Daip
mailing list