rsplot 0.3.1.dev3__py3-none-any.whl → 0.3.2.dev37__py3-none-any.whl

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 (71) hide show
  1. rsplot/atomic.py +36 -0
  2. rsplot/cli.py +282 -469
  3. rsplot/commands/common.py +113 -1
  4. rsplot/commands/fnr.py +389 -104
  5. rsplot/commands/forecast.py +24 -7
  6. rsplot/commands/meteo.py +499 -186
  7. rsplot/commands/overlay.py +292 -205
  8. rsplot/commands/radius.py +526 -0
  9. rsplot/commands/raster.py +479 -230
  10. rsplot/commands/reconstruct.py +27 -6
  11. rsplot/commands/sidecar.py +106 -0
  12. rsplot/commands/station.py +154 -42
  13. rsplot/commands/station_trend.py +259 -174
  14. rsplot/config.py +46 -16
  15. rsplot/data_files.py +253 -0
  16. rsplot/errors.py +43 -0
  17. rsplot/fnr.py +38 -46
  18. rsplot/geo/boundaries.py +317 -11
  19. rsplot/geo/footprints.py +205 -0
  20. rsplot/geo/processing.py +84 -5
  21. rsplot/geo/radius.py +205 -0
  22. rsplot/plotting/colormap_22.txt +256 -0
  23. rsplot/plotting/colormaps.py +24 -29
  24. rsplot/plotting/map_frame.py +203 -9
  25. rsplot/plotting/meteo.py +10 -3
  26. rsplot/plotting/overlay.py +36 -40
  27. rsplot/plotting/raster.py +15 -3
  28. rsplot/plotting/station.py +86 -33
  29. rsplot/plotting/station_focus.py +84 -0
  30. rsplot/plotting/station_trend.py +60 -47
  31. rsplot/plotting/styles.py +3 -5
  32. rsplot/readers/__init__.py +89 -7
  33. rsplot/readers/_tropomi.py +121 -3
  34. rsplot/readers/base.py +16 -1
  35. rsplot/readers/era5.py +110 -10
  36. rsplot/readers/era5_wind.py +3 -2
  37. rsplot/readers/gems.py +429 -0
  38. rsplot/readers/guokong.py +125 -39
  39. rsplot/readers/netcdf.py +32 -0
  40. rsplot/readers/tropomi_hcho.py +1 -1
  41. rsplot/readers/tropomi_no2.py +1 -1
  42. rsplot/readers/tropomi_nrti.py +116 -0
  43. rsplot/readers/tropomi_o3.py +1 -1
  44. rsplot/readers/tropomi_o3pr.py +1 -1
  45. rsplot/result_builders/__init__.py +0 -14
  46. rsplot/result_builders/common.py +84 -0
  47. rsplot/result_builders/envelope.py +236 -0
  48. rsplot/result_builders/fnr.py +47 -131
  49. rsplot/result_builders/forecast.py +7 -0
  50. rsplot/result_builders/provenance.py +59 -0
  51. rsplot/result_builders/reconstruct.py +7 -0
  52. rsplot/result_builders/satellite.py +240 -0
  53. rsplot/result_builders/series_layer.py +289 -0
  54. rsplot/result_builders/station.py +23 -0
  55. rsplot/result_builders/station_layer.py +326 -0
  56. rsplot/results.py +0 -12
  57. rsplot/schemas/result.schema.json +566 -0
  58. rsplot/temporal.py +146 -16
  59. rsplot-0.3.2.dev37.dist-info/METADATA +996 -0
  60. rsplot-0.3.2.dev37.dist-info/RECORD +76 -0
  61. {rsplot-0.3.1.dev3.dist-info → rsplot-0.3.2.dev37.dist-info}/WHEEL +1 -1
  62. rsplot/commands/recent.py +0 -164
  63. rsplot/recent.py +0 -404
  64. rsplot/result_builders/meteo.py +0 -171
  65. rsplot/result_builders/overlay.py +0 -75
  66. rsplot/result_builders/raster.py +0 -72
  67. rsplot/result_builders/station_trend.py +0 -229
  68. rsplot-0.3.1.dev3.dist-info/METADATA +0 -477
  69. rsplot-0.3.1.dev3.dist-info/RECORD +0 -64
  70. {rsplot-0.3.1.dev3.dist-info → rsplot-0.3.2.dev37.dist-info}/entry_points.txt +0 -0
  71. {rsplot-0.3.1.dev3.dist-info → rsplot-0.3.2.dev37.dist-info}/licenses/LICENSE +0 -0
