SEAGRID.m with MATLAB R2014b

Discussion about analysis, visualization, and collaboration tools and techniques

Moderators: arango, robertson

Post Reply
Message
Author
onken
Posts: 11
Joined: Thu Feb 15, 2007 12:19 pm
Location: Helmholtz Zentrum Geesthacht

SEAGRID.m with MATLAB R2014b

#1 Post by onken » Fri May 15, 2015 8:23 am

Who knows where I can find a version of "seagrid.m" which works with MATLAB R2014b on LINUX 64bit? Since I upgraded from the previous MATLAB version, seagrid crashes with the following error messages:
------------------------------------------------------
Undefined function 'any' for input arguments of type 'matlab.graphics.GraphicsPlaceholder'.
Error in busy (line 15)
if ~any(findobj('Type', 'figure')), return, end
Error in seagrid (line 101)
busy
------------------------------------------------------
Thereafter, I commented out line 15 in "busy.m" and seagrid crashed with
------------------------------------------------------
Undefined function 'any' for input arguments of type 'matlab.graphics.GraphicsPlaceholder'.
Error in seagrid/doaddmenus (line 27)
if any(h), delete(h), end
Error in seagrid (line 119)
theMenus = doaddmenus(self);
-------------------------------------------------------
Hence I suppose that there is something wrong with the processing of figure handles in MATLAB R2014b. Any idea?

Cheers,
Reiner

Kosa
Posts: 18
Joined: Mon Jan 12, 2015 4:12 pm
Location: URI GSO

Re: SEAGRID.m with MATLAB R2014b

#2 Post by Kosa » Tue May 26, 2015 6:45 pm

I am having the same problem, kindly let me know if you find a solution.

Thank you

Kosa
Posts: 18
Joined: Mon Jan 12, 2015 4:12 pm
Location: URI GSO

Re: SEAGRID.m with MATLAB R2014b

#3 Post by Kosa » Tue May 26, 2015 6:50 pm

Have you updated your mex files yet? I believe that is my issue, though maybe you have already updated them. From the SEAGRID README.txt in the mex file subdirectory

Code: Select all

Building SEAGRID requires building 3 mex files:
mexsepeli.F
mexrect.F
mexinside.c

These mex files are machine dependent, and can also be matlab version dependent.
...
I have yet to find any for Linux 64 bit.

User avatar
CharlesJames
Posts: 26
Joined: Thu May 24, 2007 12:12 pm
Location: South Australian Research and Development Institute

Re: SEAGRID.m with MATLAB R2014b

#4 Post by CharlesJames » Fri May 29, 2015 1:42 am

Seagrid doesn't need to have any mex files in order to run, in spite of the error message, if they are not there seagrid uses m files to perform the same functions. The bigger problem is that starting with Matlab 2014b handles are no longer floating point numbers by default - they have a new class called "handle", Seagrid checks a lot of handle states with the "any" function but this won't work with the new handles - you would probably have start by replacing all "any" statements with "~isempty" to resolve this problem and even if you do that there may still be other issues. I eventually decided to start with the seagrid fast Poisson Solver and recreate the Seagrid functionality in a new stand-alone executable which is hosted on John Luick's Austides site at http://austides.com/downloads/. We are calling it GridBuilder but is based on the look and feel of Seagrid. At the moment the executable only runs on Windows 64bit machines but you don't need to have Matlab on the machine for it to run.

Kosa
Posts: 18
Joined: Mon Jan 12, 2015 4:12 pm
Location: URI GSO

Re: SEAGRID.m with MATLAB R2014b

#5 Post by Kosa » Fri May 29, 2015 3:09 pm

Thank you for your reply Charles. A couple of days ago I did switch out all the instances of function "any" to agree with the new r2014b graphics handles but you are right about there still being other issues.

Unfortunately, I am not a Windows machine so I think for now I will just locate an older version of Matlab in order to write grid files but I will be very interested to try your stand-alone GridBuilder someday.

jmcsween
Posts: 2
Joined: Tue Oct 04, 2011 6:01 pm
Location: Rutgers

Re: SEAGRID.m with MATLAB R2014b

#6 Post by jmcsween » Thu Jan 12, 2017 11:41 pm

Hi,

I realize this is a pretty old post, but was there ever a solution to this thread? I am trying to get seagrid to work with Matlab 2016b and am having similar errors.

Thanks!

daniellesu
Posts: 1
Joined: Tue Apr 14, 2015 1:27 pm
Location: University of Western Australia

Re: SEAGRID.m with MATLAB R2014b

#7 Post by daniellesu » Mon Feb 13, 2017 4:27 am

jmcsween,

Did you end up resolving the issues with seagrid on matlab2016b? I'm also facing similar issues and wondered if you could advise.

Cheers

User avatar
wilkin
Posts: 503
Joined: Mon Apr 28, 2003 5:44 pm
Location: Rutgers University
Contact:

