Build and browse your ISGRI
database
1.Build the database.
Create a directory where you will put your database (say,
mkdir ~/scratch/database
cd ~/scratch/database
and prepare the directory for the data analysis as it is described in
the initial set-up for the data
analysis exercise.
We select to analyse 3 pointings (019900530010, 019900540010,
019900550010)
from the Carina region. You can use the INTEGRAL archive to
select and save the corresponding SCW list into a file
DA_database_list.txt
The idea is that the set of standard analysis commands (like og_create,
ibis_science_analysis etc), which is saved into a shell-script
file
DA_database_script.csh
and copy the analysis script into this directory. To make the script
executable, change the mode:
chmod a+x DA_database_script.csh
Now study the content of the script to understand what it does and how
you can modify it in future to adjust for your purpouses.
Save the list of ScWs for your database in the database directory
and launch the script recursively:
foreach dir (`cut -c 10-21 <
DA_database_list.txt`)
source ./DA_database_script.csh
$dir
end
The foreach cycle will take each line of the file DA_database_list.txt,
take a substring between 10th and 21st character of the line (check
that this will give the number of ScW) and substitute it as an argument
for the DA_analysis_script.csh script.
Three pointings is not really a "database" but it will end
quickly giving you the
opportunity to run all the steps.
Obviously, the longer the list of
data the longer the time
to analyse and extract results!
It will take around 10 minutes
per each scw (a not too crowded field
was selected to speed
things up), so you have about 30 minutes to look at
the scripts
you just launched.
For each of the 3 pointings you will extract IMAGES: 17-40, 40-100,
100-300 keV
SPE: standard binning: 16 bins from 13 keV to 970 keV
and LCR: 17-40 keV, 300 sec. When the first one is finished you
might want to have a look at the results to
get familiar with
them. If the log file says no more "019900530010" then it is
very
likely that the first pointing analysis finished!
The results of the three pointings are in the directory $REP_BASE_PROD/obs
You can look into the script which builds the database to adjust it to
your needs.
2.Browse the database.
Now when your database is created in "OSA-friendly" format, you can
easily use some standard tools to collect the results for your source
of interest.
Collect source fluxes
Let us, for example, collect flux for a given source from images in
each ScW of the database with the help of OSA 5 tool src_collect
( NOTE: for this tool the files isgri_sky_res.fits MUST be unzipped so:
gunzip
$REP_BASE_PROD/obs/*/scw/*/isgri_sky_res.fits.gz
To browse the database you will need the list of ScW in it. To create a
text file with the list do
ls -1
$REP_BASE_PROD/obs/0*/scw/*/swg_ibis.fits.gz | awk '{print
$0"[1]"}' > list.ima.txt
to convert it into fits file:
txt2idx element="list.ima.txt"
index="list.ima.fits"
Now we can extract fluxes for all sources and all energy bands:
src_collect group=list.ima.fits+1
results=all.fits instName=ISGRI
fv all.fits
If we are interested in a particular source, say Cen X-3 and first
energy band
src_collect group=list.ima.fits+1 results=cen.fits instName=ISGRI
select="NAME == 'Cen X-3' && E_MIN==17"
fv
cen.fits
(the latter should be 3 lines)
Now use the alternative perl script that extracts ASCII files for each
source:
ima_pick.pl-1.03 .
Save this file into your database
directory and look at the content of the file
emacs ima_pick.pl-1.03 &
chmod a+x ima_pick.pl-1.03
You will extract results from the files that are
resulting from the
command at line 136:
@skyResFileList = `ls -1
$REP_BASE_PROD/obs/0*0/scw/*/isgri_sky_res.fits.gz`;
(you analysed 3 scws, you should have 3 files in
$REP_BASE_PROD/obs/0*0/scw/*/)
NOTE: if you did the gunzip
$REP_BASE_PROD/obs/*/scw/*/isgri_sky_res.fits.gz
command above because of src_collect, you may either zip that back or
change the line in
the perl script to
@skyResFileList = `ls -1
$REP_BASE_PROD/obs/0*0/scw/*/isgri_sky_res.fits`;
After that do:
./ima_pick.pl-1.03 --dbase_res_dir
./IMA_RES
the ascii files are in
ls -1 $REP_BASE_PROD/IMA_RES
you can develop any tool you prefer to read the ascii file (supermongo,
idl....).
Do ./ima_pick.pl-1.03
--h to have info on the extracted values.
Extract 100 sec lightcurves from the results
ls -1
$REP_BASE_PROD/obs/0*/scw/*/swg_ibis.fits.gz | awk '{print
$0"[1]"}' > list.lc.txt
txt2idx
element="list.lc.txt" index="list.lc.fits"
lc_pick
source='Cen X-3' attach=n \
group=list.lc.fits+1
lc=cenx3.lc.fits emin="17" \
lcselect='E_MAX==40'
instrument="ISGRI"
you obtain the 100 merged lightcurve
for Cen X-3. Study this lightcurve with fv:
fv
cenx3.lc.fits
Extract spectra from the results
ls -1
$REP_BASE_PROD/obs/0*/scw/*/swg_ibis.fits.gz | awk '{print
$0"[1]"}' > list.spe.txt
txt2idx element="list.spe.txt"
index="list.spe.fits[1]"
spe_pick group="list.spe.fits[1]"
source="Cen X-3"\
response=/isdc/arc/rev_2/ic/ibis/rsp/isgr_rmf_grp_0017.fits\
ancrfile=/isdc/arc/rev_2/ic/ibis/rsp/isgr_arf_rsp_0010.fits
\
rootname="CenX3"
instrument="ISGRI"
xspec11
data 1:1 CenX3_sum_pha.fits
data 2:2
CenX3_single_pha2.fits{1}
data 3:3
CenX3_single_pha2.fits{2}
data 4:4
CenX3_single_pha2.fits{3}
cpd /xs
plo lda
setplo en
plo lda
the 3 scws have the source at a high rate. You used the standard
binning for spectral extraction.
You can change that in the analysis creating your own rebinned response
matrix. See IBIS Cookbook
for more information.
NOTE: you analysed only 3 pointings, so there is not much statistics!
Try to
do the above (only the Browse part)
with the data from revolution 198 that I already analysed in
/unsaved_data/paizis/DEMO/obs/0198*
e.g. for the spectral part do:
cd $REP_BASE_PROD
ls -1
/unsaved_data/paizis/DEMO/obs/0198*/scw/*/swg_ibis.fits.gz | awk
'{print $0"[1]"}' > list.198.txt
(it will take longer than before...)
then
txt2idx element="list.198.txt"
index="list.198.fits"
and
spe_pick group="list.198.fits[1]"
source="Cen X-3"\
response=/unsaved_data/paizis/DEMO/isgr_rmf_grp_0016_log_2.fits\
ancrfile=/isdc/arc/rev_2/ic/ibis/rsp/isgr_arf_rsp_0010.fits
\
rootname="CenX3.198"
instrument="ISGRI"
that will take longer than before given that you are adding about 60
spectra instead of 3
xspec11
data 1:1 CenX3.198_sum_pha.fits
data 2:2
CenX3.198_single_pha2.fits{1}
data 3:3
CenX3.198_single_pha2.fits{5}
data 4:4
CenX3.198_single_pha2.fits{21}
cpd /xs
plo lda
setplo en
plo lda
As you may see, I had used a different binning than the standard one!
If you want you can work out the lightcurve and imaging extraction for
my revolution 198 results...
Now ssh to your home institution and launch your database script to
create the database for your source of interest!