rsplot 0.3.2.dev4__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.
- rsplot/atomic.py +36 -0
- rsplot/cli.py +272 -497
- rsplot/commands/common.py +52 -3
- rsplot/commands/fnr.py +389 -104
- rsplot/commands/forecast.py +0 -2
- rsplot/commands/meteo.py +499 -186
- rsplot/commands/overlay.py +284 -326
- rsplot/commands/radius.py +526 -0
- rsplot/commands/raster.py +418 -293
- rsplot/commands/reconstruct.py +0 -1
- rsplot/commands/sidecar.py +106 -0
- rsplot/commands/station.py +154 -42
- rsplot/commands/station_trend.py +259 -174
- rsplot/config.py +43 -16
- rsplot/data_files.py +253 -0
- rsplot/errors.py +43 -0
- rsplot/fnr.py +38 -46
- rsplot/geo/boundaries.py +212 -9
- rsplot/geo/footprints.py +3 -0
- rsplot/geo/processing.py +2 -5
- rsplot/geo/radius.py +205 -0
- rsplot/plotting/colormap_22.txt +256 -0
- rsplot/plotting/colormaps.py +24 -29
- rsplot/plotting/map_frame.py +84 -6
- rsplot/plotting/meteo.py +10 -3
- rsplot/plotting/overlay.py +31 -40
- rsplot/plotting/raster.py +10 -3
- rsplot/plotting/station.py +86 -33
- rsplot/plotting/station_focus.py +84 -0
- rsplot/plotting/station_trend.py +60 -47
- rsplot/plotting/styles.py +3 -5
- rsplot/readers/__init__.py +52 -4
- rsplot/readers/_tropomi.py +121 -3
- rsplot/readers/era5.py +110 -10
- rsplot/readers/era5_wind.py +3 -2
- rsplot/readers/gems.py +11 -8
- rsplot/readers/guokong.py +125 -39
- rsplot/readers/netcdf.py +32 -0
- rsplot/readers/tropomi_hcho.py +1 -1
- rsplot/readers/tropomi_no2.py +1 -1
- rsplot/readers/tropomi_nrti.py +116 -0
- rsplot/readers/tropomi_o3.py +1 -1
- rsplot/readers/tropomi_o3pr.py +1 -1
- rsplot/result_builders/__init__.py +0 -14
- rsplot/result_builders/common.py +4 -1
- rsplot/result_builders/envelope.py +236 -0
- rsplot/result_builders/fnr.py +47 -131
- rsplot/result_builders/provenance.py +59 -0
- rsplot/result_builders/satellite.py +240 -0
- rsplot/result_builders/series_layer.py +289 -0
- rsplot/result_builders/station.py +23 -0
- rsplot/result_builders/station_layer.py +326 -0
- rsplot/results.py +0 -12
- rsplot/schemas/result.schema.json +566 -0
- rsplot/temporal.py +7 -0
- {rsplot-0.3.2.dev4.dist-info → rsplot-0.3.2.dev37.dist-info}/METADATA +426 -121
- rsplot-0.3.2.dev37.dist-info/RECORD +76 -0
- {rsplot-0.3.2.dev4.dist-info → rsplot-0.3.2.dev37.dist-info}/WHEEL +1 -1
- rsplot/commands/recent.py +0 -186
- rsplot/recent.py +0 -447
- rsplot/result_builders/meteo.py +0 -171
- rsplot/result_builders/overlay.py +0 -105
- rsplot/result_builders/raster.py +0 -104
- rsplot/result_builders/station_trend.py +0 -229
- rsplot-0.3.2.dev4.dist-info/RECORD +0 -66
- {rsplot-0.3.2.dev4.dist-info → rsplot-0.3.2.dev37.dist-info}/entry_points.txt +0 -0
- {rsplot-0.3.2.dev4.dist-info → rsplot-0.3.2.dev37.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
rsplot/__init__.py,sha256=3Ruc0uv8gybHmJAfHMssKlx4uZm11vfRK3qljZXs5WU,318
|
|
2
|
+
rsplot/__main__.py,sha256=8_HlBH7_zVm8ZVDcTcqTylcu2BPnU9zZ2Hnnw3sHItE,96
|
|
3
|
+
rsplot/atomic.py,sha256=-jd1FMIpgiqF9ZyqI1SluHEgk97EkUXn25iucuX_2gs,1197
|
|
4
|
+
rsplot/cli.py,sha256=BCCHdy24fISm28kNrNbF2a5n1SSMTiBsHRpRSQD_fzc,24114
|
|
5
|
+
rsplot/config.py,sha256=EBbkmMD72kvSA5zEteHUlPOnNFHW-BopYrs518hPJT8,14533
|
|
6
|
+
rsplot/data_files.py,sha256=ROcvzCaTP-qBPyFnmpNVbfWsV8GVl2RWcUmZV1fYMhg,8783
|
|
7
|
+
rsplot/errors.py,sha256=axY2z_D72Jzj0DQV_KpT1DKOTWbzO9_WDgF8feWw6Dk,1103
|
|
8
|
+
rsplot/fnr.py,sha256=j9Fmh9mai8aXXf8xohI1x9B9QYiOldlRf66VgV7AcFQ,11210
|
|
9
|
+
rsplot/results.py,sha256=tu8BMiBHnYpzZrKEzaiCJq7wyucRDbnaVJu4AD-G4AA,917
|
|
10
|
+
rsplot/stats.py,sha256=qDv8NCgS9_6Hu8Ni3dTh54JcBfzYBmW9K9JBLniNGaA,1158
|
|
11
|
+
rsplot/temporal.py,sha256=v3bi_VZz9X0QOvR0_YaUVvXytFpWGg1RenRCWxbHjgY,11475
|
|
12
|
+
rsplot/commands/__init__.py,sha256=zd-RHo-2h_6Jl_ws13RX13PgqMT5q4EWczpBd5Nd5Jk,73
|
|
13
|
+
rsplot/commands/common.py,sha256=mFIZAs4Mz9QCyaWX3zYwBHlk_SSOtcIZvDnyTKS4El8,7397
|
|
14
|
+
rsplot/commands/fnr.py,sha256=6dhxJRb5EdtV586kc-GUF6lDsBMzgaNNrdzluLQS7gQ,17493
|
|
15
|
+
rsplot/commands/forecast.py,sha256=yeZMOBdjaoNCD9OYu6fjUeXTD2qDKaVPUdPBVTqHC8A,11809
|
|
16
|
+
rsplot/commands/meteo.py,sha256=djaqvwsAwM6Bu1XQOyYbeze5Rs-Vp2fnKCXaEROUrHk,22829
|
|
17
|
+
rsplot/commands/overlay.py,sha256=ZbdJQzwYkj5jD29m-qVpGPwVRkKzSEuKn4nE-wrOVsg,11050
|
|
18
|
+
rsplot/commands/radius.py,sha256=8hZDNpqDQV2Y95Ihylq2PjS3y5ribANkIgWbC98NlKw,17505
|
|
19
|
+
rsplot/commands/raster.py,sha256=vlLyo-3FShmir78dixD69MmyzRUY3mYcB3uibSUhqG4,21342
|
|
20
|
+
rsplot/commands/reconstruct.py,sha256=a3enXXlHXNUd0GfiCb-zdrJDceD_KcHxKUquh-hl66I,7185
|
|
21
|
+
rsplot/commands/sidecar.py,sha256=DsJ1nznw-16f8KEsT0yj4FHQMRlaIkUSwuKKRfgE5K8,3737
|
|
22
|
+
rsplot/commands/station.py,sha256=n2PFBMqRaIlMUECNUx5YnHocC5-2t6GbIZessCID9LI,7541
|
|
23
|
+
rsplot/commands/station_trend.py,sha256=g3PJWEcCKuVdj2ohJxMJo3k3Oowr68Ka29-Me8oICQA,12416
|
|
24
|
+
rsplot/geo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
25
|
+
rsplot/geo/boundaries.py,sha256=s-G1tml2PqYAnRjnMJHdvW2-IMggPy1ceRf0hL8eAVY,24929
|
|
26
|
+
rsplot/geo/footprints.py,sha256=UR6a_bEWp-uTicvrM9kFe-dZoboNPCiRwWrxvdRNwZE,7083
|
|
27
|
+
rsplot/geo/gridding.py,sha256=CA1imAZYz5lxYnVJx1SBBXxDf_WaEpiVe10J4EoVefY,4392
|
|
28
|
+
rsplot/geo/processing.py,sha256=oCBzqeC2wCFq2thblCD6vIH83yTS6zK0WrTwGouVLGE,5526
|
|
29
|
+
rsplot/geo/radius.py,sha256=KKTAHMLC-t0ZB3CbqtFt6oqa9KM5vhAql31Zh-sJ5I4,6669
|
|
30
|
+
rsplot/plotting/__init__.py,sha256=DYZUFHxzFHkgH8RvmoqjBTtEg9TYbKlv4-tyVXBR3nY,67
|
|
31
|
+
rsplot/plotting/colormap_22.txt,sha256=eHjRx-ytV1aafK-ulojhvoL7qzzo-1oJ7h7jFwS1k50,10496
|
|
32
|
+
rsplot/plotting/colormaps.py,sha256=g7L_SpC5hnOf_Djnx1Ts2WKi73loJJB6RiNWkcK9fhg,1638
|
|
33
|
+
rsplot/plotting/fnr.py,sha256=RLtyUTzDgLlKQ8SJz_msv4N8TmpMJerq1g8wAN50rN4,4032
|
|
34
|
+
rsplot/plotting/map_frame.py,sha256=cnA35GKwIwlkdcTNW7t5oB0eFLA3YbE4LI6TOBPlb6E,13204
|
|
35
|
+
rsplot/plotting/meteo.py,sha256=48IZfz8TbQ4LRhzNwZfNQ_0_iBpZiuml_QcqJfgIf2A,4965
|
|
36
|
+
rsplot/plotting/overlay.py,sha256=wEL4qrtNGECqcY0p69fHh437bQwAK1j_SNfEap8oZ9k,5373
|
|
37
|
+
rsplot/plotting/raster.py,sha256=wYXLfsxJo33R4j6r_XgoT2meLgFdGB-Y5DcdlVxsXME,3193
|
|
38
|
+
rsplot/plotting/station.py,sha256=Q3SPrNfNJqnBJh0VUuOguXI0z7au84l3SFgHyvY5cNk,6729
|
|
39
|
+
rsplot/plotting/station_focus.py,sha256=pk0Y7cy7-5r--iyND3BBCeCA2JRLUlmfbtxqXO3_X34,2705
|
|
40
|
+
rsplot/plotting/station_trend.py,sha256=_4IA5QeGIQFVRF0TJDRHGXJi-5C59aLdu5sK5urnWUs,10427
|
|
41
|
+
rsplot/plotting/styles.py,sha256=wdWLd3mW8Q04Ymk-jFofvK88TX3z-ZIGLJsRWF8LVxo,1177
|
|
42
|
+
rsplot/plotting/wind.py,sha256=1YNdEg0c19AyHt2hQjAng8-nMItPBfUVEmcy9sIBvqw,2102
|
|
43
|
+
rsplot/readers/__init__.py,sha256=HZgHdfLJADaOqqlH1wtEh4zEtAfcdmGPZ3o0oK8ANCI,6725
|
|
44
|
+
rsplot/readers/_tropomi.py,sha256=jBHmECgVcJiyVpqvzBZ9WMyktd6HGoWHbSYWi51TyPE,8951
|
|
45
|
+
rsplot/readers/base.py,sha256=1hOS3XDExzwHwcwBLahvgjv-3cOFydiTtlGX7ZW3AQU,5715
|
|
46
|
+
rsplot/readers/era5.py,sha256=d060c-PUy95DEQGdPghGymygLJPY2usXIEbDg-8vL7Q,9895
|
|
47
|
+
rsplot/readers/era5_wind.py,sha256=xZHpc3sOFYmjK31O6FepsKMNqimzmz1ns_MRtXN0noE,5470
|
|
48
|
+
rsplot/readers/forecast.py,sha256=a6JowdoxcpTMCnFVfMRlEffnZ2rM8DPhzHG9e-LliV8,9341
|
|
49
|
+
rsplot/readers/gems.py,sha256=1eg9b58NEgS3CqHwU1XSSK2Mw4Qq95zXmG9YENWCctc,15461
|
|
50
|
+
rsplot/readers/guokong.py,sha256=yRClssJ6q7O8OPgbtJ6By43yQaFnH4R3dVyqDeBajrs,18030
|
|
51
|
+
rsplot/readers/netcdf.py,sha256=3pKwA0SaakujdC5-KsX2idkzEnn2p0NarAwwhZS_ysQ,1023
|
|
52
|
+
rsplot/readers/reconstruct.py,sha256=NCPOP6aqJnWm4PnErj3haq0p6s18ozJb6B0j_fU58DY,13388
|
|
53
|
+
rsplot/readers/tropomi_hcho.py,sha256=UH_x8AO5Q1A0uXbBRTqK5_e8QvOYQz9k0g8MK3xBjik,1136
|
|
54
|
+
rsplot/readers/tropomi_no2.py,sha256=qT8HmarOFne_yAO_9tL9R3j9kOoCo2ONEGfHo309wFI,1112
|
|
55
|
+
rsplot/readers/tropomi_nrti.py,sha256=q3zdWKNkoPuoluD4PCMF2wQKKuFPeTdKt_ORe1Zq8N8,4472
|
|
56
|
+
rsplot/readers/tropomi_o3.py,sha256=lpRExteJ-tqCBj5MoSkrGGM0PAbhUWOeJz1odRgDllM,1170
|
|
57
|
+
rsplot/readers/tropomi_o3pr.py,sha256=F8S51gplMZVoVY9ZcEq9r-_1o19F1BbyBPLPruCb49E,1117
|
|
58
|
+
rsplot/result_builders/__init__.py,sha256=C1LR7SzdoH8UNOcDy-21X2ZKjE30fUlcx2XrDPIapT4,373
|
|
59
|
+
rsplot/result_builders/common.py,sha256=jrKsamSD5r89yXYjs_fKOjNHhrCK1QxXIAOg5A414gE,6788
|
|
60
|
+
rsplot/result_builders/envelope.py,sha256=IpDeialpg9LR5m01fm4dGwwKOZMPeuvZ4s0nRPqxG7w,6735
|
|
61
|
+
rsplot/result_builders/fnr.py,sha256=dB5Su0x6KBxice2NnZGbGDlgjl_6x8o9BVDcECK5aho,3072
|
|
62
|
+
rsplot/result_builders/forecast.py,sha256=6RLdFVPITXUTTy6If4yr-BA__GYNeUcNP4EMV5QSeXc,3587
|
|
63
|
+
rsplot/result_builders/provenance.py,sha256=3nONbzlGdV9TLtvfu-tmY8_-OMAeTMWYQJ0Pmnlp818,2093
|
|
64
|
+
rsplot/result_builders/reconstruct.py,sha256=Uqwzi75NhEUIX1O2MijFaL9RMxAlCiRvReK4zUmX_80,2556
|
|
65
|
+
rsplot/result_builders/satellite.py,sha256=C7JH_DH-dQEP_avb3fGDtI5wxVYN7d2HX8kbkqLhHL0,7429
|
|
66
|
+
rsplot/result_builders/series_layer.py,sha256=eeKqERZkpk5gqXxqhGLMJdme0sVs0oK54t3Dc-FNUlg,8728
|
|
67
|
+
rsplot/result_builders/station.py,sha256=7bdfiKl2Ds3MNSOORXL41jLqnCsUDF6FYqCEyeuF6KA,7911
|
|
68
|
+
rsplot/result_builders/station_layer.py,sha256=iIbaufgyEXcIqiX4x8eMnQVQlWBpHc6qAjWsE5aq57E,10244
|
|
69
|
+
rsplot/schemas/result.schema.json,sha256=QLk92OnmBkDP2cfdi6ZPa04a8dGnetVCo89D66Ke0pI,18634
|
|
70
|
+
rsplot/tiles/__init__.py,sha256=R7864cYKm4gfLX07fbBeQelGjebQXkzBLDJUFy67UcU,30
|
|
71
|
+
rsplot/tiles/tianditu.py,sha256=9B2SXmjF3adWcq38LtP8DCu_4C1INRNOejibpRx1bnA,859
|
|
72
|
+
rsplot-0.3.2.dev37.dist-info/METADATA,sha256=tWGjV1jsKM8-buSpIR29q76A6u_qqWBJChAG_mWK3hc,50927
|
|
73
|
+
rsplot-0.3.2.dev37.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
74
|
+
rsplot-0.3.2.dev37.dist-info/entry_points.txt,sha256=ZhA4Divb4fJcggbG7usMVJ-VUTkEaQ-qfPlMimSBuCM,47
|
|
75
|
+
rsplot-0.3.2.dev37.dist-info/licenses/LICENSE,sha256=KD6mzCmXoacNoASeCa35MXu2DKG1Enm2UZa4OmnhmWs,11323
|
|
76
|
+
rsplot-0.3.2.dev37.dist-info/RECORD,,
|
rsplot/commands/recent.py
DELETED
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
"""Implementation service for the ``recent`` command."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
from typing import TYPE_CHECKING
|
|
6
|
-
|
|
7
|
-
import typer
|
|
8
|
-
|
|
9
|
-
from rsplot.commands.common import (
|
|
10
|
-
resolve_satellite,
|
|
11
|
-
satellite_errors,
|
|
12
|
-
satellite_filter_label,
|
|
13
|
-
validate_positive,
|
|
14
|
-
validate_unit_interval,
|
|
15
|
-
)
|
|
16
|
-
from rsplot.config import AppConfig
|
|
17
|
-
|
|
18
|
-
if TYPE_CHECKING:
|
|
19
|
-
from rich.console import Console
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
@satellite_errors
|
|
23
|
-
def run_recent(
|
|
24
|
-
*,
|
|
25
|
-
region: str,
|
|
26
|
-
end_date: str,
|
|
27
|
-
days: int,
|
|
28
|
-
source: str,
|
|
29
|
-
product: str,
|
|
30
|
-
sensor: str = "tropomi",
|
|
31
|
-
var: str,
|
|
32
|
-
level: str | None,
|
|
33
|
-
data_dir: str | None,
|
|
34
|
-
output: str | None,
|
|
35
|
-
res: float | None,
|
|
36
|
-
qa: float | None,
|
|
37
|
-
cf: float = 0.5,
|
|
38
|
-
console: Console,
|
|
39
|
-
) -> None:
|
|
40
|
-
"""Execute recent-day summaries without owning the Typer signature."""
|
|
41
|
-
from rsplot.config import STATION_VAR_META
|
|
42
|
-
from rsplot.geo.boundaries import resolve_region
|
|
43
|
-
from rsplot.recent import (
|
|
44
|
-
build_recent_result,
|
|
45
|
-
parse_recent_dates,
|
|
46
|
-
summarize_recent_raster,
|
|
47
|
-
summarize_recent_station,
|
|
48
|
-
write_recent_result,
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
use_source = source.lower()
|
|
52
|
-
if use_source not in ("raster", "station"):
|
|
53
|
-
console.print("[red]--source 仅支持 raster / station[/red]")
|
|
54
|
-
raise typer.Exit(1)
|
|
55
|
-
|
|
56
|
-
try:
|
|
57
|
-
dates = parse_recent_dates(end_date, days)
|
|
58
|
-
except ValueError as e:
|
|
59
|
-
console.print(f"[red]{e}[/red]")
|
|
60
|
-
raise typer.Exit(1) from e
|
|
61
|
-
|
|
62
|
-
cfg = AppConfig.load()
|
|
63
|
-
if use_source == "raster":
|
|
64
|
-
prod_info, use_qa = resolve_satellite(
|
|
65
|
-
product, sensor, qa, cfg, console
|
|
66
|
-
)
|
|
67
|
-
sensor = prod_info.sensor
|
|
68
|
-
elif sensor.lower() != "tropomi":
|
|
69
|
-
raise ValueError("--sensor gems 仅用于 --source raster。")
|
|
70
|
-
console.print(f"[bold]解析区域:[/bold] {region}")
|
|
71
|
-
info = resolve_region(region, cfg, level_override=level)
|
|
72
|
-
console.print(f" → [green]{info.name}[/green] (级别: {info.level})")
|
|
73
|
-
console.print(
|
|
74
|
-
f"[bold]统计窗口:[/bold] {dates[0]} ~ {dates[-1]} ({len(dates)} 天)"
|
|
75
|
-
)
|
|
76
|
-
|
|
77
|
-
if output is None:
|
|
78
|
-
if use_source == "raster":
|
|
79
|
-
output = (
|
|
80
|
-
f"/tmp/rsplot_recent_{'gems_' if sensor == 'gems' else ''}"
|
|
81
|
-
f"{info.name}_{product}_"
|
|
82
|
-
f"{dates[0]}_{dates[-1]}.json"
|
|
83
|
-
)
|
|
84
|
-
else:
|
|
85
|
-
output = (
|
|
86
|
-
f"/tmp/rsplot_recent_{info.name}_{var}_"
|
|
87
|
-
f"{dates[0]}_{dates[-1]}.json"
|
|
88
|
-
)
|
|
89
|
-
|
|
90
|
-
if use_source == "raster":
|
|
91
|
-
product_defaults = prod_info.defaults_for_level(info.level)
|
|
92
|
-
use_res = (
|
|
93
|
-
res
|
|
94
|
-
if res is not None
|
|
95
|
-
else product_defaults.res
|
|
96
|
-
if product_defaults.res is not None
|
|
97
|
-
else info.params.res
|
|
98
|
-
)
|
|
99
|
-
try:
|
|
100
|
-
validate_positive(use_res, "--res")
|
|
101
|
-
validate_unit_interval(use_qa, "--qa")
|
|
102
|
-
validate_unit_interval(cf, "--cf")
|
|
103
|
-
except ValueError as e:
|
|
104
|
-
console.print(f"[red]{e}[/red]")
|
|
105
|
-
raise typer.Exit(1) from e
|
|
106
|
-
if sensor == "gems":
|
|
107
|
-
from rsplot.readers.gems import GEMS_ANALYSIS_RESOLUTION
|
|
108
|
-
|
|
109
|
-
use_res = GEMS_ANALYSIS_RESOLUTION
|
|
110
|
-
use_data_dir = (
|
|
111
|
-
data_dir
|
|
112
|
-
if data_dir is not None
|
|
113
|
-
else cfg.get_data_dir(prod_info.data_key or product)
|
|
114
|
-
)
|
|
115
|
-
console.print(
|
|
116
|
-
f"\n[bold]统计栅格:[/bold] {use_data_dir} "
|
|
117
|
-
f"(产品: {product}, {satellite_filter_label(sensor, use_qa, cf)}, "
|
|
118
|
-
f"res={use_res})"
|
|
119
|
-
)
|
|
120
|
-
daily = summarize_recent_raster(
|
|
121
|
-
region=info,
|
|
122
|
-
product=product,
|
|
123
|
-
prod_info=prod_info,
|
|
124
|
-
data_dir=use_data_dir,
|
|
125
|
-
dates=dates,
|
|
126
|
-
res=use_res,
|
|
127
|
-
qa_threshold=use_qa,
|
|
128
|
-
cloud_fraction_max=cf,
|
|
129
|
-
console=console,
|
|
130
|
-
)
|
|
131
|
-
result = build_recent_result(
|
|
132
|
-
region=info,
|
|
133
|
-
source=use_source,
|
|
134
|
-
dates=dates,
|
|
135
|
-
daily=daily,
|
|
136
|
-
params={
|
|
137
|
-
"data_dir": use_data_dir,
|
|
138
|
-
"qa_threshold": use_qa,
|
|
139
|
-
"cloud_fraction_max": cf,
|
|
140
|
-
"resolution_deg": use_res,
|
|
141
|
-
},
|
|
142
|
-
product=product,
|
|
143
|
-
sensor=sensor,
|
|
144
|
-
quantity=prod_info.quantity,
|
|
145
|
-
unit=prod_info.colorbar_label,
|
|
146
|
-
output=output,
|
|
147
|
-
)
|
|
148
|
-
else:
|
|
149
|
-
if var not in STATION_VAR_META:
|
|
150
|
-
available = ", ".join(STATION_VAR_META)
|
|
151
|
-
console.print(f"[red]未知变量 '{var}'[/red]。可用: {available}")
|
|
152
|
-
raise typer.Exit(1)
|
|
153
|
-
if sensor == "gems":
|
|
154
|
-
from rsplot.readers.gems import GEMS_ANALYSIS_RESOLUTION
|
|
155
|
-
|
|
156
|
-
use_res = GEMS_ANALYSIS_RESOLUTION
|
|
157
|
-
use_data_dir = (
|
|
158
|
-
data_dir if data_dir is not None else cfg.get_data_dir("guokong")
|
|
159
|
-
)
|
|
160
|
-
unit = STATION_VAR_META[var][0]
|
|
161
|
-
console.print(f"\n[bold]统计站点:[/bold] {use_data_dir} (变量: {var})")
|
|
162
|
-
daily = summarize_recent_station(
|
|
163
|
-
region=info,
|
|
164
|
-
data_dir=use_data_dir,
|
|
165
|
-
dates=dates,
|
|
166
|
-
var_name=var,
|
|
167
|
-
console=console,
|
|
168
|
-
)
|
|
169
|
-
result = build_recent_result(
|
|
170
|
-
region=info,
|
|
171
|
-
source=use_source,
|
|
172
|
-
dates=dates,
|
|
173
|
-
daily=daily,
|
|
174
|
-
params={"data_dir": use_data_dir},
|
|
175
|
-
variable=var,
|
|
176
|
-
unit=unit or None,
|
|
177
|
-
output=output,
|
|
178
|
-
)
|
|
179
|
-
|
|
180
|
-
write_recent_result(result, output)
|
|
181
|
-
found = result["availability"]["days_found"]
|
|
182
|
-
failed = result["availability"]["days_failed"]
|
|
183
|
-
console.print(
|
|
184
|
-
f"\n[bold green]✓ 已保存:[/bold green] {output} "
|
|
185
|
-
f"(有效 {found}/{len(dates)} 天,失败 {failed})"
|
|
186
|
-
)
|