# Re: Flux estimates and binning!

From: John Houck <houck>
Date: Tue, 8 May 2001 16:42:19 -0400
```On Tue, May 08, 2001 at 16:22 -0400, Bulent KIZILTAN wrote:
> I have two questions:
>
> 1)
> I haven't been able to get the estimated flux for a model fit. I tried
> "get_model_flux(1);", but I got an 'message" like: "Struct_Type". How can
> I get an estimate for a model (energy and photon) flux that I fitted on
> "data_counts"?

get_model_flux returns a structure containing three arrays for the
model grid (wavelength in Angstroms) and flux values
(photons /cm^2 /sec /bin):

isis> s=get_model_flux(1);
isis> print(s);
bin_lo = Double_Type[8192]
bin_hi = Double_Type[8192]
value = Double_Type[8192]

To compute the flux in some range, you can use the 'where' command
as in IDL.  For example, to compute the flux between 5-6 Angstroms:

isis> i = where(5 < s.bin_lo  and s.bin_hi < 6);
isis> f = sum(s.value[i]);
isis> f;
0.0851983
isis>

> 2)
> Is it possible to bin the data in terms of photon counts rather than
> channel counts {as in group_data()}?

There's no isis function to do exactly that, but rebin_data()
provides a mechanism for arbitrary rebinning of data. That
function can take two arguments:

rebin_data (index, flag_array);

The first argument specifies which data set. The second argument
can be an array of flags which specify how bins should be grouped.
The flag values can be -1, 1 or 0.

Neighboring bins with like sign are grouped together (use
alternating signs) and bins with flag=0 are ignored.

For example, if you have 9 bins, you could might rebin like this:
flag = [1, 1,   -1, -1,   0,   1, 1,    -1, -1]
This makes 4 bins in groups of 2, ignoring the center bin.

- John

--
John C. Houck    MIT Center for Space Research
617-253-3849     One Hampshire St, NE80-6005, Cambridge, MA 02139
----
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 Tue May 08 2001 - 16:42:21 EDT

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