Re: modeling question

From: Michael Nowak <mnowak_at_email.domain.hidden>
Date: Tue, 28 Jul 2009 13:46:29 -0400
On Jul 28, 2009, at 1:01 PM, Herbert Pablo wrote:

> So this is what I'm trying to do. First I fitted a slightly  
> complicated
> function to the continuum. Now what i want is to get rid of this  
> continuum so
> that I can see visually how the lines compare with one another which  
> the
> continuum distorts. I also want to use this continuum subtracted  
> data to plug
> into another program so that I can remove some of the complication  
> out of my
> dynamic spectra and make it easier to pick out line shifts. So I  
> guess the
> answer is both for a plot and data manipulation.  I'm sure I can  
> squeeze out
> some more info if you need, but does this give you a better idea?

OK, I think I got it.  From easy to hard:

Easiest is to fit the continuum, and then plot the ratio residuals -  
data/model - that should give you an idea of what the data looks like  
relative to the model.

Harder, but I think this should work:

1) Load up and fit dataset #1
2) *Ungroup* dataset #1 and notice all the bins, evaluate the counts
3) newdata = get_model_counts(1);  % You are getting the counts from  
the model you just fit
4) new_id = define_counts(newdata);  %  These model counts are now a  
new dataset - almost
5) assign_arf(1,new_id);      % assign the old rmf & arf to these data
6) assign_rmf(1,new_id);
7) set_data_exposure(new_id,get_data_exposure(1));  % Give it the same  
exposure as the old dataset
8) set_data_backscale(new_id,get_data_backscale(1)); % Give it the  
same area/relative exposure as the old data set

This latter bit might not work if the backscale isn't defined in the  
data.  If it's not defined, don't worry about it.  It will be assumed  
to be 1 for later purposes.
9) If there was a background file associated with the data, associate  
it also with this new data set using "define_back".

10)  You have now made the model as a new data file.  We can now  
define that to be a background file.  For this, you need to have  
my .isisrc files.  You want to use the "corfile" function.  Basically  
if you do:


This newly created data file will be treated as an additional  
background file.  It will be subtracted out in all the plots, and then  
you can fit just the difference of the data from this.  (Mind you,  
that's not as good as fitting the original model plus extra pieces to  
the whole data itself.).

11) bin dataset 1 as you see fit, and fit away.

12)  With my plot functions (also in my .isisrc file collection),  
"write_plot" will save these data to an ASCII file.  That then might  
be the easiest way of passing on this "model subtracted" data to  
another program.

Haven't really played too much with the corfile procedure.  It used to  
work :)  Might be a few issues with the "get background" type of  
functions in it.  There used to be fewer of those in ISIS, so old  
versions of those scripts instead used specific file names read from  
headers.  If that's what's still in the isisrc files, that could cause  
problems if you are no longer working in the directory from which you  
read the initial background files.  If you run into problems with the  
above, write back to us.



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:
Received on Tue Jul 28 2009 - 13:46:34 EDT

This archive was generated by hypermail 2.3.0 : Fri May 02 2014 - 08:35:46 EDT