can we visualize water flows with 3d in R?

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

can we visualize water flows with 3d in R?

Marna Wagley
Hi R Users,
Is it possible to visualize river flow in  3D (latitude, longitude with
respect to depth)?
The example of my data looks like. Any suggestions?

> dat1
    long lat depth flow
1 1015.9 857  1.00 1.50
2 1015.9 857  1.25 1.23
3 1015.9 857  0.50 2.00
4 1015.9 858  0.10 1.95
5 1015.9 858  0.20 1.50
6 1025.0 858  0.30 1.20
7 1025.0 858  0.40 0.50
8 1025.0 858  0.35 0.70
9 1025.0 858  0.24 1.20

Thanks for your help.
thanks

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: can we visualize water flows with 3d in R?

Michal Kubista
Dear Marna,
This might come handy:
http://www.geo.ut.ee/aasa/LOOM02331/heatmap_in_R.html

Best regards,
Michal


*Michal Kubišta*
Retail Analytics Support
Europe Central/East
Nielsen
tel (+420) 242 438 737
www.nielsen.com

[image: nielsen] <http://www.nielsen.com/>

2016-10-12 10:49 GMT+02:00 Marna Wagley <[hidden email]>:

> Hi R Users,
> Is it possible to visualize river flow in  3D (latitude, longitude with
> respect to depth)?
> The example of my data looks like. Any suggestions?
>
> > dat1
>     long lat depth flow
> 1 1015.9 857  1.00 1.50
> 2 1015.9 857  1.25 1.23
> 3 1015.9 857  0.50 2.00
> 4 1015.9 858  0.10 1.95
> 5 1015.9 858  0.20 1.50
> 6 1025.0 858  0.30 1.20
> 7 1025.0 858  0.40 0.50
> 8 1025.0 858  0.35 0.70
> 9 1025.0 858  0.24 1.20
>
> Thanks for your help.
> thanks
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: can we visualize water flows with 3d in R?

Jim Lemon-4
In reply to this post by Marna Wagley
Hi Marna,
Isn't the conventional way to visualize depth as shades of blue?

