IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Opened 21 years ago

Closed 21 years ago

Last modified 20 years ago

#412 closed defect (fixed)

psFitsWriteImage and psFitsWriteTable

Reported by: Paul Price Owned by: Paul Price
Priority: normal Milestone:
Component: imageops Version: 0.5.0
Severity: minor Keywords:
Cc: robert.desonia@…

Description

The implementations of psFitsWriteImage and psFitsWriteTable contain an
additional "char *extname" not present in the specification. Since these
functions write to the current extension, this additional parameter should not
be necessary.

Change History (12)

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

Owner: changed from robert.desonia@… to Paul Price

This may be a problem.

psFitsWriteImage was implemented to create a new HDU and psFitsUpdateImage
writes to a current IMAGE HDU. If psFitsWriteImage would to write to the
current HDU, how does one create new HDUs? There is no psFitsCreateHDU.

I once looked into having a psFitsCreateHDU, but it was really complex to do
with CFITSIO, as there was no great way to create a blank HDU and then convert
it into either an IMAGE or table type upon a write (CFITSIO really wants to
write the required header information for an IMAGE or TABLE on creation of the HDU).

-rdd

comment:2 by Paul Price, 21 years ago

Cc: robert.desonia@… added

How 'bout we define:

psMetadata *psFitsHeaderFromImage(psMetadata *header, psImage *image, const char
*extname);
psMetadata *psFitsHeaderFromTable(psMetadata *header, psMetadata *table, const
char *extname);

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

I'm not sure what you are proposing. The routines you mention don't take a
psFits, so I assume it is not doing any psFits operation. I don't see how that
helps in creating the creation of a new HDU.

-rdd

comment:4 by Paul Price, 21 years ago

Status: newassigned

Sorry. The idea is that we generate a suitable header using those functions
(including the EXTNAME), and that can be passed to the psFitsWrite* functions.

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

But the question still remains: if the psFitsWrite* routines were to write to
the current HDU instead of creating a new HDU, how would a new HDU be created?

If you just want to get rid of the extname from the function, then, yes, one
could just add EXTNAME to the header metadata. I was assuming that one would
want to use EXTNAME for indexing (via psFitsMoveExtName), that I'd force the
user to name the extensions being created, but I could easily remove that
parameter. Do you want me to just do that? In that case, the function
prototype would match the SDRS, but it would still create a new HDU, which
doesn't seem to match the SDRS description.

-rdd

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

OK, I removed extname from the function prototypes to match the SDRS prototype.

comment:7 by Paul Price, 21 years ago

blocked: 236

comment:8 by Paul Price, 21 years ago

* Bug 236 has been marked as a duplicate of this bug. *

comment:9 by Paul Price, 21 years ago

Resolution: fixed
Status: assignedclosed

Gene and I discussed this this afternoon, and settled on the following:

  • psFitsWriteImage and psFitsWriteTable should write the image or table at the

current position in the FITS file (set by psFitsMove* functions), and update
EXTNAME in the header according to a extname parameter. If extname == NULL,
then the EXTNAME in the header is not updated.

  • To write to the end of a FITS file, we need a psFitsMoveEnd function, which

moves the "current position" to the end of the file.

  • psFitsHeaderFrom{Image,Table} are handy for setting the FITS headers. They

don't involve a psFits, but they enforce FITS concepts.

  • We need an additional function to validate and/or correct a psMetadata to be

FITS-compliant (e.g., truncating names to 8 characters).

I'll update the SDRS.

comment:10 by Paul Price, 21 years ago

Updated --- should be in the release this afternoon.

comment:11 by Paul Price, 20 years ago

Keywords: VERIFIED added

Bug has been resolved.... closing.

comment:12 by Paul Price, 20 years ago

Keywords: VERIFIED removed

Bugs have been fixed... closing.

Note: See TracTickets for help on using tickets.