smashbox 1.0__py2.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.
- smashbox/.spyproject/config/backups/codestyle.ini.bak +8 -0
- smashbox/.spyproject/config/backups/encoding.ini.bak +6 -0
- smashbox/.spyproject/config/backups/vcs.ini.bak +7 -0
- smashbox/.spyproject/config/backups/workspace.ini.bak +12 -0
- smashbox/.spyproject/config/codestyle.ini +8 -0
- smashbox/.spyproject/config/defaults/defaults-codestyle-0.2.0.ini +5 -0
- smashbox/.spyproject/config/defaults/defaults-encoding-0.2.0.ini +3 -0
- smashbox/.spyproject/config/defaults/defaults-vcs-0.2.0.ini +4 -0
- smashbox/.spyproject/config/defaults/defaults-workspace-0.2.0.ini +6 -0
- smashbox/.spyproject/config/encoding.ini +6 -0
- smashbox/.spyproject/config/vcs.ini +7 -0
- smashbox/.spyproject/config/workspace.ini +12 -0
- smashbox/__init__.py +8 -0
- smashbox/asset/flwdir/flowdir_fr_1000m.tif +0 -0
- smashbox/asset/outlets/.Rhistory +0 -0
- smashbox/asset/outlets/db_bnbv_fr.csv +142704 -0
- smashbox/asset/outlets/db_bnbv_light.csv +42084 -0
- smashbox/asset/outlets/db_sites.csv +8700 -0
- smashbox/asset/outlets/db_stations.csv +2916 -0
- smashbox/asset/outlets/db_stations_example.csv +19 -0
- smashbox/asset/outlets/edit_database.py +185 -0
- smashbox/asset/outlets/readme.txt +5 -0
- smashbox/asset/params/ci.tif +0 -0
- smashbox/asset/params/cp.tif +0 -0
- smashbox/asset/params/ct.tif +0 -0
- smashbox/asset/params/kexc.tif +0 -0
- smashbox/asset/params/kmlt.tif +0 -0
- smashbox/asset/params/llr.tif +0 -0
- smashbox/asset/setup/setup_rhax_gr4_dt3600.yaml +15 -0
- smashbox/asset/setup/setup_rhax_gr4_dt900.yaml +15 -0
- smashbox/asset/setup/setup_rhax_gr5_dt3600.yaml +15 -0
- smashbox/asset/setup/setup_rhax_gr5_dt900.yaml +15 -0
- smashbox/init/README.md +3 -0
- smashbox/init/__init__.py +3 -0
- smashbox/init/multimodel_statistics.py +405 -0
- smashbox/init/param.py +799 -0
- smashbox/init/smashbox.py +186 -0
- smashbox/model/__init__.py +1 -0
- smashbox/model/atmos_data_connector.py +518 -0
- smashbox/model/mesh.py +185 -0
- smashbox/model/model.py +829 -0
- smashbox/model/setup.py +109 -0
- smashbox/plot/__init__.py +1 -0
- smashbox/plot/myplot.py +1133 -0
- smashbox/plot/plot.py +1662 -0
- smashbox/read_inputdata/__init__.py +1 -0
- smashbox/read_inputdata/read_data.py +1229 -0
- smashbox/read_inputdata/smashmodel.py +395 -0
- smashbox/stats/__init__.py +1 -0
- smashbox/stats/mystats.py +1632 -0
- smashbox/stats/stats.py +2022 -0
- smashbox/test.py +532 -0
- smashbox/test_average_stats.py +122 -0
- smashbox/test_mesh.r +8 -0
- smashbox/test_mesh_from_graffas.py +69 -0
- smashbox/tools/__init__.py +1 -0
- smashbox/tools/geo_toolbox.py +1028 -0
- smashbox/tools/tools.py +461 -0
- smashbox/tutorial_R.r +182 -0
- smashbox/tutorial_R_graffas.r +88 -0
- smashbox/tutorial_R_graffas_local.r +33 -0
- smashbox/tutorial_python.py +102 -0
- smashbox/tutorial_readme.py +261 -0
- smashbox/tutorial_report.py +58 -0
- smashbox/tutorials/Python_tutorial.md +124 -0
- smashbox/tutorials/R_Graffas_tutorial.md +153 -0
- smashbox/tutorials/R_tutorial.md +121 -0
- smashbox/tutorials/__init__.py +6 -0
- smashbox/tutorials/generate_doc.md +7 -0
- smashbox-1.0.dist-info/METADATA +998 -0
- smashbox-1.0.dist-info/RECORD +73 -0
- smashbox-1.0.dist-info/WHEEL +5 -0
- smashbox-1.0.dist-info/licenses/LICENSE +100 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
"""
|
|
4
|
+
Created on Thu Oct 9 10:48:18 2025
|
|
5
|
+
|
|
6
|
+
@author: maxime
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
if __name__ == "__main__":
|
|
10
|
+
|
|
11
|
+
import smashbox
|
|
12
|
+
import numpy as np
|
|
13
|
+
|
|
14
|
+
# St Lo
|
|
15
|
+
info_simu_smash = {
|
|
16
|
+
# "domain": {"left": 807000, "right": 837000, "bottom": 6460000, "top": 6510000},
|
|
17
|
+
# "domain": {"left": 377000, "right": 450000, "bottom": 6840000, "top": 6920000},
|
|
18
|
+
"domain": {
|
|
19
|
+
"left": 925000.0,
|
|
20
|
+
"bottom": 6230000.0,
|
|
21
|
+
"right": 974000.0,
|
|
22
|
+
"top": 6255000.0,
|
|
23
|
+
},
|
|
24
|
+
"nom_long": "vivarais",
|
|
25
|
+
"resolution_sim": 1000.0,
|
|
26
|
+
}
|
|
27
|
+
bbox = smashbox.tools.tools.infograffas_bbox_extractor(info_simu_smash)
|
|
28
|
+
|
|
29
|
+
sb = smashbox.SmashBox()
|
|
30
|
+
|
|
31
|
+
sb.myparam.set_param("bbox", bbox)
|
|
32
|
+
|
|
33
|
+
sb.newmodel("graffas_zone")
|
|
34
|
+
|
|
35
|
+
sb.graffas_zone.mysetup.update_setup(
|
|
36
|
+
{
|
|
37
|
+
"pet_directory": "/home/maxime/DATA/ETP-SFR-FRA-INTERA_L93",
|
|
38
|
+
"prcp_directory": "/home/maxime/DATA/PLUIE",
|
|
39
|
+
"qobs_directory": "/home/maxime/DATA/QOBS_SITE_60M",
|
|
40
|
+
}
|
|
41
|
+
) # Change value of the Smash setup
|
|
42
|
+
|
|
43
|
+
sb.graffas_zone.generate_mesh(
|
|
44
|
+
query="(SURF>40) & (INFLUENCE=='Influence nulle ou faible')"
|
|
45
|
+
) # direct method to build the mesh (recommended)
|
|
46
|
+
|
|
47
|
+
sb.graffas_zone.myplot.plot_mesh()
|
|
48
|
+
|
|
49
|
+
sb.graffas_zone.mymesh.mesh["nrow"]
|
|
50
|
+
sb.graffas_zone.mymesh.mesh["ncol"]
|
|
51
|
+
|
|
52
|
+
nrow = 51
|
|
53
|
+
ncol = 31
|
|
54
|
+
chunk_size = 18
|
|
55
|
+
nb_chunk = 21
|
|
56
|
+
graffas_prcp = np.zeros(shape=(nrow, ncol, nb_chunk * chunk_size))
|
|
57
|
+
fctr = 100
|
|
58
|
+
for i in range(nb_chunk):
|
|
59
|
+
graffas_prcp[:, :, i * chunk_size : (i + 1) * chunk_size] = (
|
|
60
|
+
fctr
|
|
61
|
+
* np.arange(i * chunk_size, (i + 1) * chunk_size)
|
|
62
|
+
/ (chunk_size * nb_chunk)
|
|
63
|
+
* np.cos(np.arange(0, chunk_size * 10, 10) * np.pi / 180)
|
|
64
|
+
)
|
|
65
|
+
graffas_prcp = np.where(graffas_prcp < 0, 0.0, graffas_prcp)
|
|
66
|
+
|
|
67
|
+
sb.graffas_zone.atmos_data_connector(input_prcp=graffas_prcp, input_dt=3600.0)
|
|
68
|
+
|
|
69
|
+
sb.graffas_zone.model()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|