-
Notifications
You must be signed in to change notification settings - Fork 4
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
More plot options, runtime plots, unnormalized pdf plots #78
Merged
Conversation
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
Can be useful to monitor an ongoing simulation. This cannot be done by reading the output file, because opening the NetCDF file from two programs at once may corrupt it and crash either/both programs. Instead, if `runtime_plots = true` is passed in the input, a .png file with a bunch of plots of moments and distribution functions is produced at each output step. The plots are created in serial, and may take some time (~10s?) for high-resolution simulations.
These can be useful for post-processing.
Also requires updated version of Plots.jl (to be added later if/when JuliaPlots/Plots.jl#4298 is merged).
`export analyze_and_plot` -> `export analyze_and_plot_data`
Making animations directly with PyPlot.jl and matplotlib is not as neat, and the output is not consistent with Plots.jl, but it works without needing the update to Plots.jl in JuliaPlots/Plots.jl#4298
Needed when using PyCall to import matplotlib.
Using the system Python is the default on Linux, but not macOS (or Windows). This commit explicitly sets the ENV["PYTHON"] variable so that all platforms use the system Python. This was needed to get PyCall to work correctly on macOS - previously Julia's internal Conda-installed Python had linking errors when using matplotlib.
When creating figures for multiple runs, we need to set the figure size explicitly for 2d plots (it should get wider when there are more runs to avoid squashing the figures). This commit changes the settings so that the size of the plot for each run matches the Plots.jl default size for a single plot.
After switching between PyPlot interface and Plots interface, the Figure apparently does not get cleaned up without an explicit call to Plots.closeall().
Includes some refactoring of functions used to get/plot unnormalized f so that they can be reused in more ways.
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.
runtime_plots = true
is passed in the input, output some summary plots intolatest_plots.png
at each output step - useful for monitoring long-running simulationsanimate_f_unnormalized = true
inpost_processing_input.jl
analyze_and_plot_data()
to accept multiple directories/output files. If multiple simulations are passed, they are overlaid on line plots, and put side-by-side in 2d plots. Animations are truncated to the length of the shortest of the inputs.post_processing.jl
as just about every variable is now a Tuple with one entry for each simulation, but I think worth it for comparing different runs.Note: when I added
PyCall
andPyPlot
to the dependencies, the Manifest was re-generated with Julia-1.7.2. I don't expect that to cause a problem but if you're using an earlier version of Julia and get weird errors, it might be worth updating.