Changeset 4871
- Timestamp:
- Dec 3, 2007, 3:00:01 PM (16 years ago)
- Location:
- anuga_core/documentation/user_manual
- Files:
-
- 2 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/documentation/user_manual/anuga_user_manual.tex
r4870 r4871 1305 1305 the gauges shown in Figure \ref{fig:cairnsgauges} is \file{gauges.csv} 1306 1306 1307 \verbatiminput{demos/cairns/gauges.csv} .1307 \verbatiminput{demos/cairns/gauges.csv} 1308 1308 1309 1309 Header information has been included to identify the location in terms of eastings and … … 3971 3971 (as for the \file{run\_sydney\_smf.py} example). 3972 3972 3973 \subsubsection{How can I set the friction in different areas in the domain?} 3974 The model area will typically be estimating the water height and momentum over varying 3975 topographies which will have different friction values. One way of assigning 3976 different friction values is to create polygons (say \code{poly1, poly2 and poly3}) describing each 3977 area and then set the corresponding friction values in the following way 3978 3979 \code{domain.set_quantity('friction',Polygon_function([(poly1,f1),(poly2,f2), 3980 (poly3,f3))]))} 3981 3982 The values of \code{f1,f2} and \code{f3} could be constant or functions 3983 as determined by the user. 3984 3985 \subsubsection{How can I combine data sets?} 3986 3987 A user may have access to a range of different resolution DEMs and raw data points (such 3988 as beach profiles, spot heights, single or multi-beam data etc) and will need 3989 to combine them to create an overall elevation data set. 3990 3991 If there are multiple DEMs, say of 10m and 25m resolution, then the technique is similar to 3992 that defined in the Cairns example described earlier, that is 3993 3994 {\small \begin{verbatim} 3995 convert_dem_from_ascii2netcdf(10m_dem_name, use_cache=True, verbose=True) 3996 convert_dem_from_ascii2netcdf(25m_dem_name, use_cache=True, verbose=True) 3997 \end{verbatim}} 3998 followed by 3999 {\small \begin{verbatim} 4000 dem2pts(10m_dem_name, use_cache=True, verbose=True) 4001 dem2pts(25m_dem_name, use_cache=True, verbose=True) 4002 \end{verbatim}} 4003 These data sets can now be combined by 4004 {\small \begin{verbatim} 4005 from anuga.geospatial_data.geospatial_data import * 4006 G1 = Geospatial_data(file_name = 10m_dem_name + '.pts') 4007 G2 = Geospatial_data(file_name = 25m_dem_name + '.pts') 4008 G = G1 + G2 4009 G.export_points_file(combined_dem_name + .pts) 4010 \end{verbatim}} 4011 this is the basic way of combining data sets, however, the user will need to 4012 assess the boundaries of each data set and whether they overlap. For example, consider 4013 if the 10m DEM is describing by \code{poly1} and the 25m DEM is described by \code{poly2} 4014 with \code{poly1} completely enclosed in \code{poly2} as shown in Figure \ref{fig:polydata} 4015 \begin{figure}[hbt] 4016 \centerline{\includegraphics{graphics/polyanddata.jpg}} 4017 \caption{Polygons describing the extent of the 10m and 25m DEM.} 4018 \label{fig:polydata} 4019 \end{figure} 4020 To combine the data sets, the geospatial addition is updated to 4021 {\small \begin{verbatim} 4022 G = G1 + G2.clip_outside(Geospatial_data(poly1)) 4023 \end{verbatim}} 4024 For this example, we assume that \code{poly2} is the domain, otherwise an additional dataset 4025 would be required for the remainder of the domain. 4026 4027 This technique can be expanded to handle point data sets as well. In the case 4028 of a bathymetry data set available in text format in an \code{.xya} file, then 4029 the geospatial addition is updated to 4030 {\small \begin{verbatim} 4031 G3 = Geospatial_data(file_name = bathy_data_name + '.xya') 4032 G = G1 + G2.clip_outside(Geospatial_data(poly1)) 4033 \end{verbatim}} 4034 The \code{.xya} file has the data stored as \code{x,y,elevation} with the text \code{elevation} 4035 on the first line. 4036 4037 The coastline could be included 4038 as part of the clipping polygon to separate the offshore and onshore datasets if required. 4039 Assume that \code{poly1} crosses the coastline 4040 In this case, two new polygons could be created out of \code{poly1} which uses the coastline 4041 as the divider. As shown in Figure \ref{fig:polycoast}, \code{poly3} describes the 4042 onshore data and \code{poly4} describes the offshore data. 4043 \begin{figure}[hbt] 4044 \centerline{\includegraphics{graphics/polyanddata2.jpg}} 4045 \caption{Inclusion of new polygons separating the 10m DEM area into an 4046 onshore (poly3) and offshore (poly4) data set.} 4047 \label{fig:polycoast} 4048 \end{figure} 4049 Let's include the bathymetry 4050 data described above, so to combine the datasets in this case, 4051 {\small \begin{verbatim} 4052 G = G1.clip(Geospatial_data(poly3)) + G2.clip_outside(Geospatial_data(poly1)) + G3 4053 \end{verbatim}} 4054 4055 Finally, to fit the elevation data to the mesh, the script is adjusted in this way 4056 {\small \begin{verbatim} 4057 domain.set_quantity('elevation', 4058 filename = combined_dem_name + '.pts', 4059 use_cache = True, 4060 verbose = True) 4061 \end{verbatim}} 3973 4062 \subsection{Boundary Conditions} 3974 4063
Note: See TracChangeset
for help on using the changeset viewer.