Allow plot-ts to plot SRFs as animations#103
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR extends plot-ts to support rendering SRF animations alongside the existing xyts visualisations. Key changes include:
- Introducing a new command for SRF animations (animate_srf_slip_times) along with supporting helper functions.
- Modifying the waveform coordinate computation and reorganising imports for clarity.
- Adjusting the frame rendering logic in both xyts and SRF animation pathways.
Comments suppressed due to low confidence (2)
visualisation/plot_ts.py:293
- The parameter 'ny' is described as 'the number of x-points'; it should likely be corrected to 'the number of y-points' for clarity.
ny : int
visualisation/plot_ts.py:822
- [nitpick] The magic number '20' used for calculating slip_index is hardcoded. Consider defining it as a named constant to explain its significance and facilitate future adjustments.
slip_index = frame_index * 20
There was a problem hiding this comment.
Pull Request Overview
This PR extends the plot-ts utility to support SRF animation rendering alongside the existing XYTS plotting, and refactors waveform coordinate computation. Key changes include:
- Refactoring of xyts_waveform_coordinates to waveform_coordinates with explicit grid parameters.
- Addition of a new Typer CLI command "srf" to animate SRF slip times.
- Rearrangement of certain imports and modification of the frame rendering process in the low frequency animation function.
Comments suppressed due to low confidence (1)
visualisation/plot_ts.py:459
- The render_single_frame function in the low frequency animation now returns a list containing the Axes object instead of saving the generated frame to a file, which may break the subsequent ffmpeg processing expecting image file paths. Consider restoring the functionality to save the frame as an image and returning the corresponding filename.
return [ax]
|
Needed to bump scipy's version to at least 1.15.0 because it needs the sparse indexing operations only supported in the newest stable version. |
There was a problem hiding this comment.
Pull Request Overview
This PR extends plot-ts with the ability to animate SRFs while preserving the original xyts plotting functionality. Key changes include refactoring the waveform coordinate computation function, introducing a new CLI command "srf" with its own animation routine, and adding helper functions for processing non-zero data points.
There was a problem hiding this comment.
Pull Request Overview
This PR extends plot-ts to support visualizing SRF files as animations alongside the existing xyts file plotting functionality. Key changes include:
- Addition of a new command (animate_srf_slip_times) for rendering SRF animations.
- Refactoring of waveform coordinate computation to decouple from XYTS-specific logic.
- Adjusted import order and consolidation of redundant import statements.
Comments suppressed due to low confidence (1)
visualisation/plot_ts.py:731
- [nitpick] The attribute name 'slipt1_array' is ambiguous and may be a typo; please verify its intended naming for clarity.
slip = srf_file.slipt1_array.tocsc()
There was a problem hiding this comment.
Pull Request Overview
This PR extends the functionality of plot‑ts by adding support for animating SRF slip times, while still retaining the existing XYTS animation capability.
- Renames and refactors coordinate computation for waveform plotting.
- Introduces a new subcommand for SRF animations with dedicated rendering logic.
- Updates and reorders several imports and adjusts parameter types (dpi, fps) for consistency.
|
The tests are failing due to a bug in openquake. It currently has a dependency requirement of |
Co-authored-by: AndrewRidden-Harper <52001209+AndrewRidden-Harper@users.noreply.github.com>
joelridden
left a comment
There was a problem hiding this comment.
Looks good, a rerun of the Jenkins test should work now that Empirical engine has updated and as long as that's passes I'm happy.
This PR extends
plot-tsto allow it to visualise an SRF as an animation (in addition to it's ability to plot xyts files). For example,The old behaviour is obtained with the
xytssubcommandIn accordance with the last PR, this SRF plot-ts is not explicitly tested (because I can't think of a good way to do this).