usgs / groundmotion-processing

Parsing and processing ground motion data
Other
54 stars 42 forks source link

Review tool for large "projects" #1019

Open baagaard-usgs opened 2 years ago

baagaard-usgs commented 2 years ago

Difficulty of per-earthquake reports for large "projects"

For gmprocess "projects" with hundreds of earthquakes, it is difficult to quickly review the data using the report and station maps that are one file per earthquake. For example, viewing all of the waveforms results in opening hundreds of PDF files. Likewise, viewing all of the station maps results in opening hundreds of HTML files. Additionally, we often want to view only a subset of the information.

Desired Solution

Use cases

Earthquake-centric view

Station-centric view

Waveform panel

Map panel

Implementation Ideas

baagaard-usgs commented 1 year ago

@emthompson-usgs @gferragu Having just spent a couple days manually reviewing 8000+ records for Turkey, I would like to push up the priority for a GUI review tool. I think we should break the development into stages to speed up initial delivery.

Stages

  1. Simple review GUI tool that collects data from the HDF5 workspace files. Display images of waveforms rather than interactive plotting. Allow display of only "passed" stations.
  2. Add more functionality in terms of viewing record information (view/hide provenance and processing information), show station(s) on a map, and being able to manually mark "passed" records as "failed" and save list of manually marked stations to a file.
  3. Ability to generate interactive plot (static image would be default for faster loading) of station waveforms.
  4. Replace HDF5 backend with a database.

GUI framework

I came across pynecone as a Python framework for generating web applications. It is built upon the ReactJS framework. This might be more sustainable than a JavaScript application, because more of us know Python.

emthompson-usgs commented 1 year ago

@baagaard-usgs I fully support this idea. To try to get this done as efficiently as possible, I think we need to try to develop a plan to divvy up tasks.

gferragu commented 1 year ago

@baagaard-usgs @emthompson-usgs I've been looking through Pynecone for a bit and it sounds awesome. If it facilitated more involvement in development it could be very useful. There is a good bit of Python dev needed already in the current gm-app though, for what it's worth. If there's a desire I can articulate that via Gitlab more. I'm a little concerned about how new it is though (alpha in Dec 2022) and how we distribute/host it. I don't know enough about how the Pynecone distribution works (their servers? USGS servers?), but having a tried and tested framework that can be packaged as a cross-platform app without hosting is a point for Electron, in my opinion. Not muddling through JS as much is a big point for Pynecone though, as I am not a JS expert. I have some notes I'll post in Teams, along with a link to the current (albeit fledgling) status of the Electron app code

baagaard-usgs commented 1 year ago

@gferragu Notes on the current status and Electron would be very helpful. I, too, am concerned about the lifespan onfpynecone. Additionally, the examples all look really simple and doing what we want may require something more sophisticated.

gferragu commented 1 year ago

@baagaard-usgs yep definitely no-frills, but sussing out a baseline for interaction with gmprocess via your scripting updates, I/O for HDF5 workspace files, simple SQLite database interaction, Flask-Electron communication, rendering processes, etc.

The goal, I think, was to eventually incorporate (1) a fleshed out gm-db database schema based on Mike's motionfetcher repo that we could really lean into rather than hdf5 workspaces and (2) Embed the more advanced and Python-based plotting of Hadi's Dash/Plotly code to make a more cohesive review tool