The MicroSWIFT Dashboard is a Python-based tool designed to work with historical and real-time data from the microSWIFT wave buoy, developed by the University of Washington Applied Physics Laboratory (UW-APL).
MicroSWIFT Dashboard
Note: Currently, it will take 10-30 seconds to load
This repository contains all the necessary files for running the application both locally and on Render for deployment. To ensure smooth deployment, avoid altering the file structure.
- app.py - The main application file containing all callback functions and layouts. Note: Keep callbacks within this file to avoid issues.
- content_layout.py - Contains the layout templates for displaying data from a single buoy or multiple buoys.
- graphs.py - Manages to create graph objects for visualization.
- Data_retrieval.py - Handles data retrieval from the microSWIFT API, including filtering functions.
- mission_ids.csv - A list of past and current deployments.
microSWIFT-Dashboard
| app.py
| card_elements.py
| content_layout.py
| data_cleaning.py
| data_retrieval.py
| graphs.py
| LICENSE
| mission_ids.csv
| mission_utils.py
| README.md
| requirements.txt
| spectrogram_plot.py
|
+---assets
| SWIFTlogo.png
| SWIFTlogo_r.png
To run the application locally:
- Clone the repository:
git clone <repo_url>
- Install the required dependencies:
pip install -r requirements.txt
- Run the application:
python app.py
The application should be accessible through your hostlocal port.
To run the application in a container install a Docker compatible container system (ie: Docker or Podman). Then within this directory run
docker-compose up
podman compose up
To run a pre-built container in Docker:
docker pull ghcr.io/apl-uw-software/microswift-dashboard:latest
docker run -p 8080:8080 ghcr.io/apl-uw-software/microswift-dashboard:latest
To run a pre-build container in Podman:
podman pull ghcr.io/apl-uw-software/microswift-dashboard:latest
podman run -p 8080:8080 ghcr.io/apl-uw-software/microswift-dashboard:latest
While Dash recommends using Heroku for deployment, we suggest using Render for its simplicity. For deployment on Render, follow their deployment guide. Note: You will need to create a Render account.
If deploying on a private server, we recommend using Gunicorn for serving the application. Learn more about Gunicorn here.
Alternatively, this app can deployed using the provided container image.
To add a new mission:
- Update the mission_ids.csv file with the following details:
- Mission name
- List of buoy IDs (separated by spaces)
- Start time in UTC format
- End time in UTC format or None (to retrieve the latest data)
Examples:
Mission,Buoy_ids,Starttime,Endtime
Bering Sea June 2024, 040 041 065 077 080 082, 2024-06-01T00:00:00, None
Hurricane Idalia, 029 030 037 046 048, 2023-08-28T00:00:00, 2023-09-15T00:00:00
To add a new visualization:
- Determine the Type: Decide whether it's for a single buoy or multiple buoys.
- Modify graphs.py: Add the graph object within the appropriate function:
new_graph = px.<GraphType>(data_frame, x='label', y='label')
Refer to the Plotly documentation for details on graph types. - Update content_layout.py: Add an
html.Card
element to allocate space for the new visual. Use a descriptive ID for the card. - Modify app.py: Add the new output in the relevant callback:
Output('id_label', 'children')
This project is licensed under the MIT License.