Loving ISIS - Confessions of a Former XSPEC User | ||
Functions in My .isisrc Files
Below I printout the brief descriptions found at that top of each of
my No guarantees that any of these are particularly intelligently programmed. (In fact, I can guarantee that some most assuredly are not.) But again, they get the job done well-enough. Loading Data ( % list_all : List all the data, arfs, and rmfs % read_radio : Read radio data from an ascii file, load to struct. % load_radio : Take the structure above, and load it into data % read_optical : Read (optical) data from file where the units are A_lo, % A_hi, mJy, Delta mJy % clear_all : Wipe out all data, arfs, and rmfs % load_data_integral: load INTEGRAL data % fits_write_pha: Write out a fits pha file; stolen from Manfred Hanke Errors Bars & Custom Statistics ( % sep_grid : Set the eval method to SEPARATE_GRID % mrg_grid : Set the eval method to MERGED_GRID % usr_grid : Set up logarithmically spaced USER_GRIDs % fstat_mod : Set the fit statistic to sigma=model % fstat_gehr : Set the fit statistic to sigma=gehrels % fstat_norm : Set the fit statistic to sigma=data % lmdif : Set the fit method to lmdif % mpfit : Set the fit method to mpfit % minim : Set the fit method to minim % subplex : Set the fit method to subplex % marq : Set the fit method to marquardt % conf_map_fail_hook : Switch between subplex/lmdif when doing % error contours, and the fit fails % conf_map : Call conf_map_counts with conf_map_fail_hook % corback : Set the data background to have a fittable % normalization, using the back_fun utility % fcorback_fit : The fit function used by corback % corfile : In addition to the data background, set another % background subtracted file as a background with % fittable normalization % fcorfile_fit : The fit function used by corfile % bayes_nconf : Bayesian estimate of lower/upper counts bound % given observed counts & significance % bayes_sconf : Bayesian estimate of lower/upper significance bound % given observed counts & desired lower/upper bounds Custom Fit Functions ( % simple_gpile_fit : Gratings Pileup correction function % (New, better version than in "ABC Guide to Pileup") % Manfred Hanke's even better simple_gpile + associated functions % simple_gpile2_fit % use_simple_gpile % get_unpiled_fit_fun % get_unpiled_data_flux % The following work presuming data x-axis follows keV (i.e., Hz -> keV % for PSD): % mgauss_fit : Gaussian absorption that's never < 0 (multiplicative) % qpo_fit : Lorentzian, normalized to QPO rms (counts/bin) % zfc_fit : Zero-frequency centered Lorentzian (counts/bin) % plaw_fit : Counts/bin power-law % bkn_plaw_fit : Counts/bin broken power-law % dbkn_plaw_fit : Counts/bin doubly broken power-law % rms_gauss_fit : Counts/bin Guassian, normalized to RMS. % sinwave_fit : Counts/bin sine wave % four_chip_fit : Renorm for specific ACIS chips % three_chip_fit : Renorm for specific ACIS chips % chip() : Combining the above two % The following work presuming x-axis follows Angstrom: % aqpo_fit : Lorentzian, normalized to QPO rms (counts/bin) % azfc_fit : Zero-frequency centered Lorentzian (counts/bin) % aplaw_fit : Counts/bin power-law % abkn_plaw_fit : Counts/bin broken power-law % adbkn_plaw_fit : Counts/bin doubly broken power-law % asinwave_fit : Counts/bin sine wave % asqrwave_fit : Counts/bin square waveNote: A number of the above fit functions were designed for use in timing analysis with ISIS. Normally, ISIS and XSPEC functions calculate a fit function as a bin integral quantity. For timing analysis, I effectively define the average power spectrum in terms of counts per bin, and want to compute models as bin averaged. Hence the models above. (I also find a number of these models, especially the Lorentzian in qpo_fit(); , to be more stable when the
integral over the bin is done analytically, rather than numerically.)
Note also that ISIS has intrinsic fit functions, bin_width
and bin_width_en that can be combined with XSPEC fit
functions to similar effect.
Flux Calculation Functions ( % eqw : Calculate a line equivalent width in mA and eV % data_flux : Calculate the flux between two bounds, based upon the % observed data (does not extend beyond data grid) % model_flux : Calculate the flux between two bounds, based upon the % fitted model (does not extend beyond model grid) % calc_flux : Calculate the flux based upon the fitted model, using % an arbitrary grid (full grid must be input) % flux_err : Monte Carlo estimate of model flux errors (probably % wrong in practice in most cases) Plotting Functions ( % pg_info : Writes out useful info about plotting choices. % pg_color : Make a few nice colors for pgplot % sov : An abbreviation of set_outer_viewport % apj_size : An autoset of resize/set_outer_viewport that works % well for a "typical" ApJ one column plot. % keynote_size : An autoset of resize/set_outer_viewport that works % well for a "typical" keynote presentation. % open_print : A version of open_plot that invokes pg_color first % close_print : A version of close_plot that will then display the % hardcopy via a chosen system utility (e.g., gv) % set_plot_widths : Routine to set all the plot line thicknesses % nice_width : An autoset of plot widths that works well for % papers and presentations (especially on Macs) % set_plot_labels : Resets all plot labels to their defaults, and can % be used to change the default font. % new_plot_labels : Change the plot labels for all plot styles. % add_plot_unit : Create new X-/Y-unit combinations for the plots % fancy_plot_unit : My variation on ISIS's plot_unit. Same choices as % in ISIS, but this saves variables (x_unit, y_unit) % that will be used below. % data_list : List version of all_data % write_plot : Write the data from the plot functions to ASCII % files % plot_counts : Plot background subtracted data as counts/bin, % with choices of three kinds of residuals, or none % at all. (cstat overides defaults) % plot_data : Main plotting routine, to plot background sub- % tracted data in detector counts space. Counts % per second per x_unit, with choices of three % kinds of residuals, or none at all. % plot_residuals : A plot of just the data residuals % plot_fit_model : An hplot of just the background subtracted model. % plot_unfold : A plot of the unfolded spectra, or powers of % energy/freq./wavelength times unfolded spectra. % plotxy : Simple x-y (o)plots with error bars. % plot_comps : Plot individual components of a model % plot_double : Use two fancy plot functions at once, while also % plotting individual components of a model
To actually download the Next up: ISIS Power Tools. |
This page was last updated Oct 7, 2013 by Michael Nowak. To comment on it or the material presented here, send email to mnowak@space.mit.edu.