Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GSoC] Formal integral Project #740

Merged
merged 36 commits into from
Jun 23, 2017
Merged

[GSoC] Formal integral Project #740

merged 36 commits into from
Jun 23, 2017

Conversation

yeganer
Copy link
Contributor

@yeganer yeganer commented Jun 12, 2017

Continuation of #726

This PR contains all changes related to the formal integral project. This is an aggregation PR. That means future changes will be made as PR to the feature branch formal_integral. Once that branch is feature complete, it will be merged into master.

Milestones:

yeganer added 17 commits June 9, 2017 10:50
This implementation is siginficantly faster than the python version.
This reduces the time to traverse the line list by a huge amount for a
huge number of lines, especially if the start is near the red end of the
line list.
Currently the c function expects a storage model, a blackbody
temperature, an array of frequencies, the length of said array, the
source function and the number of integration points. The function
returns a array with the same length as the frequency array. Remember to
free the result to prevent memory leaks.

The python wrapper expects a simulation object, a np.ndarray of
frequencies and the number of integration points.

Additionally the identation of the C code was changed
Expand documentation

Fix bug in populate_z.
In very rare cases when the outermost p line has an equal distance to
the center as the radius of the outer shell, the code could try to
access memory out of bounds.
The class stores a reference to model, plasma and runner to be able to
calculate the formal integral.
In this implementation it is first instantiated in MontecarloRunner.run() and available thereafter.
It returns a TARDISSpectrum of the integrated spectrum.
The FormalIntegrator is responsible for all calculations associated with
the formal integration method. It contains methods to calculate the
source function and a wrapper to the c implementation.
There is a new option under spectrum which defaults to 'virtual' but can
be set to 'real' or 'integrated' as well.
yeganer and others added 9 commits June 12, 2017 15:00
- real
default: virtual
description: The method to generate the final spectrum
description: Final spectrum sampling
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice - for now we need to check however that FI is only used with:

  • downbranch
  • disable_electron_scattering

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see #746

yeganer and others added 3 commits June 19, 2017 15:50
The current implementation of the formal integral can only handle 'downbranch' and disabled
electron scattering. So we raise a ConfigurationError if we find
incompatible settings.
[TEP005][CONFIG] Prevent incompatible configurations
@unoebauer unoebauer requested review from chvogl and talytha June 20, 2017 09:34
yeganer and others added 7 commits June 20, 2017 11:42
This is a shortcut for obtaining an integrated spectrum for the
wavelength grid defined in the configuration file. If incompatible
configuration settings are detected, an IntegrationError is raised.
[TEP005][DOC] Documentation
[TEP005][QOL] Add MontecarloRunner.spectrum_integrated
@wkerzendorf wkerzendorf merged commit b6fa6ea into master Jun 23, 2017
@wkerzendorf wkerzendorf deleted the formal_integral branch June 23, 2017 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants