Problems with BSCALE and BZERO
Nuno Peixinho wrote on May 26, 2010
Dear all
I have a problem with images that came in ushort format. Many have BSCALE different from 1 and BZERO different from 32768, while others do have the standard BSCALE =1 and BZERO=32768.
I wanted to imcombine then scaled to exposure time, since it is not always the same.
I assumed that transforming them to real and then by doing for example, according to the header information on one particular case:
bscale image_A image_B bzero=179.6 bscale=0.01039
and then
bscale image_B image_C bzero=-32768 bscale=1
I would get an image with the same scaling as all the other that have header keywords BZERO=32768 BSCALE=1
Yet, the sky counts for consecutive images (for example) do not make sense.
What am I doing wrong?
What to do?
Can anyone help me?
I thank you in advance.
Nuno
I have a problem with images that came in ushort format. Many have BSCALE different from 1 and BZERO different from 32768, while others do have the standard BSCALE =1 and BZERO=32768.
I wanted to imcombine then scaled to exposure time, since it is not always the same.
I assumed that transforming them to real and then by doing for example, according to the header information on one particular case:
bscale image_A image_B bzero=179.6 bscale=0.01039
and then
bscale image_B image_C bzero=-32768 bscale=1
I would get an image with the same scaling as all the other that have header keywords BZERO=32768 BSCALE=1
Yet, the sky counts for consecutive images (for example) do not make sense.
What am I doing wrong?
What to do?
Can anyone help me?
I thank you in advance.
Nuno
Mike Fitzpatrick wrote on May 26, 2010
The BSCALE/BZERO keywords in the header simply provide a scaling between the image intensity values, and the ushort values that happen to be written in the file. You can use something like the CHPIXTYPE task to convert the image to short, or int, or real, or .... and the header keywords may go away, but the range of pixel values will remain the same.
The BSCALE task, on the other hand, actually applies a linear transform to the pixel and changes the data range. You don't need to scale the images to a common data range, imcombine will use what it is given.
The BSCALE task, on the other hand, actually applies a linear transform to the pixel and changes the data range. You don't need to scale the images to a common data range, imcombine will use what it is given.
Nuno Peixinho wrote on May 26, 2010
Sorry once again. Does that mean that doing IMCOMBINE or IMSUM on a group of images each with different BSCALE and BZERO will result in a correct MEDIAN or SUM image? I do not have to worry about these BSCALEs and BZEROs because Iraf knows what is doing always?
Mike Fitzpatrick wrote on May 26, 2010
Yes, the BSCALE/BZERO header value simply map the pixel values to how they might be stored in the file, but the tasks always see the pixel values the same whether they are scaled for FITS storage or not.
Nuno Peixinho wrote on May 26, 2010
Thanks a lot!
Last post on May 26, 2010