rsplot 0.2.7__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. {rsplot-0.2.7 → rsplot-0.3.0}/.gitignore +3 -0
  2. {rsplot-0.2.7 → rsplot-0.3.0}/PKG-INFO +54 -11
  3. {rsplot-0.2.7 → rsplot-0.3.0}/README.md +53 -10
  4. {rsplot-0.2.7 → rsplot-0.3.0}/pyproject.toml +7 -1
  5. rsplot-0.3.0/src/rsplot/__init__.py +10 -0
  6. rsplot-0.3.0/src/rsplot/cli.py +937 -0
  7. rsplot-0.3.0/src/rsplot/commands/__init__.py +1 -0
  8. rsplot-0.3.0/src/rsplot/commands/common.py +112 -0
  9. rsplot-0.3.0/src/rsplot/commands/fnr.py +262 -0
  10. rsplot-0.3.0/src/rsplot/commands/forecast.py +349 -0
  11. rsplot-0.3.0/src/rsplot/commands/meteo.py +381 -0
  12. rsplot-0.3.0/src/rsplot/commands/overlay.py +267 -0
  13. rsplot-0.3.0/src/rsplot/commands/raster.py +386 -0
  14. rsplot-0.3.0/src/rsplot/commands/recent.py +164 -0
  15. rsplot-0.3.0/src/rsplot/commands/reconstruct.py +220 -0
  16. rsplot-0.3.0/src/rsplot/commands/station.py +135 -0
  17. rsplot-0.3.0/src/rsplot/commands/station_trend.py +317 -0
  18. {rsplot-0.2.7 → rsplot-0.3.0}/src/rsplot/config.py +1 -0
  19. {rsplot-0.2.7 → rsplot-0.3.0}/src/rsplot/fnr.py +66 -159
  20. rsplot-0.3.0/src/rsplot/geo/boundaries.py +342 -0
  21. {rsplot-0.2.7 → rsplot-0.3.0}/src/rsplot/geo/gridding.py +12 -4
  22. rsplot-0.3.0/src/rsplot/geo/processing.py +120 -0
  23. {rsplot-0.2.7 → rsplot-0.3.0}/src/rsplot/plotting/fnr.py +18 -91
  24. rsplot-0.2.7/src/rsplot/plotting/raster.py → rsplot-0.3.0/src/rsplot/plotting/map_frame.py +116 -119
  25. rsplot-0.3.0/src/rsplot/plotting/meteo.py +158 -0
  26. {rsplot-0.2.7 → rsplot-0.3.0}/src/rsplot/plotting/overlay.py +30 -101
  27. rsplot-0.3.0/src/rsplot/plotting/raster.py +103 -0
  28. rsplot-0.3.0/src/rsplot/plotting/station.py +172 -0
  29. rsplot-0.3.0/src/rsplot/plotting/station_trend.py +320 -0
  30. {rsplot-0.2.7 → rsplot-0.3.0}/src/rsplot/plotting/styles.py +7 -6
  31. rsplot-0.3.0/src/rsplot/plotting/wind.py +80 -0
  32. {rsplot-0.2.7 → rsplot-0.3.0}/src/rsplot/readers/__init__.py +3 -1
  33. rsplot-0.3.0/src/rsplot/readers/_tropomi.py +130 -0
  34. {rsplot-0.2.7 → rsplot-0.3.0}/src/rsplot/readers/base.py +66 -0
  35. rsplot-0.3.0/src/rsplot/readers/era5.py +201 -0
  36. {rsplot-0.2.7 → rsplot-0.3.0}/src/rsplot/readers/era5_wind.py +21 -70
  37. {rsplot-0.2.7 → rsplot-0.3.0}/src/rsplot/readers/forecast.py +61 -27
  38. rsplot-0.3.0/src/rsplot/readers/guokong.py +451 -0
  39. rsplot-0.3.0/src/rsplot/readers/reconstruct.py +436 -0
  40. rsplot-0.3.0/src/rsplot/readers/tropomi_hcho.py +32 -0
  41. rsplot-0.3.0/src/rsplot/readers/tropomi_no2.py +33 -0
  42. rsplot-0.3.0/src/rsplot/readers/tropomi_o3.py +35 -0
  43. rsplot-0.3.0/src/rsplot/readers/tropomi_o3pr.py +33 -0
  44. {rsplot-0.2.7 → rsplot-0.3.0}/src/rsplot/recent.py +43 -61
  45. rsplot-0.3.0/src/rsplot/result_builders/__init__.py +25 -0
  46. rsplot-0.3.0/src/rsplot/result_builders/common.py +133 -0
  47. rsplot-0.3.0/src/rsplot/result_builders/fnr.py +189 -0
  48. rsplot-0.3.0/src/rsplot/result_builders/forecast.py +113 -0
  49. rsplot-0.3.0/src/rsplot/result_builders/meteo.py +171 -0
  50. rsplot-0.3.0/src/rsplot/result_builders/overlay.py +75 -0
  51. rsplot-0.3.0/src/rsplot/result_builders/raster.py +72 -0
  52. rsplot-0.3.0/src/rsplot/result_builders/reconstruct.py +85 -0
  53. rsplot-0.3.0/src/rsplot/result_builders/station.py +219 -0
  54. rsplot-0.3.0/src/rsplot/result_builders/station_trend.py +229 -0
  55. rsplot-0.3.0/src/rsplot/results.py +45 -0
  56. rsplot-0.3.0/src/rsplot/stats.py +36 -0
  57. rsplot-0.3.0/src/rsplot/temporal.py +224 -0
  58. rsplot-0.2.7/src/rsplot/__init__.py +0 -3
  59. rsplot-0.2.7/src/rsplot/cli.py +0 -1939
  60. rsplot-0.2.7/src/rsplot/geo/boundaries.py +0 -281
  61. rsplot-0.2.7/src/rsplot/plotting/station.py +0 -329
  62. rsplot-0.2.7/src/rsplot/readers/guokong.py +0 -143
  63. rsplot-0.2.7/src/rsplot/readers/tropomi_hcho.py +0 -126
  64. rsplot-0.2.7/src/rsplot/readers/tropomi_no2.py +0 -102
  65. rsplot-0.2.7/src/rsplot/readers/tropomi_o3.py +0 -104
  66. rsplot-0.2.7/src/rsplot/readers/tropomi_o3pr.py +0 -103
  67. rsplot-0.2.7/src/rsplot/results.py +0 -793
  68. {rsplot-0.2.7 → rsplot-0.3.0}/LICENSE +0 -0
  69. {rsplot-0.2.7 → rsplot-0.3.0}/src/rsplot/__main__.py +0 -0
  70. {rsplot-0.2.7 → rsplot-0.3.0}/src/rsplot/geo/__init__.py +0 -0
  71. {rsplot-0.2.7 → rsplot-0.3.0}/src/rsplot/plotting/__init__.py +0 -0
  72. {rsplot-0.2.7 → rsplot-0.3.0}/src/rsplot/plotting/colormaps.py +0 -0
  73. {rsplot-0.2.7 → rsplot-0.3.0}/src/rsplot/tiles/__init__.py +0 -0
  74. {rsplot-0.2.7 → rsplot-0.3.0}/src/rsplot/tiles/tianditu.py +0 -0