library(plotrix)
depth.col<-color.scale(dat1$depth,extremes=c("lightblue",blue"))

Then color the lon/lat rectangles with depth.col

Jim



On Wed, Oct 12, 2016 at 7:49 PM, Marna Wagley <[hidden email]> wrote:

> Hi R Users,
> Is it possible to visualize river flow in  3D (latitude, longitude with
> respect to depth)?
> The example of my data looks like. Any suggestions?
>
>> dat1
>     long lat depth flow
> 1 1015.9 857  1.00 1.50
> 2 1015.9 857  1.25 1.23
> 3 1015.9 857  0.50 2.00
> 4 1015.9 858  0.10 1.95
> 5 1015.9 858  0.20 1.50
> 6 1025.0 858  0.30 1.20
> 7 1025.0 858  0.40 0.50
> 8 1025.0 858  0.35 0.70
> 9 1025.0 858  0.24 1.20
>
> Thanks for your help.
> thanks
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: can we visualize water flows with 3d in R?

Duncan Murdoch-2
In reply to this post by Marna Wagley
On 12/10/2016 4:49 AM, Marna Wagley wrote:

> Hi R Users,
> Is it possible to visualize river flow in  3D (latitude, longitude with
> respect to depth)?
> The example of my data looks like. Any suggestions?
>
>> dat1
>     long lat depth flow
> 1 1015.9 857  1.00 1.50
> 2 1015.9 857  1.25 1.23
> 3 1015.9 857  0.50 2.00
> 4 1015.9 858  0.10 1.95
> 5 1015.9 858  0.20 1.50
> 6 1025.0 858  0.30 1.20
> 7 1025.0 858  0.40 0.50
> 8 1025.0 858  0.35 0.70
> 9 1025.0 858  0.24 1.20
>
> Thanks for your help.

It may be, but it's hard to give a nice looking graphic of that small
dataset.  You could try the rgl package and use plot3d to show spheres
with radius depending on the flow rate, for example

plot3d(cbind(long, lat, depth), type="s", col="blue", radius=flow/5)

Duncan Murdoch

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: can we visualize water flows with 3d in R?

clark richards
In reply to this post by Marna Wagley
Hi Marna,

It's hard to tell exactly what you're looking for, since making "3D" plots
of fluid flow has significant interpretative challenges (e.g. how do you
see the flow for points that are "inside" the domain?). It is common in
fields like oceanography to plot 2D "sections" of the 3D flow -- e.g. a
latitude-depth plot at a range of different longitudes. Someone else
pointed out the `heatmap()` function, but I would also point out the
`imagep()` function in the `oce` package, which can make image plots (with
a palette, or colorbar).

Cheers,
Clark

On Wed, Oct 12, 2016 at 7:00 AM, <[hidden email]> wrote:

>
> Message: 18
> Date: Wed, 12 Oct 2016 01:49:28 -0700
> From: Marna Wagley <[hidden email]>
> To: r-help mailing list <[hidden email]>
> Subject: [R] can we visualize water flows with 3d in R?
> Message-ID:
>         <CAMwU6B30hE4z-bORjGBgcmZNZjc9_4Q8ZUgQNhZ3SFoTc+ss=Q@mail.
> gmail.com>
> Content-Type: text/plain; charset="UTF-8"
>
> Hi R Users,
> Is it possible to visualize river flow in  3D (latitude, longitude with
> respect to depth)?
> The example of my data looks like. Any suggestions?
>
> > dat1
>     long lat depth flow
> 1 1015.9 857  1.00 1.50
> 2 1015.9 857  1.25 1.23
> 3 1015.9 857  0.50 2.00
> 4 1015.9 858  0.10 1.95
> 5 1015.9 858  0.20 1.50
> 6 1025.0 858  0.30 1.20
> 7 1025.0 858  0.40 0.50
> 8 1025.0 858  0.35 0.70
> 9 1025.0 858  0.24 1.20
>
> Thanks for your help.
> thanks
>
>         [[alternative HTML version deleted]]
>
>
>
> ------------------------------
>
> Message: 19
> Date: Wed, 12 Oct 2016 20:49:27 +1100
> From: Jim Lemon <[hidden email]>
> To: Marna Wagley <[hidden email]>
> Cc: r-help mailing list <[hidden email]>
> Subject: Re: [R] can we visualize water flows with 3d in R?
> Message-ID:
>         <CA+8X3fVMGZcQZg60T6DizcVdHh-H7_nSX5orpC-W0tGc-osgTQ@mail.
> gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> Hi Marna,
> Isn't the conventional way to visualize depth as shades of blue?
>
> library(plotrix)
> depth.col<-color.scale(dat1$depth,extremes=c("lightblue",blue"))
>
> Then color the lon/lat rectangles with depth.col
>
> Jim
>
>
>
> On Wed, Oct 12, 2016 at 7:49 PM, Marna Wagley <[hidden email]>
> wrote:
> > Hi R Users,
> > Is it possible to visualize river flow in  3D (latitude, longitude with
> > respect to depth)?
> > The example of my data looks like. Any suggestions?
> >
> >> dat1
> >     long lat depth flow
> > 1 1015.9 857  1.00 1.50
> > 2 1015.9 857  1.25 1.23
> > 3 1015.9 857  0.50 2.00
> > 4 1015.9 858  0.10 1.95
> > 5 1015.9 858  0.20 1.50
> > 6 1025.0 858  0.30 1.20
> > 7 1025.0 858  0.40 0.50
> > 8 1025.0 858  0.35 0.70
> > 9 1025.0 858  0.24 1.20
> >
> > Thanks for your help.
> > thanks
> >
> >         [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
> ------------------------------
>
> End of R-help Digest, Vol 164, Issue 12
> ***************************************
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: can we visualize water flows with 3d in R?

David Winsemius
In reply to this post by Duncan Murdoch-2

> On Oct 12, 2016, at 4:28 AM, Duncan Murdoch <[hidden email]> wrote:
>
> On 12/10/2016 4:49 AM, Marna Wagley wrote:
>> Hi R Users,
>> Is it possible to visualize river flow in  3D (latitude, longitude with
>> respect to depth)?
>> The example of my data looks like. Any suggestions?
>>
>>> dat1
>>    long lat depth flow
>> 1 1015.9 857  1.00 1.50
>> 2 1015.9 857  1.25 1.23
>> 3 1015.9 857  0.50 2.00
>> 4 1015.9 858  0.10 1.95
>> 5 1015.9 858  0.20 1.50
>> 6 1025.0 858  0.30 1.20
>> 7 1025.0 858  0.40 0.50
>> 8 1025.0 858  0.35 0.70
>> 9 1025.0 858  0.24 1.20
>>
>> Thanks for your help.
>
> It may be, but it's hard to give a nice looking graphic of that small dataset.  You could try the rgl package and use plot3d to show spheres with radius depending on the flow rate, for example
>
> plot3d(cbind(long, lat, depth), type="s", col="blue", radius=flow/5)

A complementary option is to install the plot3D package which I see also has a plot3Drgl "co-package". The advantage to this option is the association with beautiful modeling packages that Karline Soetaert, Peter M. J. Herman, and Thomas Petzoldt have been offering to ecologists for the last decade. (Packages: deSolve, marelac, seacarb, AquaEnv) A lot of her work has been on flows within systems.

I usually think of "flows" in rivers as being vector fields in an incompressible fluid (water) with 6 components per point, but you can also think of them as being scalar state variables. So I suppose you could be modeling something other than mass flows.  (See Package::ReacTran for the R portal to that mathematical world.)

Best;
David Winsemius


>
> Duncan Murdoch
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius
Alameda, CA, USA

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: can we visualize water flows with 3d in R?

Duncan Mackay-4
In reply to this post by Marna Wagley
Hi

With a small data set 3D is not really an option;  reduce the number of
dimensions-- 2D conditional

library(lattice)
xyplot(flow ~ depth|factor(long), dat1, groups = lat, type = c("p","r"), pch
= 16)

I had started with lat and long reversed doing EDA gave the above
? latitude effect

Regards

Duncan


Duncan Mackay
Department of Agronomy and Soil Science
University of New England
Armidale NSW 2351
Email: home: [hidden email]

-----Original Message-----
From: R-help [mailto:[hidden email]] On Behalf Of Marna Wagley
Sent: Wednesday, 12 October 2016 19:49
To: r-help mailing list
Subject: [R] can we visualize water flows with 3d in R?

Hi R Users,
Is it possible to visualize river flow in  3D (latitude, longitude with
respect to depth)?
The example of my data looks like. Any suggestions?

> dat1
    long lat depth flow
1 1015.9 857  1.00 1.50
2 1015.9 857  1.25 1.23
3 1015.9 857  0.50 2.00
4 1015.9 858  0.10 1.95
5 1015.9 858  0.20 1.50
6 1025.0 858  0.30 1.20
7 1025.0 858  0.40 0.50
8 1025.0 858  0.35 0.70
9 1025.0 858  0.24 1.20

Thanks for your help.
thanks

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: can we visualize water flows with 3d in R?

Thomas Adams-2
In reply to this post by David Winsemius
All,

Very respectfully, there are no R packages that can do what Marna desires.
His/Her data, undoubtably, comes from a 1-D hydraulic model simulation --
where output is generated at channel cross-sections -- representing the
sloping water surface elevation of the centerline of flow in a stream or
river. With mapping software for such problems, the assumption is made that
the water surface intersects the topography (within or beyond the stream
channel) perpendicular to the direction of flow. Hydrodynamically, this is
generally not correct, but it's a reasonable approximation. To do this,
typically, the topography -- in the from of a raster digital elevation
model (DEM) -- is converted to a triangular irregular network (TIN) to
facilitate the creation of a smoother line of intersection between the
water surface and topography. Because, the water surface slopes in a
downstream direction, contour lines are crossed. Hydraulic modeling
software usually is accompanied by this mapping capability, such as with
HEC-RAS with RAS-Mapper, developed by the US Army Corps of Engineers, or
with HEC-GeoRAS, which requires ESRI ARC GIS; but, there is also a QGIS
plugin module that can do this, I believe. These software packages do
facilitate representing the flow in 3D.

Tom


On Wed, Oct 12, 2016 at 6:12 PM, David Winsemius <[hidden email]>
wrote:

>
> > On Oct 12, 2016, at 4:28 AM, Duncan Murdoch <[hidden email]>
> wrote:
> >
> > On 12/10/2016 4:49 AM, Marna Wagley wrote:
> >> Hi R Users,
> >> Is it possible to visualize river flow in  3D (latitude, longitude with
> >> respect to depth)?
> >> The example of my data looks like. Any suggestions?
> >>
> >>> dat1
> >>    long lat depth flow
> >> 1 1015.9 857  1.00 1.50
> >> 2 1015.9 857  1.25 1.23
> >> 3 1015.9 857  0.50 2.00
> >> 4 1015.9 858  0.10 1.95
> >> 5 1015.9 858  0.20 1.50
> >> 6 1025.0 858  0.30 1.20
> >> 7 1025.0 858  0.40 0.50
> >> 8 1025.0 858  0.35 0.70
> >> 9 1025.0 858  0.24 1.20
> >>
> >> Thanks for your help.
> >
> > It may be, but it's hard to give a nice looking graphic of that small
> dataset.  You could try the rgl package and use plot3d to show spheres with
> radius depending on the flow rate, for example
> >
> > plot3d(cbind(long, lat, depth), type="s", col="blue", radius=flow/5)
>
> A complementary option is to install the plot3D package which I see also
> has a plot3Drgl "co-package". The advantage to this option is the
> association with beautiful modeling packages that Karline Soetaert, Peter
> M. J. Herman, and Thomas Petzoldt have been offering to ecologists for the
> last decade. (Packages: deSolve, marelac, seacarb, AquaEnv) A lot of her
> work has been on flows within systems.
>
> I usually think of "flows" in rivers as being vector fields in an
> incompressible fluid (water) with 6 components per point, but you can also
> think of them as being scalar state variables. So I suppose you could be
> modeling something other than mass flows.  (See Package::ReacTran for the R
> portal to that mathematical world.)
>
> Best;
> David Winsemius
>
>
> >
> > Duncan Murdoch
> >
> > ______________________________________________
> > [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
>
> David Winsemius
> Alameda, CA, USA
>
> ______________________________________________
> [hidden email] mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/
> posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: can we visualize water flows with 3d in R?

Duncan Murdoch-2
On 13/10/2016 8:35 AM, Thomas Adams wrote:
> All,
>
> Very respectfully, there are no R packages that can do what Marna desires.

I would guess that's not literally true, in that there are several
graphics packages that are very flexible.   You could well be right that
there are none that are designed specifically for this purpose, so she's
probably going to have to do some work to get what she wants.

> His/Her data, undoubtably, comes from a 1-D hydraulic model simulation
> -- where output is generated at channel cross-sections -- representing
> the sloping water surface elevation of the centerline of flow in a
> stream or river. With mapping software for such problems, the
> assumption is made that the water surface intersects the topography
> (within or beyond the stream channel) perpendicular to the direction
> of flow. Hydrodynamically, this is generally not correct, but it's a
> reasonable approximation. To do this, typically, the topography -- in
> the from of a raster digital elevation model (DEM) -- is converted to
> a triangular irregular network (TIN) to facilitate the creation of a
> smoother line of intersection between the water surface and
> topography. Because, the water surface slopes in a downstream
> direction, contour lines are crossed. Hydraulic modeling software
> usually is accompanied by this mapping capability, such as with
> HEC-RAS with RAS-Mapper, developed by the US Army Corps of Engineers,
> or with HEC-GeoRAS, which requires ESRI ARC GIS; but, there is also a
> QGIS plugin module that can do this, I believe. These software
> packages do facilitate representing the flow in 3D.

Do you know any sample figures online that would show the type of graph
that is usually used here?

Duncan Murdoch

>
> Tom
>
>
> On Wed, Oct 12, 2016 at 6:12 PM, David Winsemius
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>
>     > On Oct 12, 2016, at 4:28 AM, Duncan Murdoch
>     <[hidden email] <mailto:[hidden email]>> wrote:
>     >
>     > On 12/10/2016 4:49 AM, Marna Wagley wrote:
>     >> Hi R Users,
>     >> Is it possible to visualize river flow in 3D (latitude,
>     longitude with
>     >> respect to depth)?
>     >> The example of my data looks like. Any suggestions?
>     >>
>     >>> dat1
>     >>    long lat depth flow
>     >> 1 1015.9 857  1.00 1.50
>     >> 2 1015.9 857  1.25 1.23
>     >> 3 1015.9 857  0.50 2.00
>     >> 4 1015.9 858  0.10 1.95
>     >> 5 1015.9 858  0.20 1.50
>     >> 6 1025.0 858  0.30 1.20
>     >> 7 1025.0 858  0.40 0.50
>     >> 8 1025.0 858  0.35 0.70
>     >> 9 1025.0 858  0.24 1.20
>     >>
>     >> Thanks for your help.
>     >
>     > It may be, but it's hard to give a nice looking graphic of that
>     small dataset.  You could try the rgl package and use plot3d to
>     show spheres with radius depending on the flow rate, for example
>     >
>     > plot3d(cbind(long, lat, depth), type="s", col="blue", radius=flow/5)
>
>     A complementary option is to install the plot3D package which I
>     see also has a plot3Drgl "co-package". The advantage to this
>     option is the association with beautiful modeling packages that
>     Karline Soetaert, Peter M. J. Herman, and Thomas Petzoldt have
>     been offering to ecologists for the last decade. (Packages:
>     deSolve, marelac, seacarb, AquaEnv) A lot of her work has been on
>     flows within systems.
>
>     I usually think of "flows" in rivers as being vector fields in an
>     incompressible fluid (water) with 6 components per point, but you
>     can also think of them as being scalar state variables. So I
>     suppose you could be modeling something other than mass flows.
>     (See Package::ReacTran for the R portal to that mathematical world.)
>
>     Best;
>     David Winsemius
>
>
>     >
>     > Duncan Murdoch
>     >
>     > ______________________________________________
>     > [hidden email] <mailto:[hidden email]> mailing list
>     -- To UNSUBSCRIBE and more, see
>     > https://stat.ethz.ch/mailman/listinfo/r-help
>     <https://stat.ethz.ch/mailman/listinfo/r-help>
>     > PLEASE do read the posting guide
>     http://www.R-project.org/posting-guide.html
>     <http://www.R-project.org/posting-guide.html>
>     > and provide commented, minimal, self-contained, reproducible code.
>
>     David Winsemius
>     Alameda, CA, USA
>
>     ______________________________________________
>     [hidden email] <mailto:[hidden email]> mailing list --
>     To UNSUBSCRIBE and more, see
>     https://stat.ethz.ch/mailman/listinfo/r-help
>     <https://stat.ethz.ch/mailman/listinfo/r-help>
>     PLEASE do read the posting guide
>     http://www.R-project.org/posting-guide.html
>     <http://www.R-project.org/posting-guide.html>
>     and provide commented, minimal, self-contained, reproducible code.
>
>
>
>
>

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: can we visualize water flows with 3d in R?

Karline Soetaert
... and maybe she can find some inspiration at this website:
http://www.rforscience.com/rpackages/visualisation/oceanview/


Karline

-----Original Message-----
From: Duncan Murdoch [mailto:[hidden email]]
Sent: donderdag 13 oktober 2016 15:20
To: Thomas Adams <[hidden email]>; David Winsemius <[hidden email]>
Cc: r-help mailing list <[hidden email]>; Karline Soetaert <[hidden email]>
Subject: Re: [R] can we visualize water flows with 3d in R?

On 13/10/2016 8:35 AM, Thomas Adams wrote:
> All,
>
> Very respectfully, there are no R packages that can do what Marna desires.

I would guess that's not literally true, in that there are several
graphics packages that are very flexible.   You could well be right that
there are none that are designed specifically for this purpose, so she's probably going to have to do some work to get what she wants.

> His/Her data, undoubtably, comes from a 1-D hydraulic model simulation
> -- where output is generated at channel cross-sections -- representing
> the sloping water surface elevation of the centerline of flow in a
> stream or river. With mapping software for such problems, the
> assumption is made that the water surface intersects the topography
> (within or beyond the stream channel) perpendicular to the direction
> of flow. Hydrodynamically, this is generally not correct, but it's a
> reasonable approximation. To do this, typically, the topography -- in
> the from of a raster digital elevation model (DEM) -- is converted to
> a triangular irregular network (TIN) to facilitate the creation of a
> smoother line of intersection between the water surface and
> topography. Because, the water surface slopes in a downstream
> direction, contour lines are crossed. Hydraulic modeling software
> usually is accompanied by this mapping capability, such as with
> HEC-RAS with RAS-Mapper, developed by the US Army Corps of Engineers,
> or with HEC-GeoRAS, which requires ESRI ARC GIS; but, there is also a
> QGIS plugin module that can do this, I believe. These software
> packages do facilitate representing the flow in 3D.

Do you know any sample figures online that would show the type of graph that is usually used here?

Duncan Murdoch

>
> Tom
>
>
> On Wed, Oct 12, 2016 at 6:12 PM, David Winsemius
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>
>     > On Oct 12, 2016, at 4:28 AM, Duncan Murdoch
>     <[hidden email] <mailto:[hidden email]>> wrote:
>     >
>     > On 12/10/2016 4:49 AM, Marna Wagley wrote:
>     >> Hi R Users,
>     >> Is it possible to visualize river flow in 3D (latitude,
>     longitude with
>     >> respect to depth)?
>     >> The example of my data looks like. Any suggestions?
>     >>
>     >>> dat1
>     >>    long lat depth flow
>     >> 1 1015.9 857  1.00 1.50
>     >> 2 1015.9 857  1.25 1.23
>     >> 3 1015.9 857  0.50 2.00
>     >> 4 1015.9 858  0.10 1.95
>     >> 5 1015.9 858  0.20 1.50
>     >> 6 1025.0 858  0.30 1.20
>     >> 7 1025.0 858  0.40 0.50
>     >> 8 1025.0 858  0.35 0.70
>     >> 9 1025.0 858  0.24 1.20
>     >>
>     >> Thanks for your help.
>     >
>     > It may be, but it's hard to give a nice looking graphic of that
>     small dataset.  You could try the rgl package and use plot3d to
>     show spheres with radius depending on the flow rate, for example
>     >
>     > plot3d(cbind(long, lat, depth), type="s", col="blue",
> radius=flow/5)
>
>     A complementary option is to install the plot3D package which I
>     see also has a plot3Drgl "co-package". The advantage to this
>     option is the association with beautiful modeling packages that
>     Karline Soetaert, Peter M. J. Herman, and Thomas Petzoldt have
>     been offering to ecologists for the last decade. (Packages:
>     deSolve, marelac, seacarb, AquaEnv) A lot of her work has been on
>     flows within systems.
>
>     I usually think of "flows" in rivers as being vector fields in an
>     incompressible fluid (water) with 6 components per point, but you
>     can also think of them as being scalar state variables. So I
>     suppose you could be modeling something other than mass flows.
>     (See Package::ReacTran for the R portal to that mathematical
> world.)
>
>     Best;
>     David Winsemius
>
>
>     >
>     > Duncan Murdoch
>     >
>     > ______________________________________________
>     > [hidden email] <mailto:[hidden email]> mailing list
>     -- To UNSUBSCRIBE and more, see
>     > https://stat.ethz.ch/mailman/listinfo/r-help
>     <https://stat.ethz.ch/mailman/listinfo/r-help>
>     > PLEASE do read the posting guide
>     http://www.R-project.org/posting-guide.html
>     <http://www.R-project.org/posting-guide.html>
>     > and provide commented, minimal, self-contained, reproducible code.
>
>     David Winsemius
>     Alameda, CA, USA
>
>     ______________________________________________
>     [hidden email] <mailto:[hidden email]> mailing list --
>     To UNSUBSCRIBE and more, see
>     https://stat.ethz.ch/mailman/listinfo/r-help
>     <https://stat.ethz.ch/mailman/listinfo/r-help>
>     PLEASE do read the posting guide
>     http://www.R-project.org/posting-guide.html
>     <http://www.R-project.org/posting-guide.html>
>     and provide commented, minimal, self-contained, reproducible code.
>
>
>
>
>

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: can we visualize water flows with 3d in R?

Thomas Adams-2
In reply to this post by Duncan Murdoch-2
Duncan,

Oh, to be sure, with a fair amount of work, you're probably correct that
one could mash up something. Here are some examples:

http://www.illinoisfloods.org/documents/2013_IAFSM_Conference/Conference_Presentations/5C-1_HEC-GeoRAS_Part1.pdf
<--- lots of graphics

http://rivergis.com/

also...
http://www2.egr.uh.edu/~aleon3/courses/Transient_flows/Tutorials/Geo_RAS/georastutorial.pdf
-- pages 35->
https://www.crwr.utexas.edu/reports/pdf/1999/rpt99-1.pdf -- pages 70->
(figures 4-17, 4-18), p. 147

Best,
Tom

On Thu, Oct 13, 2016 at 9:20 AM, Duncan Murdoch <[hidden email]>
wrote:

> On 13/10/2016 8:35 AM, Thomas Adams wrote:
>
>> All,
>>
>> Very respectfully, there are no R packages that can do what Marna desires.
>>
>
> I would guess that's not literally true, in that there are several
> graphics packages that are very flexible.   You could well be right that
> there are none that are designed specifically for this purpose, so she's
> probably going to have to do some work to get what she wants.
>
> His/Her data, undoubtably, comes from a 1-D hydraulic model simulation --
>> where output is generated at channel cross-sections -- representing the
>> sloping water surface elevation of the centerline of flow in a stream or
>> river. With mapping software for such problems, the assumption is made that
>> the water surface intersects the topography (within or beyond the stream
>> channel) perpendicular to the direction of flow. Hydrodynamically, this is
>> generally not correct, but it's a reasonable approximation. To do this,
>> typically, the topography -- in the from of a raster digital elevation
>> model (DEM) -- is converted to a triangular irregular network (TIN) to
>> facilitate the creation of a smoother line of intersection between the
>> water surface and topography. Because, the water surface slopes in a
>> downstream direction, contour lines are crossed. Hydraulic modeling
>> software usually is accompanied by this mapping capability, such as with
>> HEC-RAS with RAS-Mapper, developed by the US Army Corps of Engineers, or
>> with HEC-GeoRAS, which requires ESRI ARC GIS; but, there is also a QGIS
>> plugin module that can do this, I believe. These software packages do
>> facilitate representing the flow in 3D.
>>
>
> Do you know any sample figures online that would show the type of graph
> that is usually used here?
>
> Duncan Murdoch
>
>>
>> Tom
>>
>>
>> On Wed, Oct 12, 2016 at 6:12 PM, David Winsemius <[hidden email]
>> <mailto:[hidden email]>> wrote:
>>
>>
>>     > On Oct 12, 2016, at 4:28 AM, Duncan Murdoch
>>     <[hidden email] <mailto:[hidden email]>> wrote:
>>     >
>>     > On 12/10/2016 4:49 AM, Marna Wagley wrote:
>>     >> Hi R Users,
>>     >> Is it possible to visualize river flow in 3D (latitude,
>>     longitude with
>>     >> respect to depth)?
>>     >> The example of my data looks like. Any suggestions?
>>     >>
>>     >>> dat1
>>     >>    long lat depth flow
>>     >> 1 1015.9 857  1.00 1.50
>>     >> 2 1015.9 857  1.25 1.23
>>     >> 3 1015.9 857  0.50 2.00
>>     >> 4 1015.9 858  0.10 1.95
>>     >> 5 1015.9 858  0.20 1.50
>>     >> 6 1025.0 858  0.30 1.20
>>     >> 7 1025.0 858  0.40 0.50
>>     >> 8 1025.0 858  0.35 0.70
>>     >> 9 1025.0 858  0.24 1.20
>>     >>
>>     >> Thanks for your help.
>>     >
>>     > It may be, but it's hard to give a nice looking graphic of that
>>     small dataset.  You could try the rgl package and use plot3d to
>>     show spheres with radius depending on the flow rate, for example
>>     >
>>     > plot3d(cbind(long, lat, depth), type="s", col="blue", radius=flow/5)
>>
>>     A complementary option is to install the plot3D package which I
>>     see also has a plot3Drgl "co-package". The advantage to this
>>     option is the association with beautiful modeling packages that
>>     Karline Soetaert, Peter M. J. Herman, and Thomas Petzoldt have
>>     been offering to ecologists for the last decade. (Packages:
>>     deSolve, marelac, seacarb, AquaEnv) A lot of her work has been on
>>     flows within systems.
>>
>>     I usually think of "flows" in rivers as being vector fields in an
>>     incompressible fluid (water) with 6 components per point, but you
>>     can also think of them as being scalar state variables. So I
>>     suppose you could be modeling something other than mass flows.
>>     (See Package::ReacTran for the R portal to that mathematical world.)
>>
>>     Best;
>>     David Winsemius
>>
>>
>>     >
>>     > Duncan Murdoch
>>     >
>>     > ______________________________________________
>>     > [hidden email] <mailto:[hidden email]> mailing list
>>     -- To UNSUBSCRIBE and more, see
>>     > https://stat.ethz.ch/mailman/listinfo/r-help
>>     <https://stat.ethz.ch/mailman/listinfo/r-help>
>>     > PLEASE do read the posting guide
>>     http://www.R-project.org/posting-guide.html
>>     <http://www.R-project.org/posting-guide.html>
>>     > and provide commented, minimal, self-contained, reproducible code.
>>
>>     David Winsemius
>>     Alameda, CA, USA
>>
>>     ______________________________________________
>>     [hidden email] <mailto:[hidden email]> mailing list --
>>     To UNSUBSCRIBE and more, see
>>     https://stat.ethz.ch/mailman/listinfo/r-help
>>     <https://stat.ethz.ch/mailman/listinfo/r-help>
>>     PLEASE do read the posting guide
>>     http://www.R-project.org/posting-guide.html
>>     <http://www.R-project.org/posting-guide.html>
>>     and provide commented, minimal, self-contained, reproducible code.
>>
>>
>>
>>
>>
>>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: can we visualize water flows with 3d in R?

Duncan Murdoch-2
On 13/10/2016 11:14 AM, Thomas Adams wrote:

> Duncan,
>
> Oh, to be sure, with a fair amount of work, you're probably correct that
> one could mash up something. Here are some examples:
>
> http://www.illinoisfloods.org/documents/2013_IAFSM_Conference/Conference_Presentations/5C-1_HEC-GeoRAS_Part1.pdf
> <--- lots of graphics
>
> http://rivergis.com/
>
> also...
> http://www2.egr.uh.edu/~aleon3/courses/Transient_flows/Tutorials/Geo_RAS/georastutorial.pdf
> -- pages 35->
> https://www.crwr.utexas.edu/reports/pdf/1999/rpt99-1.pdf -- pages 70->
> (figures 4-17, 4-18), p. 147

Thanks.  I guess it's up to Marna to say whether any of those figures
are like what she wants to produce from her data.

Duncan Murdoch

>
> Best,
> Tom
>
> On Thu, Oct 13, 2016 at 9:20 AM, Duncan Murdoch
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>     On 13/10/2016 8:35 AM, Thomas Adams wrote:
>
>         All,
>
>         Very respectfully, there are no R packages that can do what
>         Marna desires.
>
>
>     I would guess that's not literally true, in that there are several
>     graphics packages that are very flexible.   You could well be right
>     that there are none that are designed specifically for this purpose,
>     so she's probably going to have to do some work to get what she wants.
>
>         His/Her data, undoubtably, comes from a 1-D hydraulic model
>         simulation -- where output is generated at channel
>         cross-sections -- representing the sloping water surface
>         elevation of the centerline of flow in a stream or river. With
>         mapping software for such problems, the assumption is made that
>         the water surface intersects the topography (within or beyond
>         the stream channel) perpendicular to the direction of flow.
>         Hydrodynamically, this is generally not correct, but it's a
>         reasonable approximation. To do this, typically, the topography
>         -- in the from of a raster digital elevation model (DEM) -- is
>         converted to a triangular irregular network (TIN) to facilitate
>         the creation of a smoother line of intersection between the
>         water surface and topography. Because, the water surface slopes
>         in a downstream direction, contour lines are crossed. Hydraulic
>         modeling software usually is accompanied by this mapping
>         capability, such as with HEC-RAS with RAS-Mapper, developed by
>         the US Army Corps of Engineers, or with HEC-GeoRAS, which
>         requires ESRI ARC GIS; but, there is also a QGIS plugin module
>         that can do this, I believe. These software packages do
>         facilitate representing the flow in 3D.
>
>
>     Do you know any sample figures online that would show the type of
>     graph that is usually used here?
>
>     Duncan Murdoch
>
>
>         Tom
>
>
>         On Wed, Oct 12, 2016 at 6:12 PM, David Winsemius
>         <[hidden email] <mailto:[hidden email]>
>         <mailto:[hidden email] <mailto:[hidden email]>>>
>         wrote:
>
>
>             > On Oct 12, 2016, at 4:28 AM, Duncan Murdoch
>             <[hidden email] <mailto:[hidden email]>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>>> wrote:
>             >
>             > On 12/10/2016 4:49 AM, Marna Wagley wrote:
>             >> Hi R Users,
>             >> Is it possible to visualize river flow in 3D (latitude,
>             longitude with
>             >> respect to depth)?
>             >> The example of my data looks like. Any suggestions?
>             >>
>             >>> dat1
>             >>    long lat depth flow
>             >> 1 1015.9 857  1.00 1.50
>             >> 2 1015.9 857  1.25 1.23
>             >> 3 1015.9 857  0.50 2.00
>             >> 4 1015.9 858  0.10 1.95
>             >> 5 1015.9 858  0.20 1.50
>             >> 6 1025.0 858  0.30 1.20
>             >> 7 1025.0 858  0.40 0.50
>             >> 8 1025.0 858  0.35 0.70
>             >> 9 1025.0 858  0.24 1.20
>             >>
>             >> Thanks for your help.
>             >
>             > It may be, but it's hard to give a nice looking graphic of
>         that
>             small dataset.  You could try the rgl package and use plot3d to
>             show spheres with radius depending on the flow rate, for example
>             >
>             > plot3d(cbind(long, lat, depth), type="s", col="blue",
>         radius=flow/5)
>
>             A complementary option is to install the plot3D package which I
>             see also has a plot3Drgl "co-package". The advantage to this
>             option is the association with beautiful modeling packages that
>             Karline Soetaert, Peter M. J. Herman, and Thomas Petzoldt have
>             been offering to ecologists for the last decade. (Packages:
>             deSolve, marelac, seacarb, AquaEnv) A lot of her work has
>         been on
>             flows within systems.
>
>             I usually think of "flows" in rivers as being vector fields
>         in an
>             incompressible fluid (water) with 6 components per point,
>         but you
>             can also think of them as being scalar state variables. So I
>             suppose you could be modeling something other than mass flows.
>             (See Package::ReacTran for the R portal to that mathematical
>         world.)
>
>             Best;
>             David Winsemius
>
>
>             >
>             > Duncan Murdoch
>             >
>             > ______________________________________________
>             > [hidden email] <mailto:[hidden email]>
>         <mailto:[hidden email] <mailto:[hidden email]>>
>         mailing list
>             -- To UNSUBSCRIBE and more, see
>             > https://stat.ethz.ch/mailman/listinfo/r-help
>         <https://stat.ethz.ch/mailman/listinfo/r-help>
>             <https://stat.ethz.ch/mailman/listinfo/r-help
>         <https://stat.ethz.ch/mailman/listinfo/r-help>>
>             > PLEASE do read the posting guide
>             http://www.R-project.org/posting-guide.html
>         <http://www.R-project.org/posting-guide.html>
>             <http://www.R-project.org/posting-guide.html
>         <http://www.R-project.org/posting-guide.html>>
>             > and provide commented, minimal, self-contained,
>         reproducible code.
>
>             David Winsemius
>             Alameda, CA, USA
>
>             ______________________________________________
>             [hidden email] <mailto:[hidden email]>
>         <mailto:[hidden email] <mailto:[hidden email]>>
>         mailing list --
>             To UNSUBSCRIBE and more, see
>             https://stat.ethz.ch/mailman/listinfo/r-help
>         <https://stat.ethz.ch/mailman/listinfo/r-help>
>             <https://stat.ethz.ch/mailman/listinfo/r-help
>         <https://stat.ethz.ch/mailman/listinfo/r-help>>
>             PLEASE do read the posting guide
>             http://www.R-project.org/posting-guide.html
>         <http://www.R-project.org/posting-guide.html>
>             <http://www.R-project.org/posting-guide.html
>         <http://www.R-project.org/posting-guide.html>>
>             and provide commented, minimal, self-contained, reproducible
>         code.
>
>
>
>
>
>
>
>

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: can we visualize water flows with 3d in R?

Hutchinson, David (EC)
Karline,

You may want to explore Green Kenue (http://www.nrc-cnrc.gc.ca/eng/solutions/advisory/green_kenue_index.html). It is freely available (download through an email request) and supports 3D data visualization and I believe it now has a python API to allow some automation.
 
Unfortunately it is only supported for Windows-based OS.

Dave

-----Original Message-----
From: R-help [mailto:[hidden email]] On Behalf Of Duncan Murdoch
Sent: October 13, 2016 2:11 PM
To: Thomas Adams
Cc: r-help mailing list; Karline Soetaert
Subject: Re: [R] can we visualize water flows with 3d in R?

On 13/10/2016 11:14 AM, Thomas Adams wrote:

> Duncan,
>
> Oh, to be sure, with a fair amount of work, you're probably correct
> that one could mash up something. Here are some examples:
>
> http://www.illinoisfloods.org/documents/2013_IAFSM_Conference/Conferen
> ce_Presentations/5C-1_HEC-GeoRAS_Part1.pdf
> <--- lots of graphics
>
> http://rivergis.com/
>
> also...
> http://www2.egr.uh.edu/~aleon3/courses/Transient_flows/Tutorials/Geo_R
> AS/georastutorial.pdf
> -- pages 35->
> https://www.crwr.utexas.edu/reports/pdf/1999/rpt99-1.pdf -- pages 70->
> (figures 4-17, 4-18), p. 147

Thanks.  I guess it's up to Marna to say whether any of those figures are like what she wants to produce from her data.

Duncan Murdoch

>
> Best,
> Tom
>
> On Thu, Oct 13, 2016 at 9:20 AM, Duncan Murdoch
> <[hidden email] <mailto:[hidden email]>> wrote:
>
>     On 13/10/2016 8:35 AM, Thomas Adams wrote:
>
>         All,
>
>         Very respectfully, there are no R packages that can do what
>         Marna desires.
>
>
>     I would guess that's not literally true, in that there are several
>     graphics packages that are very flexible.   You could well be right
>     that there are none that are designed specifically for this purpose,
>     so she's probably going to have to do some work to get what she wants.
>
>         His/Her data, undoubtably, comes from a 1-D hydraulic model
>         simulation -- where output is generated at channel
>         cross-sections -- representing the sloping water surface
>         elevation of the centerline of flow in a stream or river. With
>         mapping software for such problems, the assumption is made that
>         the water surface intersects the topography (within or beyond
>         the stream channel) perpendicular to the direction of flow.
>         Hydrodynamically, this is generally not correct, but it's a
>         reasonable approximation. To do this, typically, the topography
>         -- in the from of a raster digital elevation model (DEM) -- is
>         converted to a triangular irregular network (TIN) to facilitate
>         the creation of a smoother line of intersection between the
>         water surface and topography. Because, the water surface slopes
>         in a downstream direction, contour lines are crossed. Hydraulic
>         modeling software usually is accompanied by this mapping
>         capability, such as with HEC-RAS with RAS-Mapper, developed by
>         the US Army Corps of Engineers, or with HEC-GeoRAS, which
>         requires ESRI ARC GIS; but, there is also a QGIS plugin module
>         that can do this, I believe. These software packages do
>         facilitate representing the flow in 3D.
>
>
>     Do you know any sample figures online that would show the type of
>     graph that is usually used here?
>
>     Duncan Murdoch
>
>
>         Tom
>
>
>         On Wed, Oct 12, 2016 at 6:12 PM, David Winsemius
>         <[hidden email] <mailto:[hidden email]>
>         <mailto:[hidden email] <mailto:[hidden email]>>>
>         wrote:
>
>
>             > On Oct 12, 2016, at 4:28 AM, Duncan Murdoch
>             <[hidden email] <mailto:[hidden email]>
>         <mailto:[hidden email]
>         <mailto:[hidden email]>>> wrote:
>             >
>             > On 12/10/2016 4:49 AM, Marna Wagley wrote:
>             >> Hi R Users,
>             >> Is it possible to visualize river flow in 3D (latitude,
>             longitude with
>             >> respect to depth)?
>             >> The example of my data looks like. Any suggestions?
>             >>
>             >>> dat1
>             >>    long lat depth flow
>             >> 1 1015.9 857  1.00 1.50
>             >> 2 1015.9 857  1.25 1.23
>             >> 3 1015.9 857  0.50 2.00
>             >> 4 1015.9 858  0.10 1.95
>             >> 5 1015.9 858  0.20 1.50
>             >> 6 1025.0 858  0.30 1.20
>             >> 7 1025.0 858  0.40 0.50
>             >> 8 1025.0 858  0.35 0.70
>             >> 9 1025.0 858  0.24 1.20
>             >>
>             >> Thanks for your help.
>             >
>             > It may be, but it's hard to give a nice looking graphic of
>         that
>             small dataset.  You could try the rgl package and use plot3d to
>             show spheres with radius depending on the flow rate, for example
>             >
>             > plot3d(cbind(long, lat, depth), type="s", col="blue",
>         radius=flow/5)
>
>             A complementary option is to install the plot3D package which I
>             see also has a plot3Drgl "co-package". The advantage to this
>             option is the association with beautiful modeling packages that
>             Karline Soetaert, Peter M. J. Herman, and Thomas Petzoldt have
>             been offering to ecologists for the last decade. (Packages:
>             deSolve, marelac, seacarb, AquaEnv) A lot of her work has
>         been on
>             flows within systems.
>
>             I usually think of "flows" in rivers as being vector fields
>         in an
>             incompressible fluid (water) with 6 components per point,
>         but you
>             can also think of them as being scalar state variables. So I
>             suppose you could be modeling something other than mass flows.
>             (See Package::ReacTran for the R portal to that mathematical
>         world.)
>
>             Best;
>             David Winsemius
>
>
>             >
>             > Duncan Murdoch
>             >
>             > ______________________________________________
>             > [hidden email] <mailto:[hidden email]>
>         <mailto:[hidden email] <mailto:[hidden email]>>
>         mailing list
>             -- To UNSUBSCRIBE and more, see
>             > https://stat.ethz.ch/mailman/listinfo/r-help
>         <https://stat.ethz.ch/mailman/listinfo/r-help>
>             <https://stat.ethz.ch/mailman/listinfo/r-help
>         <https://stat.ethz.ch/mailman/listinfo/r-help>>
>             > PLEASE do read the posting guide
>             http://www.R-project.org/posting-guide.html
>         <http://www.R-project.org/posting-guide.html>
>             <http://www.R-project.org/posting-guide.html
>         <http://www.R-project.org/posting-guide.html>>
>             > and provide commented, minimal, self-contained,
>         reproducible code.
>
>             David Winsemius
>             Alameda, CA, USA
>
>             ______________________________________________
>             [hidden email] <mailto:[hidden email]>
>         <mailto:[hidden email] <mailto:[hidden email]>>
>         mailing list --
>             To UNSUBSCRIBE and more, see
>             https://stat.ethz.ch/mailman/listinfo/r-help
>         <https://stat.ethz.ch/mailman/listinfo/r-help>
>             <https://stat.ethz.ch/mailman/listinfo/r-help
>         <https://stat.ethz.ch/mailman/listinfo/r-help>>
>             PLEASE do read the posting guide
>             http://www.R-project.org/posting-guide.html
>         <http://www.R-project.org/posting-guide.html>
>             <http://www.R-project.org/posting-guide.html
>         <http://www.R-project.org/posting-guide.html>>
>             and provide commented, minimal, self-contained, reproducible
>         code.
>
>
>
>
>
>
>
>

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: can we visualize water flows with 3d in R?

Duncan Mackay-4
In reply to this post by Duncan Mackay-4
Hi Marna

 

These are a few suggestions for EDA of your data

 

Firstly check it – it is laborious work but it needs to be done – use a proper database if R is not suitable (memory,time)

 

dat <- read.csv("G:/1/example_subsetdata.csv")

dat <- subset(dat, !is.na(depth))

 

apply(dat,2,range,na.rm=T)

table(cut(dat$depth, breaks = seq(496.5, 498.5, 0.25), include.lowest = TRUE, labels = F)) # needs more groups to even out numbers

# use hand drafted breaks

table(dat$Y)

 

dat$ldepth <- cut(dat$depth, breaks = seq(496.5, 498.5, 0.25), include.lowest = TRUE, labels = F)

xyplot(Y ~ X|factor(ldepth), subset(dat, Y > 400), pch = ".", as.table = TRUE)

xyplot(flow ~ X|factor(ldepth), subset(dat, Y > 400), pch = ".", as.table = TRUE, col =1)

xyplot(flow ~ Y|factor(ldepth), subset(dat, Y > 400), pch = ".", as.table = TRUE, col =1)

 

I have made pch = ‘.’ so that  points are not overtopping. increase by by units ie cex = 2 , cex =3 if you want to make them larger

 

Have a look a lattice::par.settings  and names(trellis.par.get()) these will make things easier if you you are using panel functions.

 

I did not go further but the next step in this would be lattice 3d plots contourplot wireframe etc.
You will get more information in working with the full dataset
 
I have not really gone into spatials  but you should look at the task view on spatial analysis.
and the spatial SIG
 
How you proceed will be partly determined by your future requirements of which I am not qualified.
 
Regards
 
Duncan

 

 

 

From: Marna Wagley [mailto:[hidden email]]
Sent: Friday, 14 October 2016 03:13
To: Duncan Mackay
Subject: Re: [R] can we visualize water flows with 3d in R?

 

Hi Duncan,

Thank you very much for the message. Indeed I do have a very big data set with a grid size of 10cm * 10 cm. Every 10 cm*10cm grid has the value of X,Y, depth and flow measurement. I have attached a subset of the data.

Thanks

 

 

On Wed, Oct 12, 2016 at 11:05 PM, Duncan Mackay <[hidden email]> wrote:

Hi

With a small data set 3D is not really an option;  reduce the number of
dimensions-- 2D conditional

library(lattice)
xyplot(flow ~ depth|factor(long), dat1, groups = lat, type = c("p","r"), pch
= 16)

I had started with lat and long reversed doing EDA gave the above
? latitude effect

Regards

Duncan


Duncan Mackay
Department of Agronomy and Soil Science
University of New England
Armidale NSW 2351
Email: home: [hidden email]

-----Original Message-----
From: R-help [mailto:[hidden email]] On Behalf Of Marna Wagley
Sent: Wednesday, 12 October 2016 19:49
To: r-help mailing list
Subject: [R] can we visualize water flows with 3d in R?

Hi R Users,
Is it possible to visualize river flow in  3D (latitude, longitude with
respect to depth)?
The example of my data looks like. Any suggestions?

> dat1
    long lat depth flow
1 1015.9 857  1.00 1.50
2 1015.9 857  1.25 1.23
3 1015.9 857  0.50 2.00
4 1015.9 858  0.10 1.95
5 1015.9 858  0.20 1.50
6 1025.0 858  0.30 1.20
7 1025.0 858  0.40 0.50
8 1025.0 858  0.35 0.70
9 1025.0 858  0.24 1.20

Thanks for your help.
thanks

        [[alternative HTML version deleted]]


______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.




        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: can we visualize water flows with 3d in R?

Marna Wagley
In reply to this post by Duncan Murdoch-2
Thanks for everyone for your suggestions. I am trying to use the techniques
that you suggested and I will update you its outcome so that it might be
useful to other too.
Thanks,


On Thu, Oct 13, 2016 at 2:10 PM, Duncan Murdoch <[hidden email]>
wrote:

> On 13/10/2016 11:14 AM, Thomas Adams wrote:
>
>> Duncan,
>>
>> Oh, to be sure, with a fair amount of work, you're probably correct that
>> one could mash up something. Here are some examples:
>>
>> http://www.illinoisfloods.org/documents/2013_IAFSM_Conferenc
>> e/Conference_Presentations/5C-1_HEC-GeoRAS_Part1.pdf
>> <--- lots of graphics
>>
>> http://rivergis.com/
>>
>> also...
>> http://www2.egr.uh.edu/~aleon3/courses/Transient_flows/
>> Tutorials/Geo_RAS/georastutorial.pdf
>> -- pages 35->
>> https://www.crwr.utexas.edu/reports/pdf/1999/rpt99-1.pdf -- pages 70->
>> (figures 4-17, 4-18), p. 147
>>
>
> Thanks.  I guess it's up to Marna to say whether any of those figures are
> like what she wants to produce from her data.
>
> Duncan Murdoch
>
>
>> Best,
>> Tom
>>
>> On Thu, Oct 13, 2016 at 9:20 AM, Duncan Murdoch
>> <[hidden email] <mailto:[hidden email]>> wrote:
>>
>>     On 13/10/2016 8:35 AM, Thomas Adams wrote:
>>
>>         All,
>>
>>         Very respectfully, there are no R packages that can do what
>>         Marna desires.
>>
>>
>>     I would guess that's not literally true, in that there are several
>>     graphics packages that are very flexible.   You could well be right
>>     that there are none that are designed specifically for this purpose,
>>     so she's probably going to have to do some work to get what she wants.
>>
>>         His/Her data, undoubtably, comes from a 1-D hydraulic model
>>         simulation -- where output is generated at channel
>>         cross-sections -- representing the sloping water surface
>>         elevation of the centerline of flow in a stream or river. With
>>         mapping software for such problems, the assumption is made that
>>         the water surface intersects the topography (within or beyond
>>         the stream channel) perpendicular to the direction of flow.
>>         Hydrodynamically, this is generally not correct, but it's a
>>         reasonable approximation. To do this, typically, the topography
>>         -- in the from of a raster digital elevation model (DEM) -- is
>>         converted to a triangular irregular network (TIN) to facilitate
>>         the creation of a smoother line of intersection between the
>>         water surface and topography. Because, the water surface slopes
>>         in a downstream direction, contour lines are crossed. Hydraulic
>>         modeling software usually is accompanied by this mapping
>>         capability, such as with HEC-RAS with RAS-Mapper, developed by
>>         the US Army Corps of Engineers, or with HEC-GeoRAS, which
>>         requires ESRI ARC GIS; but, there is also a QGIS plugin module
>>         that can do this, I believe. These software packages do
>>         facilitate representing the flow in 3D.
>>
>>
>>     Do you know any sample figures online that would show the type of
>>     graph that is usually used here?
>>
>>     Duncan Murdoch
>>
>>
>>         Tom
>>
>>
>>         On Wed, Oct 12, 2016 at 6:12 PM, David Winsemius
>>         <[hidden email] <mailto:[hidden email]>
>>         <mailto:[hidden email] <mailto:[hidden email]>>>
>>         wrote:
>>
>>
>>             > On Oct 12, 2016, at 4:28 AM, Duncan Murdoch
>>             <[hidden email] <mailto:[hidden email]>
>>         <mailto:[hidden email]
>>
>>         <mailto:[hidden email]>>> wrote:
>>             >
>>             > On 12/10/2016 4:49 AM, Marna Wagley wrote:
>>             >> Hi R Users,
>>             >> Is it possible to visualize river flow in 3D (latitude,
>>             longitude with
>>             >> respect to depth)?
>>             >> The example of my data looks like. Any suggestions?
>>             >>
>>             >>> dat1
>>             >>    long lat depth flow
>>             >> 1 1015.9 857  1.00 1.50
>>             >> 2 1015.9 857  1.25 1.23
>>             >> 3 1015.9 857  0.50 2.00
>>             >> 4 1015.9 858  0.10 1.95
>>             >> 5 1015.9 858  0.20 1.50
>>             >> 6 1025.0 858  0.30 1.20
>>             >> 7 1025.0 858  0.40 0.50
>>             >> 8 1025.0 858  0.35 0.70
>>             >> 9 1025.0 858  0.24 1.20
>>             >>
>>             >> Thanks for your help.
>>             >
>>             > It may be, but it's hard to give a nice looking graphic of
>>         that
>>             small dataset.  You could try the rgl package and use plot3d
>> to
>>             show spheres with radius depending on the flow rate, for
>> example
>>             >
>>             > plot3d(cbind(long, lat, depth), type="s", col="blue",
>>         radius=flow/5)
>>
>>             A complementary option is to install the plot3D package which
>> I
>>             see also has a plot3Drgl "co-package". The advantage to this
>>             option is the association with beautiful modeling packages
>> that
>>             Karline Soetaert, Peter M. J. Herman, and Thomas Petzoldt have
>>             been offering to ecologists for the last decade. (Packages:
>>             deSolve, marelac, seacarb, AquaEnv) A lot of her work has
>>         been on
>>             flows within systems.
>>
>>             I usually think of "flows" in rivers as being vector fields
>>         in an
>>             incompressible fluid (water) with 6 components per point,
>>         but you
>>             can also think of them as being scalar state variables. So I
>>             suppose you could be modeling something other than mass flows.
>>             (See Package::ReacTran for the R portal to that mathematical
>>         world.)
>>
>>             Best;
>>             David Winsemius
>>
>>
>>             >
>>             > Duncan Murdoch
>>             >
>>             > ______________________________________________
>>             > [hidden email] <mailto:[hidden email]>
>>         <mailto:[hidden email] <mailto:[hidden email]>>
>>         mailing list
>>             -- To UNSUBSCRIBE and more, see
>>             > https://stat.ethz.ch/mailman/listinfo/r-help
>>         <https://stat.ethz.ch/mailman/listinfo/r-help>
>>             <https://stat.ethz.ch/mailman/listinfo/r-help
>>         <https://stat.ethz.ch/mailman/listinfo/r-help>>
>>             > PLEASE do read the posting guide
>>             http://www.R-project.org/posting-guide.html
>>         <http://www.R-project.org/posting-guide.html>
>>             <http://www.R-project.org/posting-guide.html
>>         <http://www.R-project.org/posting-guide.html>>
>>             > and provide commented, minimal, self-contained,
>>         reproducible code.
>>
>>             David Winsemius
>>             Alameda, CA, USA
>>
>>             ______________________________________________
>>             [hidden email] <mailto:[hidden email]>
>>         <mailto:[hidden email] <mailto:[hidden email]>>
>>         mailing list --
>>             To UNSUBSCRIBE and more, see
>>             https://stat.ethz.ch/mailman/listinfo/r-help
>>         <https://stat.ethz.ch/mailman/listinfo/r-help>
>>             <https://stat.ethz.ch/mailman/listinfo/r-help
>>         <https://stat.ethz.ch/mailman/listinfo/r-help>>
>>             PLEASE do read the posting guide
>>             http://www.R-project.org/posting-guide.html
>>         <http://www.R-project.org/posting-guide.html>
>>             <http://www.R-project.org/posting-guide.html
>>         <http://www.R-project.org/posting-guide.html>>
>>             and provide commented, minimal, self-contained, reproducible
>>         code.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>

        [[alternative HTML version deleted]]

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.