% zo_1d_analysis.i % % Read in the isis-format zo 1D histogram files % from Capella, Mkn 421, and MARX capella simulation % and scale and plot the distributions. % 1/5/00 dd % get_data variables: variable dds_obs_out_dir, data_set_name; % - - - - - % more variables ... % Simulation variables: variable simm, simp, csimm, csimp; % Variables to scale the observations, etc. variable obs_fact, sim_fact, streak_fact; % variables to keep average background count in variable background; % variables for the result of get_data variable gdlo, gdhi, gdval, gderr; % and pixel scales variable meg_angpix, heg_angpix, use_angpix; meg_angpix = 0.011124491; heg_angpix = 0.0055625373; % - - - - - % Default selection of counts or flux here... use_counts; % Load some zero-order profiles: % Capella 1318 zero-order % Capella 1318 streak % Mkn 421 457 zero-order data_set_name = "Capella(1318), Mkn 421(457), and Sim_1318"; ()=load_data("/spectra/d2/GtoHAK/Obs_out/" + "obsid_1318_Sky_zo_1d_isis.dat"); ()=load_data("/spectra/d2/GtoHAK/Obs_out/" + "obsid_1318_Sky_strk_1d_isis.dat"); ()=load_data("/spectra/d2/GtoHAK/Obs_out/" + "obsid_457_Sky_zo_1d_isis.dat"); ()=load_data("/spectra/d2/GtoHAK/Obs_out/" + "obsid_457_Sky_strk_1d_isis.dat"); % default is for cannonical set of four HETG spectra: megm=1; megp=2; hegm=3; hegp=4; % modify colors cmegm=yellow; cmegp=yellow; chegm=green; chegp=green; % Load simulation % Simulation: aTDET w/background %%()=load_data("/spectra/d2/GtoHAK/MARX_out/" + %% "sim_capella_aTDET_zo_1d_isis.dat"); %%()=load_data("/spectra/d2/GtoHAK/MARX_out/" + %% "sim_capella_aTDET_strk_1d_isis.dat"); % Set sim_fact so that sim_capella and Capella STREAKs agree % 1/0.66 factor from time apodization in sim aTDET analysis %%sim_fact = 1.0/0.66; % Simulation: Sky, no background ()=load_data("/spectra/d2/GtoHAK/MARX_out/" + "Capella-3.001_Sky_zo_1d_isis.dat"); ()=load_data("/spectra/d2/GtoHAK/MARX_out/" + "Capella-3.001_Sky_strk_1d_isis.dat"); % Set sim_fact so that sim_capella and Capella STREAKs agree % Factor of 1.0 should be close ... sim_fact = 1.0; % define simulation indices and colors simm=5; simp=6; csimm=purple; csimp=mediblue; %--------------- remove the average background level -------------------- % Loop over data sets! message(""); fdata=1; while ( fdata < 7 ) { rsout = region_sum(fdata, 1.0,50.5); background = rsout.sum; rsout = region_sum(fdata, 149.5,199.0); background = rsout.sum + background; % get the data set (gdlo, gdhi, gdval, gderr) = get_data(fdata); % the sum was over 1/2 of the bins background = background/(0.5*length(gdval)); message("hist index "+string(fdata)+" background cnts/bin = "+ string(background)); gdval = gdval - background; put_data(fdata, gdlo, gdhi, gdval, gderr); fdata = fdata + 1; } message(""); %--------------- set the data colors -------------------- set_data_color(megm,cmegm); set_data_color(megp,cmegp); set_data_color(hegm,chegm); set_data_color(hegp,chegp); set_data_color(simm,csimm); set_data_color(simp,csimp); % % Process the 1D profiles (in pixels) to be offset to % realistic Angstroms... % use_angpix = meg_angpix; % Set obs_fact so that Mkn 421 and Capella zeroth -order wings agree obs_fact = 3.8; % Normalize the streak to the same scale as the zeroth-order % Ratio of zeroth-order exposure time to streak exposure time, % include fact that the HAK streak excludes ~240 rows: streak_fact = 3200.0 / (41.0 * ((1022.-240.0)/1022.0)) ; % Capella % Zero-order (gdlo, gdhi, gdval, gderr) = get_data(megm); gdlo = 15.0+use_angpix*(gdlo-100.0); gdhi = 15.0+use_angpix*(gdhi-100.0); put_data(megm, gdlo, gdhi, gdval, gderr); % Streak, scale the counts (gdlo, gdhi, gdval, gderr) = get_data(megp); gdlo = 15.0+use_angpix*(gdlo-100.0); gdhi = 15.0+use_angpix*(gdhi-100.0); gdval = gdval * streak_fact; gderr = gderr * streak_fact; put_data(megp, gdlo, gdhi, gdval, gderr); % Capella SIMULATION % Zero-order (gdlo, gdhi, gdval, gderr) = get_data(simm); gdlo = 15.0+use_angpix*(gdlo-100.0); gdhi = 15.0+use_angpix*(gdhi-100.0); gdval = sim_fact * gdval; gderr = sim_fact * gderr; put_data(simm, gdlo, gdhi, gdval, gderr); % Streak, scale the counts (gdlo, gdhi, gdval, gderr) = get_data(simp); gdlo = 15.0+use_angpix*(gdlo-100.0); gdhi = 15.0+use_angpix*(gdhi-100.0); gdval = sim_fact * gdval * streak_fact; gderr = sim_fact * gderr * streak_fact; put_data(simp, gdlo, gdhi, gdval, gderr); % Mkn 421 % Zero-order (gdlo, gdhi, gdval, gderr) = get_data(hegm); gdlo = 15.0+use_angpix*(gdlo-100.0); gdhi = 15.0+use_angpix*(gdhi-100.0); gdval = obs_fact * gdval; gderr = obs_fact * gderr; put_data(hegm, gdlo, gdhi, gdval, gderr); % Streak, scale the counts (gdlo, gdhi, gdval, gderr) = get_data(hegp); gdlo = 15.0+use_angpix*(gdlo-100.0); gdhi = 15.0+use_angpix*(gdhi-100.0); gdval = obs_fact * gdval * streak_fact; gderr = obs_fact * gderr * streak_fact; put_data(hegp, gdlo, gdhi, gdval, gderr); % Notice only the core of the streak histograms fdata=2; while ( fdata < 7 ) { xnotice(fdata, 15.0-2.0*use_angpix, 15.0+2.0*use_angpix); fdata = fdata + 2; } % Plot the data... LABEL_BY_DEFAULT=1; window(p1); plot_bin_density; ylog; yrange(3.0, 6.8); xrange(15.0-10.0*use_angpix, 15.0+10.0*use_angpix); color(white); % simulation plot_data(simm); oplot_data(simp); color(white); xylabel(15.04, 6.2, "simulation factor = "+string(sim_fact) ); color(csimp); xylabel(14.985, 3.6, "Sim_1318 Streak"); color(csimm); xylabel(14.985, 3.4, "Sim_1318 Zeroth-order"); color(white); xylabel(15.04, 6.4, "streak factor = "+string(streak_fact) ); % Mkn 421 oplot_data(hegm); color(chegm); xylabel(14.92, 6.0, "Mkn 421 Zeroth-order"); % Mkn 421 streak is pretty weak... %%oplot_data(hegp); %%color(chegp); %%xylabel(14.92, 5.8, "Mkn 421 Streak"); % color(white); xylabel(15.04, 6.0, "Mkn 421 factor = "+string(obs_fact) ); % Capella oplot_data(megp); oplot_data(megm); color(cmegp); xylabel(14.92, 6.4, "Capella Streak"); color(cmegm); xylabel(14.92, 6.2, "Capella Zeroth-order"); color(white); xylabel(15.04, 6.4, "streak factor = "+string(streak_fact) ); label("","",data_set_name+": Zeroth Order 1D Projections");