<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.sternwarte.uni-erlangen.de/wiki/index.php?action=history&amp;feed=atom&amp;title=Fake_an_Observation_with_ISIS</id>
	<title>Fake an Observation with ISIS - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.sternwarte.uni-erlangen.de/wiki/index.php?action=history&amp;feed=atom&amp;title=Fake_an_Observation_with_ISIS"/>
	<link rel="alternate" type="text/html" href="https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Fake_an_Observation_with_ISIS&amp;action=history"/>
	<updated>2026-06-08T04:16:08Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.7</generator>
	<entry>
		<id>https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Fake_an_Observation_with_ISIS&amp;diff=700&amp;oldid=prev</id>
		<title>Stierhof: copy from old wiki</title>
		<link rel="alternate" type="text/html" href="https://www.sternwarte.uni-erlangen.de/wiki/index.php?title=Fake_an_Observation_with_ISIS&amp;diff=700&amp;oldid=prev"/>
		<updated>2018-04-11T12:15:14Z</updated>

		<summary type="html">&lt;p&gt;copy from old wiki&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This little FAQ is taken from an eMail written by Jörn an 2013-02-10:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;i&amp;gt;when faking spectra you will pretty much always have to do two&lt;br /&gt;
things: a) simulate the spectrum based on a spectral model &amp;lt;b&amp;gt;and including&lt;br /&gt;
the appropriate background&amp;lt;/b&amp;gt; and b) simulate a background only. This is&lt;br /&gt;
necessary because in most cases in an imaging instrument you will be&lt;br /&gt;
measuring the background from a region in the observation itself.&lt;br /&gt;
Usually the background will be taken from a previous longer observation&lt;br /&gt;
that is available in a PHA file. If you're doing simulations with such a&lt;br /&gt;
background you need to make sure that the extraction region for the&lt;br /&gt;
background and the source (BACKSCAL) are identical,. By default, for&lt;br /&gt;
faked data sets isis assumes BACKSCAL=1, i.e. you need to do a&lt;br /&gt;
set_back_backscale(bla,1.) to ensure that the proper background&lt;br /&gt;
countrate is faked (if you do not do this you will underestimate the&lt;br /&gt;
background by A LOT - factors of 100000 are common...).&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require(&amp;quot;isisscripts&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
variable f_rmf = &amp;quot;src_sd.rmf&amp;quot;;&lt;br /&gt;
variable f_arf = &amp;quot;src_sd.arf&amp;quot;;&lt;br /&gt;
variable f_bkg = &amp;quot;back_sd.pha&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
% exposure time in seconds&lt;br /&gt;
variable expos=100000.;&lt;br /&gt;
&lt;br /&gt;
%%%%% define your spectral model here!!!!!! (fit_fun ...)&lt;br /&gt;
&lt;br /&gt;
%&lt;br /&gt;
% Fake source and background&lt;br /&gt;
%&lt;br /&gt;
variable iDat=1;&lt;br /&gt;
&lt;br /&gt;
variable rmf = load_rmf(f_rmf;strict=0);&lt;br /&gt;
variable arf = load_arf(f_arf;strict=0);&lt;br /&gt;
&lt;br /&gt;
% assign arf and rms&lt;br /&gt;
assign_arf(arf,iDat);&lt;br /&gt;
assign_rmf(rmf,iDat);&lt;br /&gt;
&lt;br /&gt;
% set the exposure (in sec)&lt;br /&gt;
set_arf_exposure (arf,expos);&lt;br /&gt;
set_data_exposure (iDat,expos);&lt;br /&gt;
()=define_back(iDat,f_bkg);&lt;br /&gt;
set_data_backscale(iDat,1.);  &lt;br /&gt;
set_back_backscale(iDat,1.);  &lt;br /&gt;
  &lt;br /&gt;
fakeit();&lt;br /&gt;
set_fake(iDat,0); % mark as a normal data set&lt;br /&gt;
&lt;br /&gt;
%&lt;br /&gt;
% fake background only&lt;br /&gt;
%&lt;br /&gt;
variable iBkg=2;&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
%%%% set all norms of your spectral model to zero here!!!!&lt;br /&gt;
&lt;br /&gt;
% assing arf and rms&lt;br /&gt;
assign_arf(arf,iBkg);&lt;br /&gt;
assign_rmf(rmf,iBkg);&lt;br /&gt;
&lt;br /&gt;
% set the exposure (in sec)&lt;br /&gt;
set_arf_exposure (arf,expos);&lt;br /&gt;
set_data_exposure(iBkg,expos);&lt;br /&gt;
&lt;br /&gt;
()=define_back(iBkg, f_bkg);&lt;br /&gt;
set_back_backscale(iBkg,1.); &lt;br /&gt;
set_data_backscale(iBkg,1.);&lt;br /&gt;
fakeit();&lt;br /&gt;
&lt;br /&gt;
% assign faked background to the spectrum and ignore it&lt;br /&gt;
variable bkgdata=get_data_counts(iBkg);&lt;br /&gt;
()=_define_back(iDat,bkgdata.value);&lt;br /&gt;
&lt;br /&gt;
delete_data(iBkg);&lt;br /&gt;
&lt;br /&gt;
%%% write your spectrum to file, fit it, or whatever here...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Isis / Slang]]&lt;/div&gt;</summary>
		<author><name>Stierhof</name></author>
	</entry>
</feed>