cylammarco / wdphottools Goto Github PK
View Code? Open in Web Editor NEWWDPhotTools--A White Dwarf Photometric Toolkit in Python
License: BSD 3-Clause "New" or "Revised" License
WDPhotTools--A White Dwarf Photometric Toolkit in Python
License: BSD 3-Clause "New" or "Revised" License
On the left, it is the correct plot of the white dwarf cooling sequence at different surface gravity using the CT interpolator. On the right, it uses the RBF interpolator. I believe there is something wrong with the list/array handling somewhere in the atmosphere model reader, and for some reason, fitter can use the RBF interpolator to fit WD atmosphere properly but in plotter it fails.
Currently, WDfitter holds an instance of AtmosphereModelReader. It should be inheriting it to make the future extensions of the package easier without needing to write a wrapper function for every new method added.
This only happens when the burst duration is very short (~10^7).
There may be inconsistent units used for different models in the interpolator.
Python class should start capitalised.
WDPhotTools/src/WDPhotTools/theoretical_lf.py
Lines 1359 to 1360 in 9de2848
These two lines should move above the CSV so that in case of CSV export failed, the computed density can still be retrieved from the object directly.
Hi, I am trying to fit for the WD mass and Mbol. Broadly, I am following the approach outlined here: https://wdphottools.readthedocs.io/en/latest/tutorials/fitting.html. From what I understood, one needs to pick for the independent list one parameter from (Mbol or Teff) and the second one from (mass/Mbol) for the fitting. I am trying to run something like this:
from WDPhotTools.fitter import WDfitter
ftr = WDfitter()
ftr.fit(
atmosphere="H",
filters=["G3", "G3_BP", "G3_RP"],
mags=[19.1, 18.8, 19.2],
mag_errors=[0.006, 0.01, 0.07],
distance=210.0,
distance_err=10,
extinction_convolved=True,
kind="cubic",
Rv=3.1,
ebv=0.1,
independent=["Mbol", "mass"],
initial_guess=[13.0, 0.6],
method="least_squares"
)
but I keep getting this error:
ValueError Traceback (most recent call last)
[<ipython-input-58-2b54e9b12163>](https://localhost:8080/#) in <cell line: 4>()
2 ftr = WDfitter()
3
----> 4 ftr.fit(
5 atmosphere="H",
6 filters=["G3", "G3_BP", "G3_RP"],
[/usr/local/lib/python3.9/dist-packages/WDPhotTools/fitter.py](https://localhost:8080/#) in fit(self, atmosphere, filters, mags, mag_errors, allow_none, distance, distance_err, extinction_convolved, kind, Rv, ebv, ra, dec, independent, initial_guess, logg, atmosphere_interpolator, reuse_interpolator, method, nwalkers, nsteps, nburns, progress, refine, refine_bounds, kwargs_for_RBF, kwargs_for_CT, kwargs_for_minimize, kwargs_for_least_squares, kwargs_for_emcee)
2061 # the [:2] is to separate the distance from the filters
2062 self.best_fit_params[j][i] = float(
-> 2063 self.interpolator[j][i](self.results[j].x[0])
2064 )
2065
[/usr/local/lib/python3.9/dist-packages/WDPhotTools/atmosphere_model_reader.py](https://localhost:8080/#) in atmosphere_interpolator(*x)
486 def atmosphere_interpolator(*x):
487
--> 488 x_0, x_1 = np.asarray(x, dtype="object").reshape(-1)
489
490 if independent[0] in ["Teff", "age"]:
ValueError: not enough values to unpack (expected 2, got 1)
I am probably missing something obvious. I would be glad for any help.
Thanks.
It is reported that the error estimations are wrong: empty when directly using minimiser, way underestimated when using MCMC.
Currently, WDLF holds an instance of CoolingModelReader. It should be inheriting it to make the future extensions of the package easier without needing to write a wrapper function for every new method added.
Hi, thanks for letting me know. Also found that when running on scipy 1.8.1 everything runs ok but when running on scipy 1.9 I get the following error: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''.
Originally posted by @cm775 in #15 (reply in thread)
Harris et al. (2006) used the following scheme in https://arxiv.org/pdf/astro-ph/0510820.pdf
The SDSS database gives the total interstellar absorption and reddening along the line of sight for each star, determined from the reddening maps of Schlegel et al. (1998). Because most of the WDs in this paper have distances within a few hundred pc, they are affected by only a fraction of the total absorption and reddening. This fraction is determined as part of the fitting for the distance of each star in an iterative procedure. We make the assumption that the absorption is zero for stars with distances < 100 pc, that it is the full absorption for stars with distances from the Galactic plane |z| > 250 pc, and that the absorption varies linearly along the line of sight between these distances.
Error message as follow
>>> ftr.show_best_fit(display=False)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "c:\xxxxxxxxxxxxxxxxxxxxxx\wdphottools\WDPhotTools\fitter.py", line 2268, in show_best_fit
reddening = [
File "c:\xxxxxxxxxxxxxxxxxxxxxx\wdphottools\WDPhotTools\fitter.py", line 2269, in <listcomp>
self.best_fit_params[k]["Av_" + f]
KeyError: 'Av_g_ps1'
include MS lifetime models at different metallicities.
The current plots are showing the fitted solution using 5 Pan-STARRS and 3 Gaia filters, but the code also includes JHK photometry.
Move the cooling model interpolator from theoretical_lf.py
to cooling_model_reader.py
as it should be the method under the cooling model reader.
RBF interpolator does not natively support rescaling before interpolation. This has to be done before interpolating the Temperature because the dynamic range is very different from the mass, Mbol and logg.
The current C18 IFMR in code is not the authors' adopted solution that is based on the MIST stellar evolution model, see
https://ui.adsabs.harvard.edu/abs/2018ApJ...866...21C/abstract
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.