-
-
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
V inner formal integral #2800
Open
Rodot-
wants to merge
66
commits into
tardis-sn:master
Choose a base branch
from
Rodot-:v_inner_formal_integral
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
V inner formal integral #2800
Changes from all commits
Commits
Show all changes
66 commits
Select commit
Hold shift + click to select a range
a7175bf
Basic skeleton
andrewfullard 032f34b
Lots of progress
andrewfullard b6628fc
Adds setup method, refactors some functions, removes unused items
andrewfullard 1a67aba
Move convergence setup to setup method
andrewfullard 5008b80
Add docs notebook, fix a couple of errors
andrewfullard a95d547
Move setup to init
andrewfullard d5f65cb
Fix iteration and convergence
andrewfullard 5a3c94e
Simplify spectrumsolver init
andrewfullard 4df9c41
Separate plasma "solver" and simulation state updates
andrewfullard 2d253c7
Simplify convergence solver setup with a dict.
andrewfullard 372b44b
Minor formatting change
andrewfullard 24943f4
Minor refactoring
andrewfullard 6372d5b
Merge branch 'master' into simulation-solver-workflow
andrewfullard 5a1e45f
Fixes plasma update step
andrewfullard 2dbeb69
Merge branch 'master' into simulation-solver-workflow
andrewfullard 6a457f4
Fixes loggers and progress bars
andrewfullard cf49518
Fixes convergence plot rendering
andrewfullard 85403c5
Fixes convergence plots in the final iteration
andrewfullard 858ab1d
black
andrewfullard 9b10be6
Simplify convergence plot updating
andrewfullard a521c10
Move logging handling to a separate class
andrewfullard 8f4955e
Add HDF output capability to solver
andrewfullard b02390d
Move more basic logging back into workflow
andrewfullard 426459a
Add not-converged error message
andrewfullard 8d45b7d
Update notebook with export option
andrewfullard 0353589
Added simple base workflow and changed some verbiage
andrewfullard 3a24f98
Fix typo
andrewfullard cd9cd64
Merge branch 'simulation-solver-workflow' of https://github.com/andre…
Rodot- 8caaf6e
Moved solver workflow over to updated branch
Rodot- 82ffb83
Added reprojection method for comparing arrays between iterations
Rodot- 4d3c747
Updated schema and parser to add v_inner_boundary, added property to …
Rodot- 16042ce
Added ntoebook for the IBVS workflow
Rodot- 545f751
Updated workflow notebook to have correct convergence information, up…
Rodot- 54a5d83
Reduced size of overloaded functions to make them more in-line with t…
Rodot- 3d022a2
cleared notebook outputs
Rodot- af0430a
Updated notebook to use correctmethod
Rodot- fb9a49b
Updated the docstrings
Rodot- 5aded66
removed unused imports
Rodot- 4ce4ab9
Updated notebook to stop if converged
Rodot- 8ae6158
Updated v_inner_solver to deal with detailed radiative rates types
Rodot- ba5696c
removed old comment
Rodot- b1570db
Added docstrings, removed old comments
Rodot- 398f39f
Fixed typo
Rodot- 75c9e9b
Updated notebook to be more explicit
Rodot- 5cf5b45
removed old comment
Rodot- 004d32d
removed unused variable
Rodot- 31a96d5
Changed the radiation_field to use the radiation field state properti…
Rodot- ca34743
Added back radaition field to plasma solver in v_inner solver
Rodot- d336379
Added a solve opacity method
Rodot- a73eee6
Added docstring to solve_opacity method
Rodot- 783ecae
Fixed initializing opacity at the last iteration
Rodot- 9ebb6f2
Added initial v_inner estimate in the __init__
Rodot- f7e9748
massively simplified the reproject method by just doing basic math
Rodot- e79c821
added docstring describing the simplified reproject method so I don't…
Rodot- 5627d73
Formatting error in doscstring
Rodot- a3178ad
Added nice logger output showing changes in geometry state
Rodot- bc17364
Cleaned up the notebook a bit
Rodot- 2349245
Updated the formal integral to handle changes in geometry
Rodot- a7f778d
Fixed the standard simulation solver
Rodot- 5cb44b8
Merge branch 'v_inner_solver_restructure' of https://github.com/Rodot…
Rodot- e5d26d1
Merge branch 'master' into pr/Rodot-/2800-1
andrewfullard 8725216
Remove old files
andrewfullard f33d708
Fixes v_inner workflow
andrewfullard f163e7a
Minor formatting changes
andrewfullard f22ac60
Clean up confusing v_boundary_inner vs v_inner_boundary variable names
andrewfullard e6b2f23
Add integrated spectrum to workflow example
andrewfullard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from tardis.workflows.v_inner_solver import InnerVelocitySolverWorkflow\n", | ||
"from tardis.io.configuration.config_reader import Configuration" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"config = Configuration.from_yaml('../tardis_example.yml')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": { | ||
"scrolled": true | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"from astropy import units as u\n", | ||
"\n", | ||
"config.montecarlo.convergence_strategy['v_inner_boundary'] = {\n", | ||
" 'damping_constant' : 0.5,\n", | ||
" 'threshold' : 0.01,\n", | ||
" 'type' : 'damped'\n", | ||
" }\n", | ||
"\n", | ||
"config.montecarlo.convergence_strategy.stop_if_converged = True\n", | ||
"config.model.structure.velocity.start = 5000 * u.km/u.s # Larger window over which to search\n", | ||
"config.model.structure.velocity.num = 50 # Increase number of shells\n", | ||
"\n", | ||
"workflow = InnerVelocitySolverWorkflow(\n", | ||
" config, tau=2.0/3,\n", | ||
" mean_optical_depth=\"rosseland\"\n", | ||
")" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"workflow.run()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import matplotlib.pyplot as plt" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"spectrum = workflow.spectrum_solver.spectrum_real_packets\n", | ||
"spectrum_virtual = workflow.spectrum_solver.spectrum_virtual_packets\n", | ||
"spectrum_integrated = workflow.spectrum_solver.spectrum_integrated" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"%matplotlib inline\n", | ||
"plt.figure(figsize=(10, 6.5))\n", | ||
"\n", | ||
"spectrum.plot(label=\"Normal packets\")\n", | ||
"spectrum_virtual.plot(label=\"Virtual packets\")\n", | ||
"spectrum_integrated.plot(label='Formal integral')\n", | ||
"\n", | ||
"plt.xlim(500, 9000)\n", | ||
"plt.title(\"TARDIS example model spectrum\")\n", | ||
"plt.xlabel(r\"Wavelength [$\\AA$]\")\n", | ||
"plt.ylabel(r\"Luminosity density [erg/s/$\\AA$]\")\n", | ||
"plt.legend()\n", | ||
"plt.show()" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "tardis", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.12.4" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
This notebook is okay, but if it serves as the documentation for this workflow, it'd be nice to have a bit more explanation of what the workflow is, why you'd want to use it, and how you'd want to use it.