IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Opened 21 years ago

Closed 20 years ago

#578 closed defect (fixed)

Is psFitsHeaderFromImage really necessary?

Reported by: robert.desonia@… Owned by: eugene
Priority: high Milestone:
Component: PSLib SDRS Version: unspecified
Severity: normal Keywords:
Cc: robert.desonia@…

Description

psFitsHeaderFromImage creates header keywords like BITPIX, NAXES, NAXIS*, etc. from its input
psImage. psFitsWriteImage also creates those keywords cooresponding to its input psImage
dimensions (implicitly as it calls fits_create_img to create a new HDU).

I'm not sure why one would really need to psFitsHeaderFromImage if the keywords are set
automagically at HDU creation and changing them via a psFitsWriteHeader can easily invalidate the
HDU, as the HDU is not resized to fit the new values of the keywords in question.

Can you explain the purpose you saw in psFitsHeaderFromImage and how you see it used?

-rdd

Change History (6)

comment:1 by Paul Price, 21 years ago

Status: newassigned

One really annoying problem I often run into when using FITS images is that I
read an image in, alter it (e.g., convert from int to float, trim off the
overscan --- something that would alter fundamental headers), and then I want to
write it out using the old headers. The problem is that the old headers contain
the old BITPIX, NAXIS[12], etc, so that cfitsio doesn't know what's true. The
idea behind psFitsHeaderFromImage was to fix the header based on the image. If
you can suggest changing psFitsWriteImage to get around the above problem, that
would be great, and we could drop psFitsHeaderFromImage (or we can rename it to
psFitsUpdateHeaderFromImage, perhaps?).

comment:2 by robert.desonia@…, 21 years ago

Well, I think the best way to handle things is for psFitsWriteImage should set the keywords like
BITPIX,NAXES,NAXIS*, etc. properly given the input psImage and ignore any settings in the input header.

There should be no need, therefore, for a psFitsHeaderFromImage, or psFitsHeaderValidate, as required
keywords are put in at write time and need not be in the psMetadata version of the header.

comment:3 by Paul Price, 21 years ago

Cc: eugene@… added

That sounds good. I shall remove psFitsHeaderFromImage, psFitsHeaderFromTable.

psFitsHeaderValidate is intended to check the length of the keywords (FITS max
is 8 chars). Perhaps this is not required, since I noticed that long keywords
are added in using "HIERARCH" or something like that?

comment:4 by robert.desonia@…, 21 years ago

Cc: robert.desonia@… added

Yes, CFITSIO supports the ESO HIERARCH convention, allowing long keyword names. Does this mean
that psFitsHeaderValidate can be removed as well?

-rdd

comment:5 by Paul Price, 21 years ago

Owner: changed from Paul Price to eugene
Status: assignednew

Gene's call.

comment:6 by Paul Price, 20 years ago

Resolution: fixed
Status: newclosed

psFitsHeaderFromImage was done away with, following modification to
psFitsWriteHeader to do the Right Thing.

Note: See TracTickets for help on using tickets.