Opened 19 years ago
Closed 16 years ago
#1023 closed enhancement (fixed)
psFitsImage.c / convertImageWrite not quite working
| Reported by: | eugene | Owned by: | Paul Price |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | fits | Version: | unspecified |
| Severity: | minor | Keywords: | |
| Cc: |
Description (last modified by )
I disabled the quantization of the floating point images in convertImageWrite. There are some problems with it:
1) the conversion sets the bzero / bscale values, but the following code in psFitsInsertImage raises an assert on the values of bzero / bscale if they are not 0.0, 1.0. something is inconsistent here.
2) the operation needs to be optional. not all integer truncations can be treated equally. the most obvious example is in using ppImage to perform an operation on a mask image. It is necessary to tell ppImage to write out the resulting value with the mask fits type, setting bitpix to 8. However, the mask values are not a smooth data field, and must be maintained.
I have put # if(0) around the relevant code, but some work in the calling APIs is needed.
Change History (2)
comment:1 by , 19 years ago
| Status: | new → assigned |
|---|
- Yes, values for BSCALE and BZERO are set by the conversion to disk representation. Another value for BZERO is obtained for the type conversion (e.g., unsigned representation in memory needs to be written as signed, so we add a BZERO to preserve the dynamic range). The assertion is only triggered when the BZERO for the type conversion is required; in this case, since the image is unsigned, it should not have had BZERO or BSCALE set from the data values (because those generate signed images). I think that this makes sense. Did you hit this assertion? If so, can you please describe how to reproduce?
- See bug 1032.
comment:2 by , 16 years ago
| Description: | modified (diff) |
|---|---|
| Resolution: | → fixed |
| Status: | assigned → closed |
I believe this bug has been addressed.
