ignore2d

sherpa.astro.ui.ignore2d(val=None) None

Exclude a spatial region from all data sets.

Select a spatial region to exclude in the fit. The filter is applied to all data sets.

Changed in version 4.15.0: The change in the filter is now reported for each dataset.

Parameters:

val (str, optional) – A region specification as a string or the name of a file containing a region filter. The coordinates system of the filter is taken from the coordinate setting of the data sets (set_coord). If None, then all points are included.

See also

ignore2d_id

Exclude a spatial region from a data set.

ignore2d_image

Select the region to exclude from the image viewer.

notice2d

Include a spatial region from all data sets.

notice2d_id

Include a spatial region of a data set.

notice2d_image

Select the region to include from the image viewer.

set_coord

Set the coordinate system to use for image analysis.

Notes

The region syntax is described in the notice2d function.

Examples

Exclude points that fall within the two regions:

>>> ignore2d("ellipse(200,300,40,30,-34)")
dataset 1: Field() -> Field()&!Ellipse(200,300,40,30,-34)
>>> ignore2d("box(40,100,30,40)")
dataset 1: Field()&!Ellipse(200,300,40,30,-34) -> Field()&!Ellipse(200,300,40,30,-34)&!Box(40,100,30,40)

Use a region file called ‘reg.fits’, by using either:

>>> set_coord("physical")
>>> ignore2d("reg.fits")
dataset 1: Field() -> Field()&!Ellipse(3144.52,4518.81,25.2979,19.1119,42.9872)

or

>>> set_coord("physical")
>>> ignore2d("region(reg.fits)")
dataset 1: Field() -> Field()&!Ellipse(3144.52,4518.81,25.2979,19.1119,42.9872)

Exclude all points and hide the screen output:

>>> from sherpa.utils.logging import SherpaVerbosity
>>> with SherpaVerbosity("WARN"):
...     ignore2d()
...