Chandra X-Ray Observatory
	(CXC)
Skip to the navigation links
Last modified: 28 September 2012

URL: http://cxc.harvard.edu/sherpa4.4/bugs/index.html

Known Issues and Limitations for Sherpa 4.4



The Sherpa 4.4 software release still includes some known bugs, and some functionality is subject to caveats. Also, there is some changed or missing functionality with respect to Sherpa 3.4. For complete details on this release, see the Latest Updates page, the About Sherpa page, and the CIAO release notes.

If you think you have found a bug in Sherpa which is not shown here, please submit a ticket to the CXC Helpdesk describing the problem.

Caveats

Python Environment

IPython Packaged with CIAO OTS

CIAO includes IPython in the CIAO OTS directory which is used by Sherpa and ChIPS to provide command-line user interfaces. These programs create an IPython profile in the directory $HOME/.ipython-ciao.

If IPython users want any personal customizations to be available when running CIAO, they will have to copy them from $HOME/.ipython to $HOME/.ipython-ciao.

User files in current working directory may conflict with Python DS9 interface.

Files with single character names "a" through "y" in the current working directory may conflict with the Python DS9 interface used in Sherpa, preventing 2D data loaded into a Sherpa session from being displayed in DS9 with Sherpa commands such as image_data. Trying to do so will yield an error, "DS9Err: Could not display image." Simply removing the offending file(s) from the current working directory will resolve the issue and restore the ability to plot in DS9 from within the Sherpa session.

Instrument Responses

RMF and ARF energy range must be the same.

If an RMF and ARF with different energy ranges are assigned to a data set in Sherpa, Sherpa will print an error message when trying to fit the data: "ValueError: RMF data is invalid or inconsistent". See the CIAO Imaging Spectroscopy threads to learn how to create an ARF and RMF with the same energy range.

RMF energy grid resolution must not exceed that of ARF.

Sherpa 4.4 does not currently support the case where the RMF has energy bins of finer resolution than the ARF (an ARF with finer resolution than the RMF energy bins is supported). Sherpa will print an error message when trying to fit data that have response grids unmatched in this way:"need to expand, not shrink effective area." The CIAO why topic on mkacisrmf explains how to remake the ARF such that the grids match.

Grouping and Filtering

Background data filter is lost after grouping.

When a source data set and its associated background data are filtered in Sherpa using one of the ignore or notice commands, subsequent grouping of the data channels with one of the group commands will drop the filter applied to the background data, only if the grouping command for the source data set is issued before background grouping; grouping the background first resolves the issue and properly retains the filter applied to the background data.

sherpa> load_pha("source.pi")
sherpa> load_bkg("bkg.pi")

sherpa> notice(0.5,7.)             # source and background filtered

sherpa> group_counts(20, bkg_id=1) # background data must be grouped before
                                   # source data to retain background filter                            

sherpa> group_counts(20)           # both source and background filtered and grouped

Applying a PSF

set_psf should not be used when a PSF model has been applied manually.

The Sherpa set_full_model functionality provides users with the flexibility to define model expressions that apply instrument responses or PSFs to some model components, while not applying the response or the PSF to other model components in the model expression. When a PSF has been applied to a model expression in this way - e.g., "set_full_model(psf1(gauss2d.g1) + beta2d.b1+const2d.c1)"- it is not necessary to apply the PSF with set_psf in the usual way when defining model expressions automatically with set_model; doing so will erroneously apply the PSF twice in the final model expression used for fitting.

# Manual application of a PSF

sherpa> load_image("image.fits")
sherpa> load_psf("psf1","psf.fits")
sherpa> set_full_model(psf1(gauss2d.g1) + beta2d.b1+const2d.c1)
sherpa> show_model()
Model: 1
((psfmodel.psf1(gauss2d.g1) + beta2d.b1) + const2d.c1)
...

# Automatic application of a PSF with set_psf()

sherpa> load_image("image.fits")
sherpa> load_psf("psf1","psf.fits") 
sherpa> set_model(gauss2d.g1)
sherpa> set_psf(psf1)
sherpa> show_model()
...
Model: 1
psfmodel.psf1(gauss2d.g1)
...

User-specified PSF 'origin' position is off by 1 pixel in x and y directions.

If the user chooses to set the optional, hidden 'origin' parameter of a PSF model to the (x,y) coordinates of a chosen pixel in that kernel, the position should be decremented by one in both x and y directions. For example, if DS9 was used to find that the brightest pixel is at (122, 131), 'psf.origin' should be set equal to '(121, 130)'. This is necessary because Sherpa internally stores data, PSF, and kernel information as NumPy arrays - which start counting from element 0 - whereas DS9 uses pixel coordinates, with the first pixel having a value of (1,1).

sherpa> print get_psf()
psfmodel.psf
   Param        Type          Value          Min          Max      Units
   -----        ----          -----          ---          ---      -----
   psf.kernel  frozen psf_f1_norm_0.25pix.fits
   psf.size    frozen   (256, 256)   (256, 256)   (256, 256)
   psf.center  frozen   (128, 128)   (128, 128)   (128, 128)
   psf.radial  frozen            0            0            1           
   psf.norm    frozen            1            0            1    

sherpa> psf.origin = [121,130]

sherpa> print get_psf()
psfmodel.psf
   Param        Type          Value          Min          Max      Units
   -----        ----          -----          ---          ---      -----
   psf.kernel  frozen psf_f1_norm_0.25pix.fits
   psf.size    frozen   (256, 256)   (256, 256)   (256, 256)
   psf.center  frozen   (128, 128)   (128, 128)   (128, 128)
   psf.origin  frozen   (121, 130)   (121, 130)   (121, 130)
   psf.radial  frozen            0            0            1           
   psf.norm    frozen            1            0            1 

If psf.origin is not set by the user - leaving Sherpa to automatically locate the position of the brightest pixel in the kernel and set this as the origin - Sherpa will find the correct location, provided that a) the brightest pixel should coincide with the origin in the analysis, and b) that there is only one pixel that has that brightest value.


Commands

Models


Last modified: 28 September 2012
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-2019. All rights reserved.