ISIS introduction for the new bachelor students

From Remeis-Wiki
Jump to navigation Jump to search

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;

The log_grid() function takes three inputs, min, max and the number of bins. The values given here are arbitrary.

isis> (lo, hi) = log_grid(0.2, 10, 1000);

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);