2 Copyright (C) 2015-2016 EDF
4 This file is part of SALOME HYDRO module.
6 SALOME HYDRO module is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 SALOME HYDRO module is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with SALOME HYDRO module. If not, see <http://www.gnu.org/licenses/>.
19 #########################################
20 Image and map background import
21 #########################################
23 .. |Hydro_module_button| image:: /../_static/HYDRO.png
28 .. |Hydro_module_launch| image:: /../_static/LaunchHYDRO.png
31 .. |import_image| image:: /../_static/importImage.png
34 .. |import_image2| image:: /../_static/importImage2.png
37 .. |selection_A| image:: /../_static/selectionA.png
40 .. |selection_B| image:: /../_static/selectionB.png
43 .. |selection_B2| image:: /../_static/selectionB2.png
46 .. |fit_all| image:: /../_static/fitall.png
49 .. |import_image_B| image:: /../_static/importImageB.png
52 .. |deux_images| image:: /../_static/deuxImages.png
55 .. |zoom_style| image:: /../_static/zoomStyle.png
58 Loading the HYDRO module
59 ========================
61 To activate the HYDRO module, it should be selected in the module scrolling list
62 or its icon clicked on in the ribbon: |Hydro_module_button|.
67 Importing and georeferencing a first image
68 ==========================================
70 Several images need to be imported in order to construct the contour of the river.
71 In this case, they are maps that can be downloaded from sites such as `Géoportail`_ or the IGN website.
72 Géoportail provides the means to find point coordinates in an image, needed for georeferencing.
74 .. _Géoportail: http://www.geoportail.gouv.fr/accueil
76 To import an image, open the pop-up menu (right click) in the SALOME HYDRO study tree *IMAGES* folder:
80 To import an image, open the pop-up menu (right click) in the SALOME HYDRO study tree IMAGES folder::
82 <appli_xxx>/bin/salome/test/HYDRO/garonne_ign_01.png
84 The image is displayed with two points, *A*and *B*, which will be repositioned at locations
85 whose coordinates in the Lambert 93 system are known, selected far enough apart to maintain
86 a good level of precision.
90 The two specific points for which the coordinates were previously located with Géoportail are shown below:
94 One point below and to the left of the figure *92*: coordinates (471562, 6367750).
98 The second at the centre of the cross next to *Hautevignes*: coordinates (489400, 6377020).
100 * **Note**: To control the zoom on the map, use the <Ctrl> key with the left mouse button.
101 To move around on the map, the <Ctrl> key should be used with the mouse wheel [or the middle mouse button].
103 Select point A then point B sequentially, using the *Activate point A selection*
104 then *Activate point B selection* buttons. Once the two points have been selected,
105 the georeferencing dialog box looks like this:
109 For the x,y coordinates of each point, the first column gives the coordinates of the image pixel and the second
110 column gives the geographical references.
112 The georeferencing is validated by clicking on the *Apply and Close* button.
113 You must ensure that the "eye" icon to the left of the image name in the tree is active
114 and re-centre the image using the *fit all* button: |fit_all|.
116 The image obtained is slightly tilted to the right.
118 * Note: in this view, the zoom may be performed with the mouse wheel.
119 The zoom may be centred on the mouse position or at the centre of the image.
120 This option is accessible in the *File/preferences* menu under the *SALOME* section,
121 *3D viewer* tab, *zooming style*:
125 When you move the mouse over the map, the cursor coordinates are displayed in the status bar at the bottom left
128 * **Note**: you must get used to **saving the current study regularly** (menu *File/Save* or *File/Save as*).
129 It is also advised to save the different steps of the study in different files:
130 *there have been previous instances where, under specific circumstances that are difficult to reproduce,
131 the study was saved in an incomplete state*. This problem has only arisen in cases where studies
132 incorporating data from several modules were being reloaded without the HYDRO module being activated
133 before the save operation.
134 To guard against the risk of an incomplete save, check that the HYDRO module is activated before saving the study.
136 Importing a second image, georeferenced from the first
137 ======================================================
139 The second image is stored in the same place as the first ::
141 <appli_xxx>/bin/salome/test/HYDRO/garonne_ign_02.png
143 This image is georeferenced using choose points on the reference image option in the diolog box.
144 Once the first image has been selected as reference, the two images are seen one above the other.
145 First, a point A is selected at the same location on both images, then a point B.
146 These two points should be as far apart as possible and the zoom sufficiently close to be precise.
147 The dialog box should now look like the one below:
151 After having confirmed the dialog instructions and then displayed both images and re-centred the view,
152 the following is obtained:
156 Definition of a local coordinate system
157 =======================================
159 Using a local reference point as origin reduces the size of the numbers being handled.
160 Changing the origin significantly improves the precision of the geometry, mesh and calculation steps.
161 On the contrary, keeping the large number values of the initial coordinates makes it impossible
162 to obtain a good quality mesh.
164 The coordinates of the new origin are entered via the *HYDRO/Change Local CS* menu.
166 In this example, the point (430 000, 6 350 000), located to the south west of our study domain, is entered.
168 After confirming the change of origin, one sees that the cursor coordinates, which are displayed in the status bar
169 at the bottom left of the application, are provided in both coordinate systems (local and global).
171 * **Note**: this change of origin can be made several times, at different points in the study,
172 as everything that was previously imported is transposed by the application.
173 However it is preferable to do this quite early to minimise the risks of error or inconsistency and,
174 in any event, before exporting the HYDRO module elements, particularly the model geometry.
175 It is recommended to set the local coordinate system early in the study,
176 as soon as the extent of the computational domain is known.
178 * After a change of origin, some entries in the study tree are marked in italic blue: they must be updated.
179 Use the context menu *update*, then reset the view with *Fit All* command.
184 All actions/operations completed through the graphic interface have their equivalent in Python script.
185 A script dump of the study can be made using the *File/Dump Study* menu.
186 The resulting Python script can be used to reconstruct the study data in a new SALOME study.
187 This script is of course editable.
189 The dump can be made after definition of the local coordinate system and the obtained file compared with ::
191 <appli_xxx>/bin/salome/test/HYDRO/h003_changeLCS.py
193 The correct execution of the dump can be checked by starting again with a new study
194 (restart SALOME, new document or just new document),
195 then menu *File/Load Script* and activation of the HYDRO module.
199 :ref:`ref_exempleInondation`