tomasstolker / species

Toolkit for atmospheric characterization of directly imaged exoplanets
https://species.readthedocs.io
MIT License
22 stars 10 forks source link

Non-converged (?) exo-rem models in current grid #118

Open gabrielastro opened 6 days ago

gabrielastro commented 6 days ago

Plotting the models of the current exo-rem.tgz grid (from 2024-03-11), there are some suspicious non-monotonicities and some of my fits are getting stuck at the edge. For example (colour = flux):

These are just two examples and I have not looked systematically into this. (Let me know if I should!) I am looking forward to the new Exo-REM grids (#103) but in case you keep these older grids, it might be worth it to remove the offending models, which lead to spurious convergence, especially when at the grid edge. species interpolates over missing models, yes? Then I guess that removing them should work.

Thanks!

tomasstolker commented 2 days ago

Best to not interpolate a grid when in doubt about its convergence and in case of non-linear changes between grid points. I would recommend using CompareSpectra instead of FitModel: https://species.readthedocs.io/en/latest/tutorials/grid_comparison.html

I did create the new Exo-Rem TAR files, but haven't uploaded them yet...

tomasstolker commented 2 days ago

Nice 3D plot though!

gabrielastro commented 2 days ago

Actually, before running the grid, I was not in doubt about its convergence and naively implicitly assumed that everything was fine :face_in_clouds:. I did not know that there are suspicious models at random locations…

Thanks for the pointer to CompareSpectra! The main issue there is dimensionality (some model grids have much more than only Teff and log g as parameters), and one cannot use errorbar inflation, a second component, etc..

Based on the line "Fix missing grid points with a linear interpolation" in the output on the tutorial page, if I delete (move) the suspicious models from the data directory (and do not re-untar the tar file :wink:), species will just interpolate across the gap, yes? That might be better.

On a more philosophical level, of course the producers of any grid of models are ultimately responsible for making sure their models are converged but would it still make sense for you to check this somehow and "curate" a bit what you include or at least warn about models that stick out like this? That would be a strength of species because many users would otherwise not go through this trouble. I guess a little script could automatically check derivatives of flux with respect to all parameters and look for outliers. Maybe this kind of tool exists already…

Thanks—the 3D plots come basically from one easy line of gnuplot :smile: (here wrapped for display purposes):

teff="1600" ; logg="3.5" ; feh="1.0"
splot [1:1.9] for [i=10:80:5] \
  "exo-rem_teff_".teff."_logg_".logg."_feh_".feh."_co_0.".i."_spec.dat" \
   using 1:(i/100.):2:(i/100.) with lines lineweight 2 linecol palette title ""

or in fact sp [1:1.9] … u 1:(i/100.):($2):(i/100.) w l lw 2 lc pal t "" in shortened form :nerd_face:! Just a few more lines are needed to set American Typewriter as the font, change the axis labels, etc..