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.
Files changed (73) hide show
  1. smashbox/.spyproject/config/backups/codestyle.ini.bak +8 -0
  2. smashbox/.spyproject/config/backups/encoding.ini.bak +6 -0
  3. smashbox/.spyproject/config/backups/vcs.ini.bak +7 -0
  4. smashbox/.spyproject/config/backups/workspace.ini.bak +12 -0
  5. smashbox/.spyproject/config/codestyle.ini +8 -0
  6. smashbox/.spyproject/config/defaults/defaults-codestyle-0.2.0.ini +5 -0
  7. smashbox/.spyproject/config/defaults/defaults-encoding-0.2.0.ini +3 -0
  8. smashbox/.spyproject/config/defaults/defaults-vcs-0.2.0.ini +4 -0
  9. smashbox/.spyproject/config/defaults/defaults-workspace-0.2.0.ini +6 -0
  10. smashbox/.spyproject/config/encoding.ini +6 -0
  11. smashbox/.spyproject/config/vcs.ini +7 -0
  12. smashbox/.spyproject/config/workspace.ini +12 -0
  13. smashbox/__init__.py +8 -0
  14. smashbox/asset/flwdir/flowdir_fr_1000m.tif +0 -0
  15. smashbox/asset/outlets/.Rhistory +0 -0
  16. smashbox/asset/outlets/db_bnbv_fr.csv +142704 -0
  17. smashbox/asset/outlets/db_bnbv_light.csv +42084 -0
  18. smashbox/asset/outlets/db_sites.csv +8700 -0
  19. smashbox/asset/outlets/db_stations.csv +2916 -0
  20. smashbox/asset/outlets/db_stations_example.csv +19 -0
  21. smashbox/asset/outlets/edit_database.py +185 -0
  22. smashbox/asset/outlets/readme.txt +5 -0
  23. smashbox/asset/params/ci.tif +0 -0
  24. smashbox/asset/params/cp.tif +0 -0
  25. smashbox/asset/params/ct.tif +0 -0
  26. smashbox/asset/params/kexc.tif +0 -0
  27. smashbox/asset/params/kmlt.tif +0 -0
  28. smashbox/asset/params/llr.tif +0 -0
  29. smashbox/asset/setup/setup_rhax_gr4_dt3600.yaml +15 -0
  30. smashbox/asset/setup/setup_rhax_gr4_dt900.yaml +15 -0
  31. smashbox/asset/setup/setup_rhax_gr5_dt3600.yaml +15 -0
  32. smashbox/asset/setup/setup_rhax_gr5_dt900.yaml +15 -0
  33. smashbox/init/README.md +3 -0
  34. smashbox/init/__init__.py +3 -0
  35. smashbox/init/multimodel_statistics.py +405 -0
  36. smashbox/init/param.py +799 -0
  37. smashbox/init/smashbox.py +186 -0
  38. smashbox/model/__init__.py +1 -0
  39. smashbox/model/atmos_data_connector.py +518 -0
  40. smashbox/model/mesh.py +185 -0
  41. smashbox/model/model.py +829 -0
  42. smashbox/model/setup.py +109 -0
  43. smashbox/plot/__init__.py +1 -0
  44. smashbox/plot/myplot.py +1133 -0
  45. smashbox/plot/plot.py +1662 -0
  46. smashbox/read_inputdata/__init__.py +1 -0
  47. smashbox/read_inputdata/read_data.py +1229 -0
  48. smashbox/read_inputdata/smashmodel.py +395 -0
  49. smashbox/stats/__init__.py +1 -0
  50. smashbox/stats/mystats.py +1632 -0
  51. smashbox/stats/stats.py +2022 -0
  52. smashbox/test.py +532 -0
  53. smashbox/test_average_stats.py +122 -0
  54. smashbox/test_mesh.r +8 -0
  55. smashbox/test_mesh_from_graffas.py +69 -0
  56. smashbox/tools/__init__.py +1 -0
  57. smashbox/tools/geo_toolbox.py +1028 -0
  58. smashbox/tools/tools.py +461 -0
  59. smashbox/tutorial_R.r +182 -0
  60. smashbox/tutorial_R_graffas.r +88 -0
  61. smashbox/tutorial_R_graffas_local.r +33 -0
  62. smashbox/tutorial_python.py +102 -0
  63. smashbox/tutorial_readme.py +261 -0
  64. smashbox/tutorial_report.py +58 -0
  65. smashbox/tutorials/Python_tutorial.md +124 -0
  66. smashbox/tutorials/R_Graffas_tutorial.md +153 -0
  67. smashbox/tutorials/R_tutorial.md +121 -0
  68. smashbox/tutorials/__init__.py +6 -0
  69. smashbox/tutorials/generate_doc.md +7 -0
  70. smashbox-1.0.dist-info/METADATA +998 -0
  71. smashbox-1.0.dist-info/RECORD +73 -0
  72. smashbox-1.0.dist-info/WHEEL +5 -0
  73. 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
+