rsplot 0.2.4__tar.gz → 0.2.6__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 (34) hide show
  1. {rsplot-0.2.4 → rsplot-0.2.6}/.gitignore +1 -0
  2. {rsplot-0.2.4 → rsplot-0.2.6}/PKG-INFO +66 -4
  3. rsplot-0.2.6/README.md +144 -0
  4. {rsplot-0.2.4 → rsplot-0.2.6}/pyproject.toml +1 -1
  5. {rsplot-0.2.4 → rsplot-0.2.6}/src/rsplot/cli.py +415 -18
  6. {rsplot-0.2.4 → rsplot-0.2.6}/src/rsplot/config.py +113 -32
  7. {rsplot-0.2.4 → rsplot-0.2.6}/src/rsplot/geo/boundaries.py +6 -6
  8. {rsplot-0.2.4 → rsplot-0.2.6}/src/rsplot/geo/gridding.py +27 -4
  9. {rsplot-0.2.4 → rsplot-0.2.6}/src/rsplot/plotting/colormaps.py +18 -16
  10. {rsplot-0.2.4 → rsplot-0.2.6}/src/rsplot/plotting/overlay.py +23 -8
  11. {rsplot-0.2.4 → rsplot-0.2.6}/src/rsplot/plotting/raster.py +2 -1
  12. {rsplot-0.2.4 → rsplot-0.2.6}/src/rsplot/plotting/station.py +113 -9
  13. {rsplot-0.2.4 → rsplot-0.2.6}/src/rsplot/plotting/styles.py +9 -2
  14. rsplot-0.2.6/src/rsplot/readers/era5_wind.py +232 -0
  15. rsplot-0.2.6/src/rsplot/readers/forecast.py +257 -0
  16. {rsplot-0.2.4 → rsplot-0.2.6}/src/rsplot/readers/guokong.py +7 -7
  17. {rsplot-0.2.4 → rsplot-0.2.6}/src/rsplot/recent.py +19 -5
  18. {rsplot-0.2.4 → rsplot-0.2.6}/src/rsplot/results.py +122 -3
  19. rsplot-0.2.4/README.md +0 -82
  20. {rsplot-0.2.4 → rsplot-0.2.6}/LICENSE +0 -0
  21. {rsplot-0.2.4 → rsplot-0.2.6}/src/rsplot/__init__.py +0 -0
  22. {rsplot-0.2.4 → rsplot-0.2.6}/src/rsplot/__main__.py +0 -0
  23. {rsplot-0.2.4 → rsplot-0.2.6}/src/rsplot/fnr.py +0 -0
  24. {rsplot-0.2.4 → rsplot-0.2.6}/src/rsplot/geo/__init__.py +0 -0
  25. {rsplot-0.2.4 → rsplot-0.2.6}/src/rsplot/plotting/__init__.py +0 -0
  26. {rsplot-0.2.4 → rsplot-0.2.6}/src/rsplot/plotting/fnr.py +0 -0
  27. {rsplot-0.2.4 → rsplot-0.2.6}/src/rsplot/readers/__init__.py +0 -0
  28. {rsplot-0.2.4 → rsplot-0.2.6}/src/rsplot/readers/base.py +0 -0
  29. {rsplot-0.2.4 → rsplot-0.2.6}/src/rsplot/readers/tropomi_hcho.py +0 -0
  30. {rsplot-0.2.4 → rsplot-0.2.6}/src/rsplot/readers/tropomi_no2.py +0 -0
  31. {rsplot-0.2.4 → rsplot-0.2.6}/src/rsplot/readers/tropomi_o3.py +0 -0
  32. {rsplot-0.2.4 → rsplot-0.2.6}/src/rsplot/readers/tropomi_o3pr.py +0 -0
  33. {rsplot-0.2.4 → rsplot-0.2.6}/src/rsplot/tiles/__init__.py +0 -0
  34. {rsplot-0.2.4 → rsplot-0.2.6}/src/rsplot/tiles/tianditu.py +0 -0
