Changeset 4871


Ignore:
Timestamp:
Dec 3, 2007, 3:00:01 PM (16 years ago)
Author:
sexton
Message:

including more FAQs in usermanual

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  
    13051305the gauges shown in Figure \ref{fig:cairnsgauges} is \file{gauges.csv}
    13061306
    1307 \verbatiminput{demos/cairns/gauges.csv}.
     1307\verbatiminput{demos/cairns/gauges.csv}
    13081308
    13091309Header information has been included to identify the location in terms of eastings and
     
    39713971(as for the \file{run\_sydney\_smf.py} example).
    39723972
     3973\subsubsection{How can I set the friction in different areas in the domain?}
     3974The model area will typically be estimating the water height and momentum over varying
     3975topographies which will have different friction values. One way of assigning
     3976different friction values is to create polygons (say \code{poly1, poly2 and poly3}) describing each
     3977area 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
     3982The values of \code{f1,f2} and \code{f3} could be constant or functions
     3983as determined by the user.
     3984
     3985\subsubsection{How can I combine data sets?}
     3986
     3987A user may have access to a range of different resolution DEMs and raw data points (such
     3988as beach profiles, spot heights, single or multi-beam data etc) and will need
     3989to combine them to create an overall elevation data set.
     3990
     3991If there are multiple DEMs, say of 10m and 25m resolution, then the technique is similar to
     3992that defined in the Cairns example described earlier, that is
     3993
     3994{\small \begin{verbatim}
     3995convert_dem_from_ascii2netcdf(10m_dem_name, use_cache=True, verbose=True)
     3996convert_dem_from_ascii2netcdf(25m_dem_name, use_cache=True, verbose=True)
     3997\end{verbatim}}
     3998followed by 
     3999{\small \begin{verbatim}
     4000dem2pts(10m_dem_name, use_cache=True, verbose=True)
     4001dem2pts(25m_dem_name, use_cache=True, verbose=True)
     4002\end{verbatim}}
     4003These data sets can now be combined by
     4004{\small \begin{verbatim}
     4005from anuga.geospatial_data.geospatial_data import *
     4006G1 = Geospatial_data(file_name = 10m_dem_name + '.pts')
     4007G2 = Geospatial_data(file_name = 25m_dem_name + '.pts')
     4008G = G1 + G2
     4009G.export_points_file(combined_dem_name + ‘.pts’)
     4010\end{verbatim}}
     4011this is the basic way of combining data sets, however, the user will need to
     4012assess the boundaries of each data set and whether they overlap. For example, consider
     4013if the 10m DEM is describing by \code{poly1} and the 25m DEM is described by \code{poly2}
     4014with \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}
     4020To combine the data sets, the geospatial addition is updated to
     4021{\small \begin{verbatim}
     4022G = G1 + G2.clip_outside(Geospatial_data(poly1))
     4023\end{verbatim}}
     4024For this example, we assume that \code{poly2} is the domain, otherwise an additional dataset
     4025would be required for the remainder of the domain.
     4026
     4027This technique can be expanded to handle point data sets as well. In the case
     4028of a bathymetry data set available in text format in an \code{.xya} file, then
     4029the geospatial addition is updated to
     4030{\small \begin{verbatim}
     4031G3 = Geospatial_data(file_name = bathy_data_name + '.xya')
     4032G = G1 + G2.clip_outside(Geospatial_data(poly1))
     4033\end{verbatim}}
     4034The \code{.xya} file has the data stored as \code{x,y,elevation} with the text \code{elevation}
     4035on the first line.
     4036
     4037The coastline could be included
     4038as part of the clipping polygon to separate the offshore and onshore datasets if required.
     4039Assume that \code{poly1} crosses the coastline
     4040In this case, two new polygons could be created out of \code{poly1} which uses the coastline
     4041as the divider. As shown in Figure \ref{fig:polycoast}, \code{poly3} describes the
     4042onshore 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}
     4049Let's include the bathymetry
     4050data described above, so to combine the datasets in this case,
     4051{\small \begin{verbatim}
     4052G = G1.clip(Geospatial_data(poly3)) + G2.clip_outside(Geospatial_data(poly1)) + G3
     4053\end{verbatim}}
     4054
     4055Finally, 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}}
    39734062\subsection{Boundary Conditions}
    39744063
Note: See TracChangeset for help on using the changeset viewer.