Re: Contouring data over maps [message #12433] |
Wed, 05 August 1998 00:00 |
wmc
Messages: 117 Registered: February 1995
|
Senior Member |
|
|
<35C7589E.C37A0F1C@rex.cs.tulane.edu>, hasenbuh@rex.cs.tulane.edu wrote:
> Here's a worst case, maybe it can explain my problem:
> ...\##/...
> ....\/....
> ..*.||.*..
> ..../\....
> .../##\...
>
> My data points are at the asterisks. With the
> current method the data that is extrapolated from my
> data by IDL will be heavily influenced by BOTH data
> points, where, if I could find some way to respect the
> coastlines, I would expect IDL to consider these points
> much farther away than their cartesian distance.
Hmmm, I see your problem, for which my previous solution is no help at all.
Bascially you want a "real" GIS package for this kind of stuff, one that
allows you to specify "fault lines", which in your case would be the coast
line. I'm fairly sure that geologists do this stuff all the time.
To fake this in IDL would probably be tricky. Possibly you could add fake
points along the coast, use triangulate to define your triangulation, do some
reordering of this triangulation, and then use trigrid to interpolate. But
"do some reordering" would be the tricky bit. Perhaps
at that stage you could just delete any triangles that use the fake coastal
points?
- William
---
William M Connolley | wmc@bas.ac.uk | http://www.nbs.ac.uk/public/icd/wmc/
Climate Modeller, British Antarctic Survey | Disclaimer: I speak for myself,
and in this particular case have a fair old chance of burbling rubbish!
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
|
|
|
Re: Contouring data over maps [message #12438 is a reply to message #12433] |
Wed, 05 August 1998 00:00  |
Jason Hasenbuhler
Messages: 2 Registered: August 1998
|
Junior Member |
|
|
Unfortunately, I'm not contouring depth. I'm
contouring things like light asorbance/
transmittance, salinity, and temperature. If
I assume the land points to be 0, extreme
negatives, or extreme positives - I still
slant the data. My data points are structured
as follows:
I have 1 file for each lat/long location that
measurements were taken at. This file
contains ~ 100 to 400 readings made by
equipment lowered overboard, and are
organized by the number of seconds since the
recording was started.
My program currently gets an average of these
values over a depth-range and then contours
the averages.
Files that do not have values inside the requested depth-
range are not used at all in the contour.
Hmm...to slightly modify that idea, maybe if I could figure
out a way to determine if a given grid point was inside or
outside of the land, I could then "fill-in" all the gridpoints
inside land with the nearest ocean value. This might be
expensive time-wise, but it should give good results. Does
anyone know how I could determine if a point is on the
ocean or on the land? I'm using the built-in IDL maps..
Thanks,
Jason Hasenbuhler
hasenbuh@rex.cs.tulane.edu
BTW: Thanks for your help everyone, this problem is turning
into quite a hair-puller.
R.J. Hall wrote:
> Just a thought, and maybe completely wrong, but ...
>
> At the coastline, water depth is zero. The coastline location
> is known, so you have additional data points = 0
> This would (hopefuly) create a 0 contour line = coastline, when
> contour is run.
> The result would produce the required contour map with
> respect to the coastline.
>
> I would appreciate any comments on this.
>
> Many thanks
> Richard
>
|
|
|
Re: Contouring data over maps [message #12444 is a reply to message #12433] |
Wed, 05 August 1998 00:00  |
rjh55
Messages: 5 Registered: April 1997
|
Junior Member |
|
|
Just a thought, and maybe completely wrong, but ...
At the coastline, water depth is zero. The coastline location
is known, so you have additional data points = 0
This would (hopefuly) create a 0 contour line = coastline, when
contour is run.
The result would produce the required contour map with
respect to the coastline.
I would appreciate any comments on this.
Many thanks
Richard
In article <35C7589E.C37A0F1C@rex.cs.tulane.edu>, Jason Hasenbuhler <hasenbuh@rex.cs.tulane.edu> writes:
|> Hmmm. Not good news.
|>
|> The reason my boss wants me to make the
|> contouring respect the land/sea boundries is because
|> he has a very small sample size over a large area
|> that is relatively near to the coast. From that data
|> we are trying to build a picture of the water
|> structure over the total area. If the extrapolation
|> algorithms are using the space that the land is
|> occupying, then the picture comes out wrong.
|> I'm not particularly worried about the actual
|> overwriting of the drawn continents, just what that
|> overwriting implies - that the extrapolation
|> algorithim is only considering the "straight-line"
|> distance between my two data points, and not
|> considering that a huge hunk of rock may intersect
|> that line and make the extrapolations invalid.
|>
|> Here's a worst case, maybe it can explain my problem:
|>
|> ..\####/..
|> ...\##/...
|> ....\/....
|> ..*.||.*..
|> ..../\....
|> .../##\...
|>
|> My data points are at the asterisks. With the
|> current method the data that is extrapolated from my
|> data by IDL will be heavily influenced by BOTH data
|> points, where, if I could find some way to respect the
|> coastlines, I would expect IDL to consider these points
|> much farther away than their cartesian distance.
|>
|> ARGH.
|>
|> I have no idea how to approach this. My original
|> solution was to have my boss get back in the boat and
|> sample a few thousand more sites, but he said no. Any
|> other suggestions?
|>
|> Thanks lots,
|>
|> Jason Hasenbuhler
|> hasenbuh@rex.cs.tulane.edu
|>
|>
|> BTW: please ignore the email address this message is attached to. I have to
|> use someone else's acccount because mine isn't set up yet. Thanks.
|>
|>
|> William Connolley wrote:
|>
|> > 102ff455a31f815f989824@news.frii.com, davidf@dfanning.com (David Fanning) writes:
|> > >Jason Hasenbuhler (hasenbuh@rex.cs.tulane.edu) writes:
|> > >
|> > >> What I need to know is how to make IDL respect the land/sea continental
|> > >> boundries when I plot my interpolated data.
|> > >
|> > >There is, I feel safe in saying, no easy way to do what you want to do.
|> >
|> > I think Davids right. I have found in the past that attempting to define "nodata"
|> > regions with contour causes problems at the edges of those regions. It has been
|> > easier to contour everywhere, and then polyfill in white/background everywhere
|> > else (and then redraw the coastline, probably, because bits of it will have
|> > been clipped).
|> >
|> > Unfortunately, map_continents does not appear to have an option to fill the sea
|> > regions. I'd do it by using a GCM land-sea mask but you probably don't have that.
|> > If you're drawing to the screen, then:
|> >
|> > set your map projection
|> > map_continents,/fil
|> > mask=tvrd()
|> > contour your data
|> > img=tvrd()
|> > img(where(mask eq !p.background))=!p.background
|> > tv,img
|> >
|> > ought to work. Some variant might work with postscript, too.
|> >
|> > ---
|> > William M Connolley | wmc@bas.ac.uk | http://www.nbs.ac.uk/public/icd/wmc/
|> > Climate Modeller, British Antarctic Survey | Disclaimer: I speak for myself
|>
|>
|>
|
|
|
Re: Contouring data over maps [message #12447 is a reply to message #12433] |
Wed, 05 August 1998 00:00  |
rmlongfield
Messages: 68 Registered: August 1998
|
Member |
|
|
In article <35C7589E.C37A0F1C@rex.cs.tulane.edu>,
hasenbuh@rex.cs.tulane.edu wrote:
> Hmmm. Not good news.
>
> The reason my boss wants me to make the
> contouring respect the land/sea boundries is because
> he has a very small sample size over a large area
> that is relatively near to the coast. From that data
> we are trying to build a picture of the water
> structure over the total area. If the extrapolation
> algorithms are using the space that the land is
> occupying, then the picture comes out wrong.
Hi Jason,
I'm no expert in IDl mapping, but from my understanding of
your problem, you are getting a contour of, i.e., water depth, that is
crossing a land area, where water depth is meaningless. You need to
somehow get the "water depth" contour to go around the land, without
actually having data at other points along the coastline.
Maybe you can give the land values some very large default water depth which
would force IDL to draw a contour around it. This might make it look nice but
isn't exactly 'right' either.
I just scanned a textbook which contains some sea information in the form of
contours. It looks like the contours were just chopped at the land boundary.
It doesn't look very nice, actually, but at least it isn't 'wrong'.
Sparse data is always difficult, good luck.
Rose
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
|
|
|
Re: Contouring data over maps [message #12453 is a reply to message #12433] |
Tue, 04 August 1998 00:00  |
Jason Hasenbuhler
Messages: 2 Registered: August 1998
|
Junior Member |
|
|
Hmmm. Not good news.
The reason my boss wants me to make the
contouring respect the land/sea boundries is because
he has a very small sample size over a large area
that is relatively near to the coast. From that data
we are trying to build a picture of the water
structure over the total area. If the extrapolation
algorithms are using the space that the land is
occupying, then the picture comes out wrong.
I'm not particularly worried about the actual
overwriting of the drawn continents, just what that
overwriting implies - that the extrapolation
algorithim is only considering the "straight-line"
distance between my two data points, and not
considering that a huge hunk of rock may intersect
that line and make the extrapolations invalid.
Here's a worst case, maybe it can explain my problem:
..\####/..
...\##/...
....\/....
..*.||.*..
..../\....
.../##\...
My data points are at the asterisks. With the
current method the data that is extrapolated from my
data by IDL will be heavily influenced by BOTH data
points, where, if I could find some way to respect the
coastlines, I would expect IDL to consider these points
much farther away than their cartesian distance.
ARGH.
I have no idea how to approach this. My original
solution was to have my boss get back in the boat and
sample a few thousand more sites, but he said no. Any
other suggestions?
Thanks lots,
Jason Hasenbuhler
hasenbuh@rex.cs.tulane.edu
BTW: please ignore the email address this message is attached to. I have to
use someone else's acccount because mine isn't set up yet. Thanks.
William Connolley wrote:
> 102ff455a31f815f989824@news.frii.com, davidf@dfanning.com (David Fanning) writes:
>> Jason Hasenbuhler (hasenbuh@rex.cs.tulane.edu) writes:
>>
>>> What I need to know is how to make IDL respect the land/sea continental
>>> boundries when I plot my interpolated data.
>>
>> There is, I feel safe in saying, no easy way to do what you want to do.
>
> I think Davids right. I have found in the past that attempting to define "nodata"
> regions with contour causes problems at the edges of those regions. It has been
> easier to contour everywhere, and then polyfill in white/background everywhere
> else (and then redraw the coastline, probably, because bits of it will have
> been clipped).
>
> Unfortunately, map_continents does not appear to have an option to fill the sea
> regions. I'd do it by using a GCM land-sea mask but you probably don't have that.
> If you're drawing to the screen, then:
>
> set your map projection
> map_continents,/fil
> mask=tvrd()
> contour your data
> img=tvrd()
> img(where(mask eq !p.background))=!p.background
> tv,img
>
> ought to work. Some variant might work with postscript, too.
>
> ---
> William M Connolley | wmc@bas.ac.uk | http://www.nbs.ac.uk/public/icd/wmc/
> Climate Modeller, British Antarctic Survey | Disclaimer: I speak for myself
|
|
|
Re: Contouring data over maps [message #12454 is a reply to message #12453] |
Tue, 04 August 1998 00:00  |
wmc
Messages: 117 Registered: February 1995
|
Senior Member |
|
|
102ff455a31f815f989824@news.frii.com, davidf@dfanning.com (David Fanning) writes:
> Jason Hasenbuhler (hasenbuh@rex.cs.tulane.edu) writes:
>
>> What I need to know is how to make IDL respect the land/sea continental
>> boundries when I plot my interpolated data.
>
> There is, I feel safe in saying, no easy way to do what you want to do.
I think Davids right. I have found in the past that attempting to define "nodata"
regions with contour causes problems at the edges of those regions. It has been
easier to contour everywhere, and then polyfill in white/background everywhere
else (and then redraw the coastline, probably, because bits of it will have
been clipped).
Unfortunately, map_continents does not appear to have an option to fill the sea
regions. I'd do it by using a GCM land-sea mask but you probably don't have that.
If you're drawing to the screen, then:
set your map projection
map_continents,/fil
mask=tvrd()
contour your data
img=tvrd()
img(where(mask eq !p.background))=!p.background
tv,img
ought to work. Some variant might work with postscript, too.
---
William M Connolley | wmc@bas.ac.uk | http://www.nbs.ac.uk/public/icd/wmc/
Climate Modeller, British Antarctic Survey | Disclaimer: I speak for myself
|
|
|
Re: Contouring data over maps [message #12462 is a reply to message #12453] |
Mon, 03 August 1998 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Jason Hasenbuhler (hasenbuh@rex.cs.tulane.edu) writes:
> I am currently developing an application in IDL that needs to
> draw contour plots
> over a map. My data is irregularly gridded, and very sparse. What I
> need to know
> is how to make IDL respect the land/sea continental boundries when I
> plot my
> interpolated data. I can only currently clip my contour plot to a
> latitude/longitude range..
> I need to know how to make my contour conform to the coastlines.
There is, I feel safe in saying, no easy way to do what
you want to do. I can think of several ways I might approach
the problem, using image masks, pixmaps, loops, etc., but
all of them are ugly as sin and not likely to result in
a pleasant day of IDL programming. :-(
It might be more productive to make the argument to the
powers that be that having contours run over the
continental boundary is actually the PROPER way to
display sparse data. :^)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|