@@ -280,3 +280,4 @@ tags
280
280
  logs/
281
281
  .vscode/
282
282
  .claude
283
+ tests/
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rsplot
3
- Version: 0.2.4
3
+ Version: 0.2.6
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
@@ -258,16 +258,65 @@ uv run rsplot --help
258
258
 
259
259
  ## Configuration
260
260
 
261
- For satellite basemaps, set a TianDiTu API key:
261
+ `rsplot` does not ship site-specific data paths. Configure local satellite,
262
+ station, boundary, and font paths with a TOML file:
263
+
264
+ ```bash
265
+ mkdir -p ~/.config/rsplot
266
+ cp config.example.toml ~/.config/rsplot/config.toml
267
+ ```
268
+
269
+ Then edit `~/.config/rsplot/config.toml`:
270
+
271
+ ```toml
272
+ [paths]
273
+ geojson_dir = "/path/to/geojson"
274
+ font_dir = "/path/to/fonts"
275
+ # hcho_cmap_file = "/path/to/256x3_rgb_table.txt"
276
+
277
+ [paths.data_dirs]
278
+ no2 = "/path/to/NO2"
279
+ o3 = "/path/to/O3"
280
+ o3pr = "/path/to/O3PR"
281
+ hcho = "/path/to/HCHO"
282
+ guokong = "/path/to/guokong_combine"
283
+ era5 = "/path/to/era5"
284
+ forecast = "/path/to/forecast"
285
+
286
+ # Optional satellite basemap key. Leave commented unless you have a real key.
287
+ # [tianditu]
288
+ # api_key = "your-real-key"
289
+ ```
290
+
291
+ You can also point to a different config file:
292
+
293
+ ```bash
294
+ export RSPLOT_CONFIG="/path/to/rsplot.toml"
295
+ ```
296
+
297
+ Environment variables override TOML values:
262
298
 
263
299
  ```bash
264
300
  export TIANDITU_API_KEY="your-key"
301
+ export RSPLOT_GEOJSON_DIR="/path/to/geojson"
302
+ export RSPLOT_FONT_DIR="/path/to/fonts"
303
+ export RSPLOT_DATA_DIR_NO2="/path/to/NO2"
304
+ export RSPLOT_DATA_DIR_O3="/path/to/O3"
305
+ export RSPLOT_DATA_DIR_O3PR="/path/to/O3PR"
306
+ export RSPLOT_DATA_DIR_HCHO="/path/to/HCHO"
307
+ export RSPLOT_DATA_DIR_GUOKONG="/path/to/guokong_combine"
308
+ export RSPLOT_DATA_DIR_ERA5="/path/to/era5"
309
+ export RSPLOT_DATA_DIR_FORECAST="/path/to/forecast"
310
+ export RSPLOT_HCHO_CMAP_FILE="/path/to/256x3_rgb_table.txt"
265
311
  ```
266
312
 
313
+ Command-line directory options, such as `--data-dir`, take precedence for the
314
+ command being run. If no TianDiTu API key is configured, use `--basemap none`
315
+ to avoid requesting satellite tiles.
316
+
267
317
  ## Usage
268
318
 
269
- The examples below assume the command is running on a USTC server or in an
270
- environment with equivalent data paths configured.
319
+ The examples below assume data paths are configured and readable.
271
320
 