Re: SEAGRID.m with MATLAB R2014b

#8 Post by wilkin » Tue Feb 14, 2017 12:35 pm

No one has updated seagrid. It's too hard and there are other tools.

We keep an old version of Matlab on our system just for this purpose.
John Wilkin: DMCS Rutgers University
71 Dudley Rd, New Brunswick, NJ 08901-8521, USA. ph: 609-630-0559 jwilkin@rutgers.edu

rsignell
Posts: 123
Joined: Fri Apr 25, 2003 9:22 pm
Location: USGS

Re: SEAGRID.m with MATLAB R2014b

#9 Post by rsignell » Wed Feb 15, 2017 2:21 pm

I haven't tried GridBuilder, but from the documentation it looks pretty powerful, with SeaGrid's capabilities and then some. And even though available from a consulting company, it's free: http://austides.com/downloads/. If someone tries it, please report back to this thread!

User avatar
CharlesJames
Posts: 26
Joined: Thu May 24, 2007 12:12 pm
Location: South Australian Research and Development Institute

Re: SEAGRID.m with MATLAB R2014b

#10 Post by CharlesJames » Mon Feb 20, 2017 2:41 am

Development on gridbuilder began by trying to fix Seagrid, but the old presto toolbox that was used to drive the gui would also have had to be rewritten so we gave up on that approach - at the heart of Seagrid (and GridBuilder) is the routine rect2grid which uses a fast Poisson solver to generate the interior points of the grid. Our version of this program is called bpsi2grid and is essentially a cleaned up version of rect2grid and doesn't require any mex files and hopefully I've attached it to this post. To form the grid you need to select the boundary points clockwise from the first corner (going the other way around produces weird results), for an m by n grid the vectors for x and y on the boundary need to be 2*((m-1)+(n-1)) in length with the last boundary point being the last point before the first corner. If the points are evenly spaced between each corner the resulting grid should be pretty good although some grids with telescoping resolution will need some additional cleaning up. Seagrid and Gribuilder essentially provide an interface for defining and transforming those boundary points in a user friendly way and then add on a few bells and whistles for building topography, masks and writing out a ROMS compatible grid file.
Attachments
bpsi2grid.m
GridBuilder version of rect2grid
(2.66 KiB) Downloaded 183 times

Chang
Posts: 20
Joined: Sun Dec 04, 2016 1:03 am
Location: ocean university of china

Re: SEAGRID.m with MATLAB R2014b

#11 Post by Chang » Tue Feb 21, 2017 1:39 pm

Dear friends
I am facing the same difficulty with you,and I believe you must have solved this problem with your talent and hardwork.I really hope you can share your experience with me and give me a answer at your convenience.thank you very much!

Lxc
Posts: 4
Joined: Mon Nov 21, 2016 5:58 pm
Location: Ocean University of China

Re: SEAGRID.m with MATLAB R2014b

#12 Post by Lxc » Tue Apr 17, 2018 8:30 am

I must say the GridBuilder is very powerful!

User avatar
CharlesJames
Posts: 26
Joined: Thu May 24, 2007 12:12 pm
Location: South Australian Research and Development Institute

Re: SEAGRID.m with MATLAB R2014b

#13 Post by CharlesJames » Wed Jul 25, 2018 1:50 am

After some encouragement I have decided to release the full GridBuilder source code and files in the form of a Matlab toolbox. The latest version should run on any version of Matlab 2014b or later. I have only tested it on a Windows machine so I would be interested in hearing how it goes on Macs and Linux. I'm calling this release 1.2 and it includes a new orthogonal grid format suggested by John Wilkin. The grid is constructed like a rectangular grid but rotations, expansions, and translations will try to maintain the 0% orthogonality error of the grid (it will appear slightly distorted on my Cartesian global projection when rotated). Spacing points can be added in Orhtogonal mode but control points are not available as they will change the orhtogonality of the grid. Free Format and Rectangular Format are still available as options. In addition to the new Orthogonal Mode I've tried to incoroporate a help guide within GridBuilder through the toolbox which seems to work. I'll try and continue to provide executable versions of GridBuilder for users who don't have access to Matlab 2014b or higher. John Luick is continuing to host the links to the code so see http://austides.com/downloads for latest versions. We are hoping to have the toolbox hosted through myroms.org as well. The toolbox is quite large as I have packaged the eTopo topography, coastlines, and documentation in one file. Once it is downloaded it should install in Matlab by double clicking on the GridBuilder.mltbx file (from inside Matlab). This will install the code, data, and help files on your matlab path and you should be able to run it by typing GridBuilder at the command prompt.
I have done most of the debugging myself with the help of feedback from users of the executable. I will try to respond to any bug reports as soon as possible so please let me know if you find a problem, even if you fix it yourself! I'm setting up a git repository on git-hub for code only so that will another source for the latest code fixes. Enjoy!

Post Reply