astro-group-bristol / LibXSPEC_Relxill_jll.jl

Other
0 stars 0 forks source link

Data file required for relxill model #1

Open phajy opened 11 months ago

phajy commented 11 months ago

Could you please add the files needed for the relxill model to the release? I believe we need the following:

standard xillver table: xillver-a-Ec5.fits.gz

I will issue a separate PR for SpectralFittingExtras which will use this.

fjebaker commented 11 months ago

The data file is distributed in Extras, so I will close this issue here.

fjebaker commented 11 months ago

Ah sorry I didn't realize what repo this is!

fjebaker commented 11 months ago

Yep so I can see in the readme the only data file I included was

file: http://www.sternwarte.uni-erlangen.de/~dauser/research/relxill/rel_table_v0.5a.fits.gz

I didn't include all of them because well, from Dauser's website:

all tables: relxill_tables.tgz (7GByte)

Checking now it seems that the file you are wanting to have included in the binary distribution is nearly 1GB, so I might dump it on the astro server and have it become a dynamic data dependency.

fjebaker commented 11 months ago

@phajy how did you identify that this table was needed / what are you trying to do? There might be some more code wrapping required.

phajy commented 11 months ago

Ah, thanks. Yes, these files are very large. I found out when trying to evaluate the Relxill model (see below) which couldn't find the datafile. Everything worked fine when I downloaded it by hand to the path it was looking for.

julia> model = XS_PhotoelectricAbsorption(ηH=FitParam(0.1)) * XS_Relxill(K=FitParam(1.0E-2, upper_limit=1.0), logxi=FitParam(2.5), refl_frac=FitParam(1.0, upper_limit=10.0))
┌ CompositeModel with 2 component models:
│      m1 * a1
│ Model key and parameters:
│    a1 => XS_Relxill
│              K_1 ->   0.01 ± 0.001  ∈ [ 0, 1     ]   FREE
│         index1_1 ->      3                             FROZEN
│         index2_1 ->      3                             FROZEN
│        r_break_1 ->     15                             FROZEN
│              a_1 ->  0.998                             FROZEN
│          θ_obs_1 ->     30 ± 3      ∈ [ 4, 86    ]   FREE
│        inner_r_1 ->     -1                             FROZEN
│        outer_r_1 ->    400                             FROZEN
│              z_1 ->      0                             FROZEN
│          Gamma_1 ->      2 ± 0.2    ∈ [ 1, 3.4   ]   FREE
│          logxi_1 ->    2.5 ± 0.2    ∈ [ 0, Inf   ]   FREE
│            Afe_1 ->      1                             FROZEN
│           Ecut_1 ->    300                             FROZEN
│      refl_frac_1 ->      1 ± 0.1    ∈ [ 0, 10    ]   FREE
│    m1 => XS_PhotoelectricAbsorption
│             ηH_1 ->    0.1 ± 0.01   ∈ [ 0, Inf   ]   FREE
└
julia> prob = FittingProblem(model => data)
┌ FittingProblem:
│   Models:
│     . CompositeModel[XS_PhotoelectricAbsorption * XS_Relxill]
│   Data:
│     . XmmData[dev=XmmEPIC(),obs_id=0029740101]
└
julia> result = fit(prob, LevenbergMarquadt())
 *** loading RELXILL model (version 2.3) ***
 *** error in relxill (open_fits_table_stdpath): opening of the table failed!
    either the full path given (/Users/phajy/.julia/artifacts/85cfa829f2746f3daf7cd43a4732d1128d2ec125/data/xillver-a-Ec5.fits) is wrong
    or you need to download the table ** xillver-a-Ec5.fits **  from
    https://www.sternwarte.uni-erlangen.de/research/relxill/

[15167] signal (11.2): Segmentation fault: 11
in expression starting at REPL[11]:1
_Z17is_relbase_cachedP10cache_info at /Users/phajy/.julia/artifacts/85cfa829f2746f3daf7cd43a4732d1128d2ec125/lib/relxill.dylib (unknown line)
_Z15relbase_profilePdiP8relParamP9RelSysParP9xillTablePKdiPi at /Users/phajy/.julia/artifacts/85cfa829f2746f3daf7cd43a4732d1128d2ec125/lib/relxill.dylib (unknown line)
Allocations: 32020293 (Pool: 31997630; Big: 22663); GC: 47
zsh: segmentation fault  Julia
fjebaker commented 11 months ago

Ah I think that's my oversight with not having modified the refl_frac parameter before. Right, that's quite a simple fix then that I can do today :)

fjebaker commented 11 months ago

@phajy did you create a new model wrapper for XS_Relxill? I can't see it in Extras/Relxill?

Edit: I am all over the place today. I see you've opened a PR for it 👍