file: ciao_marx_process.txt Use MARX to simulate an HETG observation of a powerlaw w/lines. # - - - Extract HETG spectra Here we'll use TGCat scripts to run the ciao tools to process the simulation. Note that for real Chandra data when using the TGCat scripts, we'd first do Download and Configure steps which would create a sub-directory, e.g., obs_8487, with these files and/or simlinks: evt0 -> secondary/acisf08487_000N002_evt1.fits asol_1 -> primary/pcadf291118212N002_asol1.fits asol.list bpix1 -> primary/acisf08487_000N002_bpix1.fits flt1 -> secondary/acisf08487_000N002_flt1.fits msk1 -> secondary/acisf08487_000N002_msk1.fits pbk0 -> secondary/acisf291118240N001_pbk0.fits stat1 -> secondary/acisf08487_000N002_stat1.fits For MARX simulation processing we will create a similar sub-directory but with only the first three items in it (evt0, asol_1, and asol.list). - - - In the "working directory", setup the analysis sub-directory and files for each simulation: ...for the point source simulation: [unix] mkdir obs_hplaw [unix] cp hetg_plaw_evt2.fits obs_hplaw/evt0 [unix] cp hetg_plaw_asol1.fits obs_hplaw/asol_1 [unix] echo asol_1 | cat > obs_hplaw/asol.list ...for the disk simulation: [unix] mkdir obs_hpldisk [unix] cp hetg_pldisk_evt2.fits obs_hpldisk/evt0 [unix] cp hetg_pldisk_asol1.fits obs_hpldisk/asol_1 [unix] echo asol_1 | cat > obs_hpldisk/asol.list Now, process each simulation in turn by going into the simulation sub-directory: [unix] cd obs_hplaw ( OR: [unix] cd obs_hpldisk ) and running isis [unix] isis isis> % Once in isis carry out the following steps to run the % various ciao tools from isis. % load the s/w we're using variable tgc_path = "../scripts" ; prepend_to_isis_load_path( tgc_path ); require("tg_repro_fun"); % make the obs par set_exec( 2 ); setup_pfiles; % makes a param directory obs_info = read_config( "evt0" ); make_obspar; % Do nominal ACIS processing, but witout any bad pixels. % % Use the "new parameters" option to change the nominal behavior % of tools. In this way, here and below, we can change parameter % values for the tools to customize the processing. % Each time we redefined nps (" = Assoc_Type[ Any_Type ] ;" ) to clear it. % nps = Assoc_Type[ Any_Type ] ; nps["badpixfile"]="NONE"; nps["apply_cti"]="no"; acis_process_events_te(nps); % this takes of order 10 seconds % Do event filtering - just for grade, status and energy % ( For real data we would include GTI and destreak as well: % acis_evt_filter_ds ) % Change the output file to evt1: nps = Assoc_Type[ Any_Type ] ; nps["outfile"]="evt1"; acis_evt_filter_1(nps); % Get zeroth-order location: tgdetect; % % It's OK to get this message (CXC DS people say) : % # DMCOPY (CIAO 4.0 Beta 2): Bad data type in filter string formatting % Read the source location and counts in and show them: (x,y,c) = read_src1a_pos; x ; y ; c ; % For the POINT source example (obs_hplaw), tgdetect gives an OK center % location so we can leave x,y as is and skip to "Create the mask..." % OR: % % For the DISK simulation, obs_hpldisk, tgdetect finds a point on % the disk, not the real center. % We can use ds9 to manually find the real values; % if we didn't do it already we can do it from isis now: % isis> !ds9 evt1 % and then put the center values in by hand here: x = 4096.5; y = 4096.5; % Create the mask and resolve events: tg_create_mask(x,y); tg_resolve_events_te; % this takes ~ 10 seconds % Make the PHA file % % Use nominal extraction for the point source: tgextract; % OR: % % Extract a little wider to accomodate the disk source: nps = Assoc_Type[ Any_Type ] ; nps["min_tg_d"]=-0.0012; nps["max_tg_d"]=0.0012; tgextract(nps); % Make a light curve of the dispersed events lightcurve_ha; % And create the response files: orders=[-1,1]; % Modify the nominal parameters for the garf for marx simulation: nps = Assoc_Type[ Any_Type ] ; nps["maskfile"]="NONE"; nps["pbkfile"]="NONE"; nps["dafile"]="NONE"; nps["osipfile"]="NONE"; % % Make the arfs and rmfs: make_responses(orders, NULL, nps); % this takes a few minutes. % et voila. % Now we have pha2 file and the first-order responses. % Make summary plots... (not required, but they are nice) require( "summarize" ) ; % This creates a bunch of Plt_*.ps files. % for the point source simulation: variable ddir = "../obs_hplaw" ; hetgs_te_summary( ddir, "$ddir/Plt"$ ); % OR: % for the disk simulation: variable ddir = "../obs_hpldisk" ; hetgs_te_summary( ddir, "$ddir/Plt"$ ); % takes ~ 10 seconds % All done processing in this sub-directory isis> exit;