272
321
  ```bash
273
322
  # Show available commands and options.
@@ -285,9 +334,22 @@ rsplot raster 安徽 20260227 -p o3pr -o o3pr_anhui_20260227.png
285
334
  # Plot an explicit TROPOMI date range.
286
335
  rsplot raster 长三角 20260101-20260131 -p no2 -o no2_yrd_202601.png
287
336
 
337
+ # Plot gridded air-quality forecast initialized at a specific hour.
338
+ rsplot forecast 安徽 2026063000 --lead 24 --var O3 -o forecast_anhui_o3.png
339
+
340
+ # Date-only forecast input automatically selects the latest initialized hour.
341
+ rsplot forecast 合肥 20260630 --lead 72 --var PM2.5 -o forecast_hefei_pm25.png
342
+
288
343
  # Plot national monitoring station observations.
289
344
  rsplot station 合肥 2026041415 --var O3 -o station_hefei_o3.png
290
345
 
346
+ # Overlay hourly ERA5 10 m wind vectors on station observations.
347
+ # Station timestamps default to Asia/Shanghai and are matched to ERA5 UTC.
348
+ rsplot station 合肥 2026041415 --var O3 --wind-level 10m -o station_wind_hefei_o3.png
349
+
350
+ # Pressure-level wind is also supported (1000/925/850/700/500 hPa).
351
+ rsplot station 安徽 2026041415 --var PM2.5 --wind-level 850 -o station_wind_anhui_pm25.png
352
+
291
353
  # Overlay satellite raster data and station observations.
292
354
  rsplot overlay 合肥 2026041415 -p no2 --var NO2 -o overlay_hefei_no2.png
293
355
 
rsplot-0.2.6/README.md ADDED
@@ -0,0 +1,144 @@
1
+ # rsplot
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
5
+ [tianpu-agent](https://git.lug.ustc.edu.cn/yaoyhu/tianpu-agent).
6
+
7
+
8
+ ## Installation
9
+
10
+ Run directly with `uvx`:
11
+
12
+ ```bash
13
+ uvx rsplot --help
14
+ ```
15
+
16
+ Or install it in a project environment:
17
+
18
+ ```bash
19
+ uv add rsplot
20
+ uv run rsplot --help
21
+ ```
22
+
23
+ For local development:
24
+
25
+ ```bash
26
+ git clone https://github.com/yaoyhu/rsplot.git
27
+ cd rsplot
28
+ uv sync
29
+ uv run rsplot --help
30
+ ```
31
+
32
+ ## Configuration
33
+
34
+ `rsplot` does not ship site-specific data paths. Configure local satellite,
35
+ station, boundary, and font paths with a TOML file:
36
+
37
+ ```bash
38
+ mkdir -p ~/.config/rsplot
39
+ cp config.example.toml ~/.config/rsplot/config.toml
40
+ ```
41
+
42
+ Then edit `~/.config/rsplot/config.toml`:
43
+
44
+ ```toml
45
+ [paths]
46
+ geojson_dir = "/path/to/geojson"
47
+ font_dir = "/path/to/fonts"
48
+ # hcho_cmap_file = "/path/to/256x3_rgb_table.txt"
49
+
50
+ [paths.data_dirs]
51
+ no2 = "/path/to/NO2"
52
+ o3 = "/path/to/O3"
53
+ o3pr = "/path/to/O3PR"
54
+ hcho = "/path/to/HCHO"
55
+ guokong = "/path/to/guokong_combine"
56
+ era5 = "/path/to/era5"
57
+ forecast = "/path/to/forecast"
58
+
59
+ # Optional satellite basemap key. Leave commented unless you have a real key.
60
+ # [tianditu]
61
+ # api_key = "your-real-key"
62
+ ```
63
+
64
+ You can also point to a different config file:
65
+
66
+ ```bash
67
+ export RSPLOT_CONFIG="/path/to/rsplot.toml"
68
+ ```
69
+
70
+ Environment variables override TOML values:
71
+
72
+ ```bash
73
+ export TIANDITU_API_KEY="your-key"
74
+ export RSPLOT_GEOJSON_DIR="/path/to/geojson"
75
+ export RSPLOT_FONT_DIR="/path/to/fonts"
76
+ export RSPLOT_DATA_DIR_NO2="/path/to/NO2"
77
+ export RSPLOT_DATA_DIR_O3="/path/to/O3"
78
+ export RSPLOT_DATA_DIR_O3PR="/path/to/O3PR"
79
+ export RSPLOT_DATA_DIR_HCHO="/path/to/HCHO"
80
+ export RSPLOT_DATA_DIR_GUOKONG="/path/to/guokong_combine"
81
+ export RSPLOT_DATA_DIR_ERA5="/path/to/era5"
82
+ export RSPLOT_DATA_DIR_FORECAST="/path/to/forecast"
83
+ export RSPLOT_HCHO_CMAP_FILE="/path/to/256x3_rgb_table.txt"
84
+ ```
85
+
86
+ Command-line directory options, such as `--data-dir`, take precedence for the
87
+ command being run. If no TianDiTu API key is configured, use `--basemap none`
88
+ to avoid requesting satellite tiles.
89
+
90
+ ## Usage
91
+
92
+ The examples below assume data paths are configured and readable.
93
+
94
+ ```bash
95
+ # Show available commands and options.
96
+ rsplot --help
97
+
98
+ # Plot a single-day TROPOMI raster.
99
+ rsplot raster 合肥 20260115 -p no2 -o ./logs/hcho/raster_city_jiujiang_hcho.png
100
+
101
+ # Plot a 30-day TROPOMI window mean.
102
+ rsplot raster 安徽 20260131 -p hcho --days 30 -o hcho_anhui_202601.png
103
+
104
+ # Plot a TROPOMI ozone-profile tropospheric column raster.
105
+ rsplot raster 安徽 20260227 -p o3pr -o o3pr_anhui_20260227.png
106
+
107
+ # Plot an explicit TROPOMI date range.
108
+ rsplot raster 长三角 20260101-20260131 -p no2 -o no2_yrd_202601.png
109
+
110
+ # Plot gridded air-quality forecast initialized at a specific hour.
111
+ rsplot forecast 安徽 2026063000 --lead 24 --var O3 -o forecast_anhui_o3.png
112
+
113
+ # Date-only forecast input automatically selects the latest initialized hour.
114
+ rsplot forecast 合肥 20260630 --lead 72 --var PM2.5 -o forecast_hefei_pm25.png
115
+
116
+ # Plot national monitoring station observations.
117
+ rsplot station 合肥 2026041415 --var O3 -o station_hefei_o3.png
118
+
119
+ # Overlay hourly ERA5 10 m wind vectors on station observations.
120
+ # Station timestamps default to Asia/Shanghai and are matched to ERA5 UTC.
121
+ rsplot station 合肥 2026041415 --var O3 --wind-level 10m -o station_wind_hefei_o3.png
122
+
123
+ # Pressure-level wind is also supported (1000/925/850/700/500 hPa).
124
+ rsplot station 安徽 2026041415 --var PM2.5 --wind-level 850 -o station_wind_anhui_pm25.png
125
+
126
+ # Overlay satellite raster data and station observations.
127
+ rsplot overlay 合肥 2026041415 -p no2 --var NO2 -o overlay_hefei_no2.png
128
+
129
+ # Plot an FNR regime map with the default 7-day window.
130
+ rsplot fnr 合肥 20260114 -o fnr_hefei.png
131
+
132
+ # Plot an FNR regime map with an explicit date range.
133
+ rsplot fnr 长三角 20260101-20260130 -o fnr_yrd_202601.png
134
+
135
+ # Override FNR regime thresholds for agent-driven sensitivity tests.
136
+ rsplot fnr 合肥 20260114 --voc-threshold 0.8 --nox-threshold 1.8 --display-max 5 -o fnr_hefei_sensitivity.png
137
+ ```
138
+
139
+ When `-o/--output` is provided, `rsplot` writes the image to that path and also
140
+ writes a JSON sidecar with the same base name.
141
+
142
+ ## License
143
+
144
+ This project is distributed under the license in `LICENSE`.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "rsplot"
3
- version = "0.2.4"
3
+ version = "0.2.6"
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" },