@@ -53,6 +53,7 @@ def run_forecast(
53
53
  from rsplot.geo.boundaries import resolve_region
54
54
  from rsplot.geo.processing import (
55
55
  buffered_extent,
56
+ prepare_display_grid,
56
57
  prepare_existing_grid,
57
58
  )
58
59
  from rsplot.plotting.colormaps import STATION_CONCENTRATION_CMAP
@@ -151,10 +152,22 @@ def run_forecast(
151
152
  info.geometry,
152
153
  fill_gaps=False,
153
154
  )
154
- if not np.isfinite(prepared.values).any():
155
+ display_source = prepared.unmasked_values
156
+ display_grid = prepare_display_grid(
157
+ prepared.lon,
158
+ prepared.lat,
159
+ display_source,
160
+ info.geometry,
161
+ smooth_sigma=smooth,
162
+ )
163
+ if not np.isfinite(display_grid).any():
155
164
  console.print("[red]目标区域内没有有效预报网格。[/red]")
156
165
  raise typer.Exit(1)
157
- if smooth is not None and smooth > 0:
166
+ if (
167
+ smooth is not None
168
+ and smooth > 0
169
+ and np.isfinite(prepared.values).any()
170
+ ):
158
171
  console.print(f" → 高斯平滑 sigma={smooth}")
159
172
  prepared = prepare_existing_grid(
160
173
  prepared.lon,
@@ -170,7 +183,12 @@ def run_forecast(
170
183
  f"({prepared.n_valid_region}/{prepared.total_region_pixels})"
171
184
  )
172
185
 
173
- auto_min, auto_max = auto_forecast_vrange(prepared.values, var_info)
186
+ auto_min, auto_max = auto_forecast_vrange(
187
+ prepared.values
188
+ if np.isfinite(prepared.values).any()
189
+ else display_grid,
190
+ var_info,
191
+ )
174
192
  use_vmin = vmin if vmin is not None else auto_min
175
193
  use_vmax = vmax if vmax is not None else auto_max
176
194
  try:
@@ -289,7 +307,7 @@ def run_forecast(
289
307
  plot_raster(
290
308
  prepared.lon,
291
309
  prepared.lat,
292
- prepared.values,
310
+ display_grid,
293
311
  info,
294
312
  dpi=use_dpi,
295
313
  cmap=use_cmap,
@@ -297,7 +315,6 @@ def run_forecast(
297
315
  vmax=use_vmax,
298
316
  basemap=use_basemap,
299
317
  tianditu_key=cfg.tianditu_key,
300
- hcho_cmap_file=cfg.hcho_cmap_file,
301
318
  title=title,
302
319
  output=output,
303
320
  colorbar_label=var_info.colorbar_label,
@@ -306,7 +323,7 @@ def run_forecast(
306
323
  plot_overlay(
307
324
  prepared.lon,
308
325
  prepared.lat,
309
- prepared.values,
326
+ display_grid,
310
327
  station_data,
311
328
  info,
312
329
  raster_cmap=use_cmap,
@@ -318,7 +335,6 @@ def run_forecast(
318
335
  dpi=use_dpi,
319
336
  basemap=use_basemap,
320
337
  tianditu_key=cfg.tianditu_key,
321
- hcho_cmap_file=cfg.hcho_cmap_file,
322
338
  title=title,
323
339
  output=output,
324
340
  )
@@ -330,6 +346,7 @@ def run_forecast(
330
346
  LON=prepared.lon,
331
347
  LAT=prepared.lat,
332
348
  grid=prepared.values,
349
+ display_grid=display_grid,
333
350
  vmin=use_vmin,
334
351
  vmax=use_vmax,
335
352
  output=output,