Re: plotting model over data gaps

From: Manfred Hanke <Manfred.Hanke_at_email.domain.hidden>
Date: Tue, 15 Mar 2011 18:17:22 +0100
Oops, that was meant to go to the entire list. Sorry, my fault.

-------- Original Message --------
Subject: Re: isis-users: plotting model over data gaps
From: Manfred Hanke <Manfred.Hanke_at_email.domain.hiddenTo: Rhaana Starling <rlcs1_at_email.domain.hidden
Dear Rhaana,

> I would like to be able to overplot my model fit on the data and
> interpolate/extrapolate it during data gaps. I'm just using the standard
> plot routines from .isisrc_plots you provide on the website

Oh, I would not call those standard... Fancy is actually a good word.
But no doubt, they're extremely useful indeed. ;-)

I assume that you are using plot_unfold, because plot_data or
plot_counts are more tightly related to the binning of the data and the
response matrix, so I'm not sure whether an interpolation would make sense.

You can always evaluate your model on an arbitrary grid using the
eval_fun function, which takes input wavelengths and outputs the flux in
units of ph/s/cm^2/bin.
I have a simple wrapper to do the conversion from keV:
http://www.sternwarte.uni-erlangen.de/git.public/?p=isisscripts;a=blob;f=src/data/spectrum.datastructures/eval_fun_keV.sl

The magic is how to overplot these values (probably scaled with a fancy
factor?) it to Mike's plots. There is still this annoying global
variable `no_reset', which you have to set to 1 if you need further
access to the plot. I haven't previously used the mpane function
extensively, but it seems to me important to also set the axes ranges
manually. So here's my example:

  variable id = define_counts([1,3,5], [3,5,8], [1,2,4], [1,1,1]);
  fit_fun("powerlaw");
  ()=fit_counts();

  variable xmin=1, xmax=8, ymin=0, ymax=2;
  fancy_plot_unit("A");
  no_reset = 1;
  plot_unfold(id; res=1, xrange=[xmin,xmax], yrange=[ymin,ymax]);

  mpane(1);
  variable lo, hi; (lo, hi) = linear_grid(1.5, 7.5, 100);
  xrange(xmin, xmax);
  yrange(ymin, ymax);
  hplot(lo, hi, eval_fun(lo, hi)/(hi-lo));  % => ph/s/cm^2/A


I'll keep on trying to convince Mike that
  plot_unfold(id; reset=0);
could do the job of
  no_rest = 1;
  plot_unfold(id);
:-)

Cheers,

Manfred

P.S. _at_email.domain.hidden----
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 Mar 15 2011 - 13:22:54 EDT

This archive was generated by hypermail 2.2.0 : Mon Mar 28 2011 - 08:46:05 EDT