Difference between revisions of "ISIS introduction for the new bachelor students"
Line 25: | Line 25: | ||
* <code>fit_counts</code> | * <code>fit_counts</code> | ||
* <code>define_counts</code> | * <code>define_counts</code> | ||
+ | |||
+ | === Loading and Evaluating a Local Model === | ||
+ | |||
+ | In the following we will see how we can load and evaluate a local model. This will be done by the example of the <code>relxill</code> model. | ||
+ | |||
+ | First, the model package is not automatically loaded, so it needs to be loaded first. We also need the isisscripts loaded for this. | ||
+ | |||
+ | |||
+ | <code>isis> require("isisscripts"); </code> | ||
+ | |||
+ | <code>isis> use_localmodel("relxill"); </code> | ||
+ | |||
+ | |||
+ | Then we can use it to define the fit funtion we want to use. For now we want to use the lamp post version of the relxill model. Therefore we need to execute | ||
+ | |||
+ | <code>isis> fit_fun("relxilllp"); </code> | ||
+ | |||
+ | You can see all parameters by typing <code>list_par;</code> and set them using <code>set_par(...);</code>. In order to see how to use this function, you can call <code>help set_par</code> (note this is now without the ";"). | ||
+ | |||
+ | |||
+ | After we have set the parameters how we want them to be, we need to define a grid and evaluate the model on it. | ||
+ | |||
+ | <code>isis> variable lo,hi; </code> | ||
+ | |||
+ | <code>isis> (lo, hi) = log_grid(lo, hi); </code> | ||
+ | |||
+ | <code>isis> variable spectrum = eval_fun_keV(lo, hi); </code> | ||
+ | |||
+ | In order to convert the spectrum as energy flux, we need to convert it into the right units (hint: with <code>help eval_fun_keV</code> you can see which units the function returns). | ||
+ | |||
+ | <code>isis> spectrum *= 0.5*(lo+hi) / (hi-lo); </code> | ||
+ | |||
+ | The above statements multiplies the output with the mean bin energy, and divides it by the bin width. | ||
+ | |||
+ | |||
+ | Now these data can be plotted logarithmically using | ||
+ | |||
+ | <code>isis> xlog; ylog;</code> | ||
+ | |||
+ | <code>isis> hplot(lo,hi, spectrum);</code> | ||
[[Category:Isis / Slang]] | [[Category:Isis / Slang]] |
Revision as of 14:39, 6 October 2020
ISIS introduction for new students
General language features
- arrays
- operators & mathematical functions
where
- structs
Plotting with ISIS
[o][h]plot
{x,y}label
,title
{x,y}range
,{x,y}log
color
,linestyle
,connect_points
,pointstyle
multiplot
Data analysis
- FITS files
- histograms
Fitting with ISIS
load_data
group
,group_data
,rebin_data
[x]notice[_en]
fit_fun
,set_par
,edit_par
fit_counts
define_counts
Loading and Evaluating a Local Model
In the following we will see how we can load and evaluate a local model. This will be done by the example of the relxill
model.
First, the model package is not automatically loaded, so it needs to be loaded first. We also need the isisscripts loaded for this.
isis> require("isisscripts");
isis> use_localmodel("relxill");
Then we can use it to define the fit funtion we want to use. For now we want to use the lamp post version of the relxill model. Therefore we need to execute
isis> fit_fun("relxilllp");
You can see all parameters by typing list_par;
and set them using set_par(...);
. In order to see how to use this function, you can call help set_par
(note this is now without the ";").
After we have set the parameters how we want them to be, we need to define a grid and evaluate the model on it.
isis> variable lo,hi;
isis> (lo, hi) = log_grid(lo, hi);
isis> variable spectrum = eval_fun_keV(lo, hi);
In order to convert the spectrum as energy flux, we need to convert it into the right units (hint: with help eval_fun_keV
you can see which units the function returns).
isis> spectrum *= 0.5*(lo+hi) / (hi-lo);
The above statements multiplies the output with the mean bin energy, and divides it by the bin width.
Now these data can be plotted logarithmically using
isis> xlog; ylog;
isis> hplot(lo,hi, spectrum);