About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2006

URL: http://cxc.harvard.edu/ciao3.4/get_filter.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 get_filter Context: sherpa

Synopsis

Module functions to get the filter arrays associated with source and background datasets.

Syntax

Array_Type get_filter([Integer_Type])
Array_Type get_bfilter([Integer_Type])

Error Return Value: NULL

Arguments:

(1) data set number (default 1)

Description

The function get_filter() returns an array of type Short_Type that is the same size as the input data set (i.e., the unfiltered data set). The array features two values: 0 for bins outside the currently defined filter, and 1 for bins within the filter. This function may be used in combination with set_filter to define new methods of data filtering that go beyond those currently coded in Sherpa; e.g., filtering based on data amplitude. (The function get_bfilter() returns the filter associated with the background data set.)

Source and background data filters may be displayed, e.g., via the Sherpa plotting commands LPLOT FILTER and LPLOT BFILTER.

Example 1

sherpa> data example.dat          # 100 bins, mean amplitude 60
sherpa> foo = get_data()
sherpa> bar = get_filter()
sherpa> bar[where(foo>60)] = 0    # filter out all bins with data > 60
sherpa> () = set_filter(1,bar)
sherpa> write data
Write X-Axis: Bin  Y-Axis: Flux (Counts)
          1         59
          2         46
          3         49
	  5         60
          6         60
          8         58

Example 2

sherpa> data foo.pha
sherpa> ignore bad
sherpa> notice energy 4:9
sherpa> bar = get_filter_expr()
sherpa> printarr(bar)
ignore source 1 bad
notice source 1 energy 4 : 9 

Bugs

See the Sherpa bug pages online for an up-to-date listing of known bugs.

Hardcopy (PDF): A4 | Letter
Last modified: December 2006



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