Comments (3)
Looks like I was wrong and the sporadic error reported above seems to actually originate from X-PSI producing NaNs for high emission angles, for which the emission angle is very close to 90 degrees. For those situations are apparently checked if sin_alpha==1
, but that does not thus capture e.g. sin_alpha= 0.9999999999999989
, which is also problematically close to 1.0, and produces NaNs in the further calculation.
Here is the line causing the problem (giving NaN for the w_R
parameter):
Line 223 in 29ead0d
This can be fixed either by modifying the sin_alpha check (to avoid also small deviations from sin_alpha=1) or by setting (after those lines):
if gsl_isnan(w_R):
w_R = 0.0
After doing this fix (the latter way), the calculation is not anymore sporadically terminated (or neglected if doing sampling). After this fix, the likelihood changes in my test case (for the first parameter vector reported above) from -37043.99135451222 to -37043.99135647802.
from xpsi.
If commenting the error handling raising this error in Likelihood.py, the code instead crashes and raises randomly this error
RayError: Fatal numerical problem during ray integration.
It seems to originate from GSL library functions used for integration in rays.pyx. There lines with status = gsl_integration_qag(...)
can return some times Failed as their status and some times not, given the same input (but need to still re-check that). So it looks likely a problem with GSL to me.
from xpsi.
The randomness of the warning apparently comes from this line
Line 401 in 29ead0d
where the termination condition depends on the deflection angle calculated for the previous grid point. And when having NaNs, that previous grid point has not been properly set but it includes some random values from the memory.
from xpsi.
Related Issues (20)
- The Final Py2 release broke the link to the py3. documentation. HOT 4
- Install instruction for pymultinest on Mac HOT 1
- Make sure that all AssertionErrors in the Instrument class are explicit enough
- HPC installation instruction for MultiNest on Snellius missing `make` HOT 2
- Write new install instructions for CALMIP
- Synthetic data are not created if correct settings are not used. Force it do it always?
- Change is_secondary in Hot_region_complexity HOT 4
- Add mpiexec pymultinest_demo.py to installation instruction
- Check tutorials/notebook for mentions of `antiphase=True` or `-0.5` phase added in Priors HOT 3
- projection tool not working for PDT-U
- CustomInstrument script in module generator HOT 5
- "ValueError: Invalid caching targets" issue when post processing HOT 3
- Bug when defining a `param_plot_lims` in a Corner plot post-processing HOT 6
- Retrieve curves data from SpectrumPlot HOT 2
- Residual (and probably signal) plots not working if having many photosphere objects
- Several bugs with zero count cases in likelihood marginalisation over background
- No API for CornerPlotter showing on documentation page HOT 4
- `HotRegion.set_num_cells` reverts to default values for arguments not passed
- Wrong units for the output flux in documentation HOT 1
- Useless argument `multimodal` generated for config file by `module_generator`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xpsi.