Repository navigation
Predict XRT with utu.dem.emission_measure in the DEM tutorial, and integrate its ranges exactly - #7
Merged
Merged
Conversation
…tegrate its ranges exactly The XRT intensity a DEM predicted was the DEM times the response times the 0.05-dex step, which weights each temperature by the sum of its row of the mass matrix utu.dem.plowman fits with. It is now utu.dem.emission_measure (utu 0.5.0) times the response, which is the intensity the inversion fit. Per pixel, the ratio of the predicted to the observed XRT changes by a median of +0.6% for the DEM from AIA and XRT and -0.5% for the DEM from AIA alone, so the numbers in the text stand. The four maps of emission measure were left Riemann sums over [lower, upper), as in the DEM tutorial of sdo before sun-data/solar-dynamics-observatory#30. They now integrate the DEM over log T with FunctionArray.integrate, whose trapezoid rule is exact for the piecewise-linear DEM of plowman. In the median pixel, the old maps were 0.88 to 1.15 times the exact integral, depending on the range. The doc extras require utu>=0.5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xqpht97bF4FWsACAA4wQa
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7 +/- ##
=======================================
Coverage 99.86% 99.86%
=======================================
Files 18 18
Lines 2160 2160
=======================================
Hits 2157 2157
Misses 3 3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
This fixes two integrals of the DEM in the DEM tutorial. Neither one was the integral that
utu.dem.plowmanassumes.The XRT intensity a DEM predicts
The tutorial predicted the XRT intensity of each DEM as the DEM times the response times the 0.05-dex step.
plowmantakes the DEM and each response to be linear in log T between the temperatures, and fits each intensity with the integral of their product, Rᵀ M D, where M is the mass matrix of those triangle functions. The rectangle sum weights each temperature by the sum of its row of M instead.The tutorial now uses
utu.dem.emission_measure(sun-data/utu#15, new in utu 0.5.0), which returns M D, so the predicted intensity is the one the inversion fit:The change is small, and every number in the text still holds:
Per pixel, the ratio changes by a median of +0.6% for the DEM from AIA and XRT (at most +2.4%), and by −0.5% for the DEM from AIA alone (at most −8.7%). The χ² maps are unchanged.
The maps of emission measure
The four maps were left Riemann sums over [lower, upper), the nodes times the step, as in the DEM tutorial of sdo before sun-data/solar-dynamics-observatory#30. For a DEM linear between its nodes, the exact integral over a range is the trapezoid rule, which counts the two end nodes by half and includes the node at
upper.As in sdo, the tutorial now gives the DEM log₁₀ T as its inputs and integrates it with
FunctionArray.integrate, from the node atlowerto the node atupper. The text says why the trapezoid rule is exact here. The old maps, against the exact integral:Other changes
utu.dem.emission_measureis not used for the maps. Its sum over a range is not the integral of the DEM over that range, since each temperature stands for plasma up to a step either side of it.logtof the response section, used only by the old maps, is now defined where the maps are made, from the DEM.utu>=0.5.Checks
I ran every
jupyter-executecell of the edited tutorial in order, against utu 0.5.0, and the same cells ofmainfor the "Before" numbers. All the cells ran. Each of the four maps equalsnp.trapezoidof the DEM over log T exactly, and the median reduced χ² is still 0.968, with one pixel above 3.🤖 Generated with Claude Code
https://claude.ai/code/session_017xqpht97bF4FWsACAA4wQa