Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Masking tool/ blanking cell for bathymetry
Replies: 4   Last Post: May 9, 2013 10:28 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Alice

Posts: 4
Registered: 5/9/13
Re: Masking tool/ blanking cell for bathymetry
Posted: May 9, 2013 10:28 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi Yvonne,

I have the same problem, I have some bathymetry data with wet points which need masking out.

I have masked out the land fine with:

Dep(Dep>=0)= NaN;

Can you describe your method for masking out wet points please?

Alice

"Yvonne" wrote in message <gtqnf2$qa6$1@fred.mathworks.com>...
> Thank you for your help. I have some boundary areas that i need to mask other than the land area as some parts of the area doesnt look right. I had to interpolate and grid the data and after that choose the area that is needed and from there choose the boundary. I did that by:
>
> %%%%%%%%%%%%%%%%
> maskArea = Gridarea;
> for i = 1:length(GridY)
> if isnan(InterpX(i)) || isnan(InterpX2(i))
> maskArea(i,:) = NaN;
> else
> ii=find(gridX< InterpX(i)| gridX> InterpX2(i));%
> maskArea(i,ii) = NaN;
> end
> end
> %%%%%%%%%%%%%%%%%
> whick work in some sense.
>
> thank you
> Rune Allnor <allnor@tele.ntnu.no> wrote in message <b8d290c8-195d-4951-a1e9-f004eb3d78a2@v17g2000vbb.googlegroups.com>...

> > On 3 Mai, 13:04, "Yvonne " <h...@waikato.ac.nz> wrote:
> > > Hi,
> > >
> > > I am trying to write a code to mask all the land value for my bathymetry =

> > grid. The land points were manually digitised. Is there any suggestions on =
> > how to create a mask or a blanking cell for the land boundaries and the are=
> > a that I do not want in my grid?
> >
> > Try to set all the z-values of the land data points to NaN:
> >
> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> > xv=randn(10000,1);
> > yv=randn(10000,1);
> > zv= exp(-(xv.^2+yv.^2))-0.9;
> >
> > t√ělaunay(xv,yv);
> > trimesh(t,xv,yv,zv) % Plots all data points
> > figure
> >
> > Zv=zv;
> > Zv(Zv>0)=nan;
> > trimesh(t,xv,yv,Zv) % Leaves out points with z-values > 0.
> > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> >
> > Rune




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.