-
Notifications
You must be signed in to change notification settings - Fork 8
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
Improve Inspector Report Functionality #44
Merged
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
…le, also annotate 1std
…ikely this is too rigid and will need to be changed
…o call without naming arguments
…t summary of the inversion at the current evaluation and some information on misfit and windows
…r the course of an inversion to see if one event is going haywire. works technically but needs some work to be useful
…insp.compare_misfits() created to check each source receiver pair and not just events
… not being trimmed when they should have been
Merged
bch0w
added a commit
that referenced
this pull request
May 16, 2024
* improved function 'format_event_name' with better docstring and the ability to handle source files read in by PySEP's read_events_plus * Remove abstraction from windowing procedure (#41) * removing window abstraction by removing logic for determining fixed windows. instead User should now explicitely call window retrieval from dataset if they want, function name has changed to reflect * bugfix bad bool check * removed unncessary arguments from flow function * bugfix: preprocessing simple detrend was causing trend due to non-zero end point on synthetics * FEATURE: allow window loading to select by component, whereas previously all windows for a given station were returned * propagate component argument from Manager retrieve windows from dataset to only get windows that match the component list * fixed up 'fix_windows' option for the manager flow commands based on new method of fixing windows * added new test covering providing windows directly to the Manager window function * fixing failing ASDF tests * Improve Inspector and Manager class (#42) * started a 'report' function to make all required figures window plot removed background lines as too many lines made the entire figure too dark bugfix cant plot raypaths with duplicated station names * adding colored lines to misfit maps whereas before they were just scatterplots * improved the '_parse_nonetype_eval' inspector function which santizes inputs for iteration and step count, changed name to 'validate_evaluation', placed at the top of all plotting functions and changed default behavior to return final model if no values are given for i or s * new plot function 'event_comparison' plots a scatterplot of all events and their respective misfit and windows * BUGFIX: misfit function was dropping 'network' identifier which caused TA and AK stations that had the same station code to get combined leading to weird statistics * finished 2d data histogram plot * API CHANGE: insp.plot_windows -> insp.window_stack * added summary histogram plot feature added generate report to make a few summary figures * working on report, improved docstring for default axes in inspector plotter * small updates to report generation * BUGFIX Inspector was not properly able to read multi-evaluation datasets due to some indexing issues. not sure when that snuck in there? * inspector can now plot number of windows per event or station as a histogram * added nwin and nwin_sta to the summary histogram * manager can now re-evaluate windows and reject based on data criteria * small updates inspector * updating comp_wave to remove some NZ specific and code that has broken due to previous updates * FEATURE: removed comp_wave and improve_wave visual classes which were used for plotting waveform improvements but had a lot of NZ-specific hard coding and were not working with the current implementation of Pyatoa and replaced them with wave_train, which is more general and draws from both previous scripts * final touches on wave train including more aestheticly pleasing windows and ability to choose which models to look at * changed window parameter 'reject_on_data_fit' to 'revalidate' to be slightly more unique/to fit in better with SeisFlows * AESTHETIC FIX: annotation of window information from wave maker made negative time shifts difficult to read. modification to add a 'sign' of + or - in order to make distinguishing positive or negative time shifts easier * cleaning up wave train * BUGFIX: Manager.measure when used in a pyaflowa inversion was failing because it was trying to iteration through windows/components that were not there. this was mixed into the 'retrieve_windows_from_dataset' function which was NOT selecting by component, so providing too many windows tried to make the measure function more explicit in checking for matching components, and tried to make the retrieve function more explciit but allowing User to pass 'components' to select components. This will be reflected by a pyaflowa change * updating some preprocessing log messages tfor clarity * fixing log message for window stats, changing tshift units from samples to time. adding log message to initial windowing as well * BUGFIX: ASDFDataSet utils adding misfit windows was NOT able to overwrite existing windows, leading to misfit windows being saved incorrectly, and hidden by a warning ignore which caused things to fail silently fixed 'add_misfit_windows' function which now has an 'overwrite' function that allows delete existing windows prior to adding windows new ASDF function to clean specific data paths to assist with this still need to do adjoint source * see last commit message, updated adjoint source adding * bugfix missing parentheses * fixing up some other ASDF manipulation functions ions in order to fix the asdfdatset overwrite issue for ALL data adding, not just windows and adjsrcs * api change asdf.del_synthetic_waveforms -> asdf.del_waveforms and made del_waveforms function more general and allow it to delete observed waveforms and not just synthetics * finished up restructuring write_to_dataset function for manager to allow for overwriting existing data which should get past the previous issues of misfit windows not overwriting * cleaning up some log messages throughout Manager * bugfix continue was passing over critical function call, changed to pass * bugfix missing try-except on overwriting config objects * small update to log messages, new dataset saving functionality tested with Seisflows * BUGFIX: 'add_waveforms' and underlying 'del_waveforms' functions were accidentally deleting all synthetic data inside the datatset. added new 'channel' variable to allow only deleting relevant data * bugfix syntax errors on log messages causing some typerrors * wavetrain now requires manual input of models because it is too difficult to guess which line search models are the correct models * too many quotation marks * Bugfix Trim streams failing silently (#43) * added assertion checks on trim streams and created separate trim_streams test to catch this * fixed up match_npts function to deal with streams that have either less or more points, fixed test to cover this function * Improve Inspector Report Functionality (#44) * updated 'event_comparison' figure to have better aspect ratio and title, also annotate 1std * event_station_hist2d changed colormap and default colorbar scaling, likely this is too rigid and will need to be changed * hist function moved 'compare' to a later argument to make it easier to call without naming arguments * fleshed out 'generate_report_text' function which provides a nice text summary of the inversion at the current evaluation and some information on misfit and windows * fixing up report, now runs through for akatom test case * added new figure 'events_over_inversion' which plots event misfit over the course of an inversion to see if one event is going haywire. works technically but needs some work to be useful * api change: insp.compare() -> insp.compare_events() and new function insp.compare_misfits() created to check each source receiver pair and not just events * improve call structure for inspector.compare_windows * updating copyright year * BUGFIX: trim streams not evaluating check properly leading to streams not being trimmed when they should have been * always forgetting to save the merge conflicts * Fixing tests * removing unused github workflow files
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.
What does this PR do?
Improves the
Inspector.generate_report()
function which automatically generates figures that might be useful for understanding/assessing a SeisFlows inversion.Changelog
generate_report_text
function which provides a text report on windows, misfit, and per-event/per-station statsInspector.compare
now namedInspector.compare_events
to be more descriptivecompare_misfits
to compare misfit values for two models for each source-receiver pairevents_over_inversion
to look at the misfit of each event over the course of an inversionInspector.hist
andInspector_histogram_summary
so that the new call structure is more intuitiveWhy was it initiated? Any relevant Issues?
Inspector report was underdeveloped and not super useful in previous versions, this makes some changes so that User can just call
Inspector.generate_report()
and not have to sift through all the individual functions/plotting routines to figure out what they might need.PR Checklist
develop
base branch selected?CHANGELOG.md
.