Chandra X-Ray Observatory
	(CXC)
Skip to the navigation links
Last modified: 13 December 2016

URL: http://cxc.harvard.edu/ciao/bugs/pycaldb4.html

Bugs: pycaldb4


Bugs

Integer values of 0 are treated as blanks.

There is a bug in the Python CALDB module that misinterprets the integer value zero (0) as a blank. For example:

>>>  from caldb4 import *
>>>  c = Caldb( "CHANDRA", "ACIS", "BKGRND", "acisf04469N003_evt2.fits")
>>>  c.ccd_id=0
>>>  ret = c.search
>>>  print(ret)
['/soft/ciao-4.9/CALDB/data/chandra/acis/bkgrnd/acis6iD2000-12-01bkgrnd_ctiN0004.fits[1]']

In the above example the wrong CALDB file was identified. The example requested the data for ccd_id=0, but the file that was returned, acis6..., is for ccd_id=6.

This is a specific special case for the integer value equal to 0. Other non-zero integer values work correctly.

Workaround:

Users can work around this problem by using a string representation for the value rather than an integer. For example:

>>>  from caldb4 import *
>>>  c = Caldb( "CHANDRA", "ACIS", "BKGRND", "acisf04469N003_evt2.fits")
>>>  c.ccd_id=str(0)
>>>  ret = c.search
>>>  print(ret)
['/soft/ciao-4.9/CALDB/data/chandra/acis/bkgrnd/acis0iD2000-12-01bkgrnd_ctiN0004.fits[1]']

By replacing the integer 0 with the string "0", the correct file is located.


Last modified: 13 December 2016
Smithsonian Institute Smithsonian Institute

The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory. 60 Garden Street, Cambridge, MA 02138 USA.   Email:   cxchelp@head.cfa.harvard.edu Smithsonian Institution, Copyright © 1998-2017. All rights reserved.