define apec() { % T, abund, norm, binlo, binhi % % Uses the built-in isis routine model_spectrum. % % flux = model_spectrum (bin_lo, bin_hi); % variable T, abund, norm, binlo, binhi, inpbinlo, inpbinhi; variable i, index; if ((_NARGS != 4) and (_NARGS != 5)) { message("Call as:"); message("apec(T, abund, norm, bin_lo, bin_hi) where"); message("T = temperature (in keV)"); message("abund = abundance (in solar units)"); message("norm = emission measure / 4 pi D^2"); message("bin_lo and bin_hi are in Angstroms"); _pop_n(_NARGS); return NULL; } if (_NARGS == 4) { %message("Warning: Code meant to run with integrate ON, not off."); (T, abund, norm, inpbinlo) = (); % % Check to see if backward % if (inpbinlo[1] < inpbinlo[0]) { index = [length(inpbinlo)-1:0:-1]; } else { index = [0:length(inpbinlo)-1:1]; } binlo = inpbinlo[index]; binhi = @binlo; for (i=0;i