main ion density calculation using a combination of VB and CER diagnostics in IDA-lite - #52
Open
StuartBenjamin wants to merge 2 commits into
Open
main ion density calculation using a combination of VB and CER diagnostics in IDA-lite#52StuartBenjamin wants to merge 2 commits into
StuartBenjamin wants to merge 2 commits into
Conversation
i. "ni_source" choosing whether to use CER, VB (zeff) or both when calculating ni and its error ii. ni_sigma overrides the zeff_active method in perturb_equilibrium when it is set by the ni_source workflow - Controlled by ni_from_zeff, is automatically set False when sigma_ni is not the flat ni_scalar_sigma - Zeff is still drawn as an aux channel and still drives the bootstrap either Minor changes: a. zeff comes from ida-lite unless zeff_from_fuse=True. Error envelope comes from ida-lite either way b. re-adding the option to use median instead of mean for ida-lite sample centers (default is false) c. Tests updated to include Zeff_err / n_12C6 / n_12C6_err channels
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Major changes:
i. "ni_source" allows user to choose whether to use CER, VB (Zeff) or both when calculating ni and its error from ida-lite files
- see bottom text for the mathematical error formulation
ii. ni_sigma overrides the zeff_active method in perturb_equilibrium when it has a real value from ida-lite
- controlled by ni_from_zeff, which is automatically set False when sigma_ni is not a flat ni_scalar_sigma
- Zeff is still drawn as an aux channel, and used in the bootstrap either
Minor changes:
a. zeff comes from ida-lite unless zeff_from_fuse=True. Error envelope comes from ida-lite either way
b. re-adding the option to use median instead of mean for ida-lite sample centers (default is false, no change to normal running)
c. Minor test updates to include Zeff_err / n_12C6 / n_12C6_err channels
Mathematics behind error propagation:
Symbols
impurity_Zne,sigma_neZeff,sigma_Zeffn_carbon,sigma_n_carbonwClipping
guarantees$0 \le n_{i,Z_\mathrm{eff}} \le n_e$ .
Route 1 - ion density from Zeff assuming single impurity species, visible Bremsstrahlung diagnostic
Route 2 - ion density calculated via dilution due to carbon, CER diagnostic
Combined estimate
with equal weights$w = 1/2$ when both routes are active.
Propagated variance
where
with the assumption$\mathrm{cov}(Z_\mathrm{eff}, n_C) = 0$ (separate diagnostics).
Note:$\sigma_\Delta^2 \ne \sigma_1^2 + \sigma_2^2$ $.
The ion density expression comes from the DerSimonian-Laird
method-of-moments with k=2 and us prescribing a weight factor w = 1/2:
It reduces to the propagated variance when the two ion
density calculations agree routes agree, and to (Delta/2)^2 when a
discrepancy dominates.
Reported tension
Returned as
ni_route_chi, defined asIt is
NaNwhere the variance of Delta is zero, andNonewhen only one routeis active.