Re: ISIS background subtraction

From: John Houck <houck>
Date: Thu, 3 Jan 2002 14:55:33 -0500
Hi Hironori,

Sorry for the late reply -- I was out of town and out of
email contact until today.

On Sun, Dec 23, 2001 at 14:06 -0500, Hironori Matsumoto wrote:
> I have a few questions about the background subtraction in ISIS.
> 
> 1. I think there is an error in the "backsub" function at
> p33 of the manual. The equation of
> s.err = sqrt (s.err * s.err + b.err * b.err); 
> should be
> s.err = sqrt (s.err * s.err + b.err * b.err * scale * scale); .
>

Yes, you're right.  I will fix that.

> 
> 2. I tried the "define_bgd" function, and tried "get_iback",
> but it didn't work well. Please let me know how to define
> the background.
> 
> isis> load_data("imbh.pi");
> *** invalid uncertainties replaced
> Couldn't read DETNAM keyword
> TG_M keyword not set
> TG_PART keyword not set
> TG_SRCID keyword not set
> 1
> isis> define_bgd(1, "imbh_bgd.pi");
> *** invalid uncertainties replaced
> 0
> isis> back = get_iback(1);
> Couldn't get background for dataset 1
> S-Lang Error: Intrinsic Error: called from line 1, file: <stdin>
> NULL


The problem here is that the background array returned by
get_iback() does not exist until you first define a
fit-function and evaluate it.  For example, this sequence
works:

        % load data and assign background
  load_data ("source.pha");  
  define_bgd (1, "bgd.pha");
  
        % define and evaluate a fit-function
  fit_fun ("powerlaw(1)");
  () = eval_counts (1);
  
        % retrieve the background on the data grid:
  back = get_iback(1);  

This feature is implemented in this way mainly because ISIS
supports rebinning at run-time.  When the data is fitted, the
background array is interpolated onto the data grid but, at
that time, the data grid may not be the same as the grid in
either input data file or the input background file. Rather
than re-evaluate the background every time the grid changes, 
(after all, it might be an expensive function), ISIS currently
evaluates the background only when it is used for fitting.

The writeup in the manual does not make this clear, so I will
fix that.  I will also consider making the background array 
available without first evaluating a fit-function.

Thanks,

John

-- 
John C. Houck  MIT Center for Space Research, Bldg NE80-6005
617-253-3849   77 Massachusetts Avenue, Cambridge, MA 02139-4307
----
You received this message because you are
subscribed to the isis-users list.
To unsubscribe, send a message to
isis-users-request_at_email.domain.hiddenwith the first line of the message as:
unsubscribe
Received on Thu Jan 03 2002 - 14:55:36 EST

This archive was generated by hypermail 2.2.0 : Thu Mar 15 2007 - 08:45:50 EDT