Skip to content

Commit 81b9d5a

Browse files
author
Ananyo Bhattacharya
committed
Added new files and workflows
1 parent c2d3661 commit 81b9d5a

3 files changed

Lines changed: 87 additions & 3 deletions

File tree

.github/workflows/dashboard.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Update GNSS-RO Dashboard
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'tools/**'
9+
- 'docs/**'
10+
- '.github/workflows/dashboard.yml'
11+
12+
schedule:
13+
# 06:30 UTC daily — CDAAC typically has yesterday's data by ~05:00 UTC
14+
- cron: '30 6 * * *'
15+
16+
workflow_dispatch:
17+
inputs:
18+
date:
19+
description: 'Date to fetch (YYYY-MM-DD). Defaults to yesterday.'
20+
required: false
21+
default: ''
22+
23+
jobs:
24+
update-dashboard:
25+
name: Fetch RO data and rebuild dashboard
26+
runs-on: ubuntu-latest
27+
permissions:
28+
contents: write # needed to push docs/ back to the repo
29+
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0
35+
36+
- name: Set up Python
37+
uses: actions/setup-python@v5
38+
with:
39+
python-version: '3.11'
40+
cache: 'pip'
41+
42+
- name: Install dependencies
43+
run: pip install -r requirements.txt
44+
45+
- name: Create required directories
46+
run: mkdir -p tools/data/nc_cache docs
47+
48+
- name: Determine fetch date
49+
id: date
50+
run: |
51+
if [ -n "${{ github.event.inputs.date }}" ]; then
52+
echo "target=${{ github.event.inputs.date }}" >> $GITHUB_OUTPUT
53+
else
54+
echo "target=$(date -u -d 'yesterday' '+%Y-%m-%d')" >> $GITHUB_OUTPUT
55+
fi
56+
57+
- name: Fetch daily RO profiles
58+
working-directory: tools
59+
run: python3 fetch_daily.py ${{ steps.date.outputs.target }}
60+
env:
61+
PYTHONUNBUFFERED: "1"
62+
63+
- name: Clean NetCDF cache
64+
run: rm -rf tools/data/nc_cache
65+
66+
- name: Rebuild dashboard HTML
67+
working-directory: tools
68+
run: python3 make_dashboard_next.py
69+
70+
- name: Check for changes
71+
id: changes
72+
run: |
73+
git diff --quiet docs/ tools/data/ \
74+
&& echo "changed=false" >> $GITHUB_OUTPUT \
75+
|| echo "changed=true" >> $GITHUB_OUTPUT
76+
77+
- name: Commit and push
78+
if: steps.changes.outputs.changed == 'true'
79+
run: |
80+
git config user.name "github-actions[bot]"
81+
git config user.email "github-actions[bot]@users.noreply.github.com"
82+
git add docs/ tools/data/
83+
git commit -m "dashboard: auto-update for ${{ steps.date.outputs.target }} [skip ci]"
84+
git push

src/gnss_cyclone_colocation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
STORM_NAMES = [] # []=all | ["IDA","GRACE","SAM"] = specific storms only
3838
MIN_WIND_KT = 34 # Saffir-Simpson threshold — see table above
3939
RADIUS_KM = 500
40-
TIME_WINDOW_H = 3
40+
TIME_WINDOW_H = 100
4141
WORKDIR = "ro_data"
4242
IBTRACS_FILE = "since1980" # since1980 | last3years | ALL
4343

src/gnss_cyclone_colocationv2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
OUT_DIR = "ro_data/colocation"
3232

3333
# Default co-location thresholds
34-
DEFAULT_RADIUS_KM = 500
35-
DEFAULT_HOURS = 6 # ± hours around storm fix time
34+
DEFAULT_RADIUS_KM = 5000
35+
DEFAULT_HOURS = 10 # ± hours around storm fix time
3636

3737
MISSIONS = {
3838
"cosmic2": [("nrt", "wetPf2"), ("postProc", "wetPf2")],

0 commit comments

Comments
 (0)