-
-
Notifications
You must be signed in to change notification settings - Fork 409
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
Convergence plot correction: Use step plots #2528
Convergence plot correction: Use step plots #2528
Conversation
*beep* *bop* Hi, human. The Click here to see your results. |
@jamesgillanders @MarkMageeAstro Can you please review this fix when you have time? Thanks in advance! |
hi, can you please put up a screenshot showing the changes you made in the pr description? |
@atharva-2001 Done. Also, can you please put the |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2528 +/- ##
==========================================
- Coverage 68.18% 67.51% -0.67%
==========================================
Files 168 170 +2
Lines 14219 14229 +10
==========================================
- Hits 9695 9607 -88
- Misses 4524 4622 +98 ☔ View full report in Codecov by Sentry. |
Maybe someone else knows, but is 'hv' or 'vh' correct? Each shell is defined by an inner and outer velocity, so does the temperature, etc. correspond to the inner or outer boundary? I guess that'll determine which one to use or maybe I'm misunderstanding something |
This is actually a rather interesting question about how TARDIS works. Temperature and density are actually defined at the centre of the cell. |
Temperature etc. are constant throughout each shell. The point to consider and to address is how that looks on a step plot that is generated by using e.g., v_inner values. In that case the step profile should not be "mid" |
@jamesgillanders @andrewfullard @MarkMageeAstro I believe "hv" is correct given that we're considering inner velocities. (Reference for different modes here. "hv" changes value at the current x-coordinate (inner_boundary_i) and stays put until the next x-value (inner_boundary_{i+1} = outer_boundary_i) If I chose outer velocities, then "vh" would have been correct. "hvh" would be correct if I chose mid velocities for the shells. (Though this case might be problematic if the shells have varying widths) |
Maybe I'm over thinking it or confusing myself (both are very real possibilities). The code has changed quite a bit since I last looked at it, I think. It looked to me like we're not actually using the inner velocities, I thought it was the outer velocities. Based on what Andrew said about the temperature being defined in the middle, if you print out the velocities and temperatures you might get something like: Velocity Temperature I would assume that means that for velocities 19000 < v <= 20000, the temperature should be 9000. That's not what's shown here though because there is a step down at the last cell. Again, I could be misunderstanding something though |
The plot itself steps down at the correct locations, as seen in the attached image: The last step down is at the inner boundary of the last shell. However, it isn't extended in a horizontal line because the plot doesn't know where to "end" the line segment i.e. outer boundary of last shell). Let me know your thoughts here. |
@MarkMageeAstro I have updated my branch with the changes. Now the plot looks like this: |
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Can you also please rerun the checks, since the PR was behaving weirdly in between |
e186e3b
to
bf695a5
Compare
Looks great -- this is exactly what was needed! Happy to merge! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved!
Thanks James! @MarkMageeAstro This required another approval before merge. Please let me know if this is good to go. |
It looks like the convergence plot tests are failing, and |
…t step correctly - Rebase master - Run black formatter on convergence_plot.py
bf695a5
to
cfca84c
Compare
@andrewfullard I've fixed the convergence plot tests and ran Black formatter on the file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good with me!
@MarkMageeAstro Can you please review this? @jamesgillanders has already approved and it needs two approvals to merge |
* Change convergence plots to step plots * - Add dummy x-point while plotting convergence plots, to draw the last step correctly - Rebase master - Run black formatter on convergence_plot.py * Fix convergence plot tests * Run black formatter
📝 Description
Type: 🪲
bugfix
In the convergence plot widget, both T and W are plotted against shell velocity. These plots should present their data as a step function, instead of a scatter line, since the T and W values are constant throughout each individual shell.
closes Issue#2519
@jamesgillanders @MarkMageeAstro Please review. Also can you please apply the
build_docs
label since the plots in the docs will change?📌 Resources
🚦 Testing
How did you test these changes?
☑️ Checklist
build_docs
label