-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from eblur/rogantini_fek
Add Rogantini (2018) Fe K olivine cross-section to absorption model
- Loading branch information
Showing
10 changed files
with
404 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#! /usr/bin/env isis | ||
|
||
%% olivineabs.sl -- Reads in table model data olivine absorption and applies it. | ||
%% This is a user defined model for fitting with ISIS. | ||
%% If using this model, please cite Corrales et al. (2016) | ||
%% http://adsabs.harvard.edu/abs/2016MNRAS.458.1345C | ||
%% and Rogantini et al. (2018) | ||
%% http://adsabs.harvard.edu/abs/2018A%26A...609A..22R | ||
%% | ||
%% 2018.06.23 - [email protected] | ||
%%--------------------------------------------------------------------- | ||
|
||
_traceback = 1; | ||
|
||
variable ISMPATH = getenv("ISMDUSTROOT"); | ||
variable OLIV_FILE = ISMPATH + "/edge_files/olivine_abs.fits"; | ||
|
||
private define read_xsect( filename ) | ||
{ | ||
variable wavel, xabs; | ||
(wavel, xabs) = fits_read_col(filename, "angstroms", "abs"); | ||
|
||
return struct{wavel=wavel[[::-1]], tau_abs=xabs[[::-1]]}; | ||
} | ||
|
||
static variable X_lo, X_hi, Value; | ||
static variable olv_ext = read_xsect(OLIV_FILE); | ||
|
||
define olivineabs_fit(lo, hi, par, fun) | ||
{ | ||
variable olv_md = par[0]; | ||
variable Angs = 0.5*(lo+hi); | ||
variable tau = olv_md * interpol(Angs,olv_ext.wavel,olv_ext.tau_abs); | ||
|
||
return fun * exp(-tau); | ||
} | ||
|
||
define olivineabs_defaults(i) | ||
{ | ||
switch(i) | ||
{ case 0: % olv_md | ||
return ( 1.0, 0, 0, 10000 ); | ||
} | ||
} | ||
|
||
add_slang_function ("olivineabs", ["olv_md"]); | ||
set_function_category("olivineabs", ISIS_FUN_OPERATOR); | ||
set_param_default_hook("olivineabs", "olivineabs_defaults"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
variable x1, x2, yext, yabs, ysca; | ||
|
||
require("ismdust"); | ||
(x1, x2) = linear_grid(1.0, 40.0, 10000); | ||
|
||
fit_fun("ismdust(1, constant(1))"); | ||
yext = eval_fun(x1, x2); | ||
|
||
fit_fun("ismdust_abs(1, constant(1))"); | ||
yabs = eval_fun(x1, x2); | ||
|
||
fit_fun("ismdust_sca(1, constant(1))"); | ||
ysca = eval_fun(x1, x2); | ||
|
||
% plots the cross-sections (tau, unitless) | ||
|
||
xlog; ylog; | ||
hplot(x1, x2, -log(yext), 1); | ||
ohplot(x1, x2, -log(yabs), 2); | ||
ohplot(x1, x2, -log(ysca), 4); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
variable x1, x2, y; | ||
|
||
require("olivineabs"); | ||
(x1, x2) = linear_grid(1.0, 2.5, 1000); | ||
fit_fun("olivineabs(1, powerlaw(1))"); | ||
set_par(3, 100.0); | ||
y = eval_fun(x1, x2); | ||
xlog; ylog; | ||
hplot(x1, x2, y); |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
olivineabs 2 0.01 1.e6 olivineabs mul 0 | ||
moliv 10^-4 1.0 0. 0. 1E4 1E5 1E-3 | ||
redshift " " 0.0 -1.0 0.0 10. 10. -0.01 |
Oops, something went wrong.