@@ -280,4 +280,7 @@ tags
280
280
  logs/
281
281
  .vscode/
282
282
  .claude
283
+ docs/
283
284
  tests/
285
+ skills/
286
+ tools/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rsplot
3
- Version: 0.2.7
3
+ Version: 0.3.0
4
4
  Summary: CLI tool for plotting Remote Sensing data, designed for Agent.
5
5
  Project-URL: Repository, https://git.lug.ustc.edu.cn/yaoyhu/rsplot
6
6
  Project-URL: GitHub, https://github.com/yaoyhu/rsplot
@@ -227,8 +227,8 @@ Description-Content-Type: text/markdown
227
227
 
228
228
  # rsplot
229
229
 
230
- `rsplot` is an Agent-oriented command-line tool for plotting remote-sensing and
231
- air-quality data. It is designed to provide a small, stable CLI surface for
230
+ `rsplot` is an Agent-oriented command-line tool for plotting remote-sensing,
231
+ reconstructed, and air-quality data. It provides a small, stable CLI surface for
232
232
  [tianpu-agent](https://git.lug.ustc.edu.cn/yaoyhu/tianpu-agent).
233
233
 
234
234
 
@@ -282,6 +282,7 @@ hcho = "/path/to/HCHO"
282
282
  guokong = "/path/to/guokong_combine"
283
283
  era5 = "/path/to/era5"
284
284
  forecast = "/path/to/forecast"
285
+ reconstruct = "/path/to/reconstruct"
285
286
 
286
287
  # Optional satellite basemap key. Leave commented unless you have a real key.
287
288
  # [tianditu]
@@ -307,6 +308,7 @@ export RSPLOT_DATA_DIR_HCHO="/path/to/HCHO"
307
308
  export RSPLOT_DATA_DIR_GUOKONG="/path/to/guokong_combine"
308
309
  export RSPLOT_DATA_DIR_ERA5="/path/to/era5"
309
310
  export RSPLOT_DATA_DIR_FORECAST="/path/to/forecast"
311
+ export RSPLOT_DATA_DIR_RECONSTRUCT="/path/to/reconstruct"
310
312
  export RSPLOT_HCHO_CMAP_FILE="/path/to/256x3_rgb_table.txt"
311
313
  ```
312
314
 
@@ -334,24 +336,63 @@ rsplot raster 安徽 20260227 -p o3pr -o o3pr_anhui_20260227.png
334
336
  # Plot an explicit TROPOMI date range.
335
337
  rsplot raster 长三角 20260101-20260131 -p no2 -o no2_yrd_202601.png
336
338
 
337
- # Plot gridded air-quality forecast initialized at a specific hour.
339
+ # Reconstructed-grid input is China standard time; rsplot converts it to the
340
+ # matching UTC archive filename. This reads 2026051100.nc.
341
+ rsplot reconstruct 安徽 2026051108 --var PM2.5 \
342
+ -o reconstruct_anhui_pm25.png
343
+
344
+ # Date-only input selects the latest complete hour in that China-time day.
345
+ rsplot reconstruct 合肥 20260511 --var O3 --res 0.01 \
346
+ -o reconstruct_hefei_o3.png
347
+
348
+ # Forecast input is China standard time; rsplot converts it
349
+ # to the matching UTC archive initialization hour before reading.
338
350
  rsplot forecast 安徽 2026063000 --lead 24 --var O3 -o forecast_anhui_o3.png
339
351
 
340
- # Date-only forecast input automatically selects the latest initialized hour.
352
+ # Date-only input selects the latest initialization within that China-time day.
341
353
  rsplot forecast 合肥 20260630 --lead 72 --var PM2.5 -o forecast_hefei_pm25.png
342
354
 
343
355
  # Overlay station observations on the forecast valid time.
344
356
  rsplot forecast 合肥 2026041409 --lead 6 --var O3 --station-overlay -o forecast_station_hefei_o3.png
345
357
 
358
+ # Plot ERA5 2 m temperature. Input hours are China standard time; rsplot
359
+ # converts them to the matching UTC archive day and hour automatically.
360
+ rsplot meteo 南京 2026051115 --temp-level 2m -o meteo_nanjing_t2m.png
361
+
362
+ # Plot black 850 hPa wind arrows; length represents speed and no wind
363
+ # colorbar is drawn. The reference arrow gives the speed scale.
364
+ rsplot meteo 南京 2026051115 --wind-level 850 -o meteo_nanjing_wind850.png
365
+
366
+ # Overlay black wind arrows on a temperature background. Only the temperature
367
+ # colorbar is drawn.
368
+ rsplot meteo 南京 2026051115 --temp-level 850 \
369
+ --wind-level 850 -o meteo_nanjing_t850_wind850.png
370
+
371
+ # Overlay station observations with black wind arrows.
372
+ rsplot meteo 南京 2026051115 --station-var O3 \
373
+ --wind-level 850 -o meteo_nanjing_o3_wind850.png
374
+
375
+ # Temperature, stations, and wind can be combined. The two colorbars describe
376
+ # temperature and station concentration; wind magnitude is encoded by length.
377
+ rsplot meteo 南京 2026051115 --temp-level 850 --station-var O3 \
378
+ --wind-level 850 -o meteo_nanjing_t850_o3_wind850.png
379
+
346
380
  # Plot national monitoring station observations.
347
381
  rsplot station 合肥 2026041415 --var O3 -o station_hefei_o3.png
348
382
 
349
- # Overlay hourly ERA5 10 m wind vectors on station observations.
350
- # Station timestamps default to Asia/Shanghai and are matched to ERA5 UTC.
351
- rsplot station 合肥 2026041415 --var O3 --wind-level 10m -o station_wind_hefei_o3.png
383
+ # Plot one station's hourly observations over the latest seven days.
384
+ rsplot trend 3347A 20260520 --days 7 --var O3 -o trend_3347A_o3_7d.png
385
+
386
+ # A single day and an explicit date range are also supported.
387
+ rsplot trend 3347A 20260520 --days 1 --var O3 -o trend_3347A_o3_day.png
388
+ rsplot trend 3347A 20260501-20260507 --var PM2.5 -o trend_3347A_pm25.png
389
+
390
+ # Plot all regional stations as grey lines plus the hourly station mean.
391
+ rsplot trend 重庆 20260520 --days 7 --var O3 --region -o trend_chongqing_o3.png
352
392
 
353
- # Pressure-level wind is also supported (1000/925/850/700/500 hPa).
354
- rsplot station 安徽 2026041415 --var PM2.5 --wind-level 850 -o station_wind_anhui_pm25.png
393
+ # Plot only the regional mean and highlight one or more explicit stations.
394
+ rsplot trend 重庆 20260520 --days 7 --var O3 --region --view mean \
395
+ --focus-station 3347A --threshold 200 -o trend_chongqing_focus.png
355
396
 
356
397
  # Overlay satellite raster data and station observations.
357
398
  rsplot overlay 合肥 2026041415 -p no2 --var NO2 -o overlay_hefei_no2.png
@@ -367,7 +408,9 @@ rsplot fnr 合肥 20260114 --voc-threshold 0.8 --nox-threshold 1.8 --display-max
367
408
  ```
368
409
 
369
410
  When `-o/--output` is provided, `rsplot` writes the image to that path and also
370
- writes a JSON sidecar with the same base name.
411
+ writes a JSON sidecar with the same base name. Reconstructed-grid JSON records
412
+ both the China-time input and matched UTC archive hour, source file, native and
413
+ output resolution, regional statistics, administrative summaries, and hotspots.
371
414
 
372
415
  ## License
373
416
 
@@ -1,7 +1,7 @@
1
1
  # rsplot
2
2
 
3
- `rsplot` is an Agent-oriented command-line tool for plotting remote-sensing and
4
- air-quality data. It is designed to provide a small, stable CLI surface for
3
+ `rsplot` is an Agent-oriented command-line tool for plotting remote-sensing,
4
+ reconstructed, and air-quality data. It provides a small, stable CLI surface for
5
5
  [tianpu-agent](https://git.lug.ustc.edu.cn/yaoyhu/tianpu-agent).
6
6
 
7
7
 
@@ -55,6 +55,7 @@ hcho = "/path/to/HCHO"
55
55
  guokong = "/path/to/guokong_combine"
56
56
  era5 = "/path/to/era5"
57
57
  forecast = "/path/to/forecast"
58
+ reconstruct = "/path/to/reconstruct"
58
59
 
59
60
  # Optional satellite basemap key. Leave commented unless you have a real key.
60
61
  # [tianditu]
@@ -80,6 +81,7 @@ export RSPLOT_DATA_DIR_HCHO="/path/to/HCHO"
80
81
  export RSPLOT_DATA_DIR_GUOKONG="/path/to/guokong_combine"
81
82
  export RSPLOT_DATA_DIR_ERA5="/path/to/era5"
82
83
  export RSPLOT_DATA_DIR_FORECAST="/path/to/forecast"
84
+ export RSPLOT_DATA_DIR_RECONSTRUCT="/path/to/reconstruct"
83
85
  export RSPLOT_HCHO_CMAP_FILE="/path/to/256x3_rgb_table.txt"
84
86
  ```
85
87
 
@@ -107,24 +109,63 @@ rsplot raster 安徽 20260227 -p o3pr -o o3pr_anhui_20260227.png
107
109
  # Plot an explicit TROPOMI date range.
108
110
  rsplot raster 长三角 20260101-20260131 -p no2 -o no2_yrd_202601.png
109
111
 
110
- # Plot gridded air-quality forecast initialized at a specific hour.
112
+ # Reconstructed-grid input is China standard time; rsplot converts it to the
113
+ # matching UTC archive filename. This reads 2026051100.nc.
114
+ rsplot reconstruct 安徽 2026051108 --var PM2.5 \
115
+ -o reconstruct_anhui_pm25.png
116
+
117
+ # Date-only input selects the latest complete hour in that China-time day.
118
+ rsplot reconstruct 合肥 20260511 --var O3 --res 0.01 \
119
+ -o reconstruct_hefei_o3.png
120
+
121
+ # Forecast input is China standard time; rsplot converts it
122
+ # to the matching UTC archive initialization hour before reading.
111
123
  rsplot forecast 安徽 2026063000 --lead 24 --var O3 -o forecast_anhui_o3.png
112
124
 
113
- # Date-only forecast input automatically selects the latest initialized hour.
125
+ # Date-only input selects the latest initialization within that China-time day.
114
126
  rsplot forecast 合肥 20260630 --lead 72 --var PM2.5 -o forecast_hefei_pm25.png
115
127
 
116
128
  # Overlay station observations on the forecast valid time.
117
129
  rsplot forecast 合肥 2026041409 --lead 6 --var O3 --station-overlay -o forecast_station_hefei_o3.png
118
130
 
131
+ # Plot ERA5 2 m temperature. Input hours are China standard time; rsplot
132
+ # converts them to the matching UTC archive day and hour automatically.
133
+ rsplot meteo 南京 2026051115 --temp-level 2m -o meteo_nanjing_t2m.png
134
+
135
+ # Plot black 850 hPa wind arrows; length represents speed and no wind
136
+ # colorbar is drawn. The reference arrow gives the speed scale.
137
+ rsplot meteo 南京 2026051115 --wind-level 850 -o meteo_nanjing_wind850.png
138
+
139
+ # Overlay black wind arrows on a temperature background. Only the temperature
140
+ # colorbar is drawn.
141
+ rsplot meteo 南京 2026051115 --temp-level 850 \
142
+ --wind-level 850 -o meteo_nanjing_t850_wind850.png
143
+
144
+ # Overlay station observations with black wind arrows.
145
+ rsplot meteo 南京 2026051115 --station-var O3 \
146
+ --wind-level 850 -o meteo_nanjing_o3_wind850.png
147
+
148
+ # Temperature, stations, and wind can be combined. The two colorbars describe
149
+ # temperature and station concentration; wind magnitude is encoded by length.
150
+ rsplot meteo 南京 2026051115 --temp-level 850 --station-var O3 \
151
+ --wind-level 850 -o meteo_nanjing_t850_o3_wind850.png
152
+
119
153
  # Plot national monitoring station observations.
120
154
  rsplot station 合肥 2026041415 --var O3 -o station_hefei_o3.png
121
155
 
122
- # Overlay hourly ERA5 10 m wind vectors on station observations.
123
- # Station timestamps default to Asia/Shanghai and are matched to ERA5 UTC.
124
- rsplot station 合肥 2026041415 --var O3 --wind-level 10m -o station_wind_hefei_o3.png
156
+ # Plot one station's hourly observations over the latest seven days.
157
+ rsplot trend 3347A 20260520 --days 7 --var O3 -o trend_3347A_o3_7d.png
158
+
159
+ # A single day and an explicit date range are also supported.
160
+ rsplot trend 3347A 20260520 --days 1 --var O3 -o trend_3347A_o3_day.png
161
+ rsplot trend 3347A 20260501-20260507 --var PM2.5 -o trend_3347A_pm25.png
162
+
163
+ # Plot all regional stations as grey lines plus the hourly station mean.
164
+ rsplot trend 重庆 20260520 --days 7 --var O3 --region -o trend_chongqing_o3.png
125
165
 
126
- # Pressure-level wind is also supported (1000/925/850/700/500 hPa).
127
- rsplot station 安徽 2026041415 --var PM2.5 --wind-level 850 -o station_wind_anhui_pm25.png
166
+ # Plot only the regional mean and highlight one or more explicit stations.
167
+ rsplot trend 重庆 20260520 --days 7 --var O3 --region --view mean \
168
+ --focus-station 3347A --threshold 200 -o trend_chongqing_focus.png
128
169
 
129
170
  # Overlay satellite raster data and station observations.
130
171
  rsplot overlay 合肥 2026041415 -p no2 --var NO2 -o overlay_hefei_no2.png
@@ -140,7 +181,9 @@ rsplot fnr 合肥 20260114 --voc-threshold 0.8 --nox-threshold 1.8 --display-max
140
181
  ```
141
182
 
142
183
  When `-o/--output` is provided, `rsplot` writes the image to that path and also
143
- writes a JSON sidecar with the same base name.
184
+ writes a JSON sidecar with the same base name. Reconstructed-grid JSON records
185
+ both the China-time input and matched UTC archive hour, source file, native and
186
+ output resolution, regional statistics, administrative summaries, and hotspots.
144
187
 
145
188
  ## License
146
189
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "rsplot"
3
- version = "0.2.7"
3
+ version = "0.3.0"
4
4
  description = "CLI tool for plotting Remote Sensing data, designed for Agent."
5
5
  authors = [
6
6
  { name = "Yaoyao Hu", email = "yaoyhu@mail.ustc.edu.cn" },
@@ -58,3 +58,9 @@ ignore = ["E501", "RUF001", "RUF002"]
58
58
 
59
59
  [tool.pytest.ini_options]
60
60
  testpaths = ["tests"]
61
+
62
+ [dependency-groups]
63
+ dev = [
64
+ "pytest>=9.1.1",
65
+ "ruff>=0.15.21",
66
+ ]
@@ -0,0 +1,10 @@
1
+ """rsplot — CLI tool for plotting Remote Sensing data, designed for agent."""
2
+
3
+ from importlib.metadata import PackageNotFoundError, version
4
+
5
+ try:
6
+ __version__ = version("rsplot")
7
+ except PackageNotFoundError: # pragma: no cover - source tree without install
8
+ __version__ = "unknown"
9
+
10
+ __all__ = ["__version__"]