Giter Site home page Giter Site logo

Comments (33)

krober10nd avatar krober10nd commented on May 27, 2024

from oceanmesh2d.

DrakonianMight avatar DrakonianMight commented on May 27, 2024

HI Keith,

Yes I downloaded m_map1.4, unzipped it, renamed the top directory m_map and put in the root folder today.
I get the following when I run plot(gdat) :

Undefined function 'startsWith' for input arguments of type 'char'.

Error in geodata/plot (line 685)
            if startsWith(projection,'ste')

from oceanmesh2d.

krober10nd avatar krober10nd commented on May 27, 2024

from oceanmesh2d.

DrakonianMight avatar DrakonianMight commented on May 27, 2024

Yes, looks like I am running 2016a and startsWith was introduced in 2016b.

Thanks for sending that fix through, I applied it, however I get a further error:

Building feature size function...
man, no medial points!
Error using  & 
Matrix dimensions must agree.

Error in edgefx/finalize (line 775)
                hh_m(nearshore & hh_m > obj.max_el_ns) = obj.max_el_ns;

Error in edgefx (line 246)
                    obj = finalize(obj,feat);

Error in Example_1_NZ (line 20)
fh = edgefx('geodata',gdat,...
 
>> plot(gdat)
Undefined function or variable 'projtype'.

Error in geodata/plot (line 685)
            if ~isempty(regexp(projtype,'ste'))

If its any help if I replace 'projtype' with 'projection' I get an error but plot(gdat) works OK.
Thanks for getting back to me so quickly.

from oceanmesh2d.

krober10nd avatar krober10nd commented on May 27, 2024

from oceanmesh2d.

DrakonianMight avatar DrakonianMight commented on May 27, 2024

So If I replace line 685 in geodata/plot to if ~isempty(regexp(projection,'ste')) (proj didn't work)

I still get:

Building feature size function...
man, no medial points!
Error using  & 
Matrix dimensions must agree.

Error in edgefx/finalize (line 775)
                hh_m(nearshore & hh_m > obj.max_el_ns) = obj.max_el_ns;

Error in edgefx (line 246)
                    obj = finalize(obj,feat);

Error in Example_1_NZ (line 20)
fh = edgefx('geodata',gdat,...

but running plot(gdat) gives me
image

from oceanmesh2d.

krober10nd avatar krober10nd commented on May 27, 2024

from oceanmesh2d.

DrakonianMight avatar DrakonianMight commented on May 27, 2024

Hi, No edits to the original Example_1_NZ.m file.
I downloaded and was using the Projection branch.
I have also tried using the Master and I get an error (perhaps the below is of more use (from running from master).

Building feature size function...
Invalid MEX-file '/home/matlab/oceanwaves2d/OceanMesh2D-master/OceanMesh2D-master/@ann/private/annmex.mexa64': /lib64/libc.so.6: version `GLIBC_2.14' not found (required by
/home/matlab/oceanwaves2d/OceanMesh2D-master/OceanMesh2D-master/@ann/private/annmex.mexa64)

Error in get_data_class (line 3)
d = annmex();

Error in ann (line 108)
[anno.ccls anno.cfun] = get_data_class();

Error in WrapperForKsearch (line 10)
anno = ann(dataset);

Error in dpoly (line 26)
[~,d] = WrapperForKsearch(pv1', p',1);

Error in edgefx/get_dis (line 296)
            d = feval(obj.fd,obj,feat);

Error in edgefx/featfx (line 226)
            [d,obj] = get_dis(obj,feat);

Error in edgefx (line 179)
                            obj = featfx(obj,feat);

Error in Example_1_NZ (line 19)
fh = edgefx('geodata',gdat,...

Thanks again.

from oceanmesh2d.

krober10nd avatar krober10nd commented on May 27, 2024

from oceanmesh2d.

DrakonianMight avatar DrakonianMight commented on May 27, 2024

Hi,

Yes I have restarted and can confirm still getting the same issue.

It seems to be linked to the use of '&' in line 775 of edgefx.m

On doing some debugging it seems that 'nearshore' is empty which is sourced from obj.boudist (which is also empty).

Any ideas?

from oceanmesh2d.

krober10nd avatar krober10nd commented on May 27, 2024

from oceanmesh2d.

WPringle avatar WPringle commented on May 27, 2024

It could be the issue that old matlab does not automatically resize matrices to fit dimensions when making logical statements.

nearshore = abs(obj.boudist) < 100; size is M x N
hh_m(nearshore & hh_m > obj.max_el_ns) = obj.max_el_ns; obj.max_el_ns, size of obj.max_el_ns is 1 x 1, size of hh_m is M x N

try changing hh_m > obj.max_el_ns to _hh_m > repmat(obj.max_el_ns,size(hh_m))

Although it doesn't explain why obj.boudist is empty

from oceanmesh2d.

WPringle avatar WPringle commented on May 27, 2024

Actually I see now that if you are still getting the "No mainland or inner" warning on line 262 then it will not calculate the obj.boudist so you are just getting an error at line 775 but the issue is happening before that because of the no mainland or inner problem.

from oceanmesh2d.

DrakonianMight avatar DrakonianMight commented on May 27, 2024

Hi both,
Thanks for looking at this issue.

So as suggested I wrapped the gdat in a cellarray and added a breakpoint to look at gdat.
Sadly still getting an error.
Gdat properties:
image
The error:
image

feat looks like it is defined in line 144, in some sort of default value constructor.

from oceanmesh2d.

krober10nd avatar krober10nd commented on May 27, 2024

from oceanmesh2d.

DrakonianMight avatar DrakonianMight commented on May 27, 2024

Thanks for the help,

I am currently investigation getting a newer release of Matlab (2019), which I am helping with solve the issue. Before I proceed can you confirm that OceanMesh2D is functional on the 2019 version?

Thanks again,

from oceanmesh2d.

krober10nd avatar krober10nd commented on May 27, 2024

from oceanmesh2d.

DrakonianMight avatar DrakonianMight commented on May 27, 2024

I was using the Projection commit.

I did some testing and I still wasn't able to get it to run for example 1 or 2.

I also tried wrapping the object and making minor changes in edgfx, but I kept running into other issues. We were always planning on moving to a more recent version of Matlab anyway, if it solves the issue for me here that is a bonus.

from oceanmesh2d.

krober10nd avatar krober10nd commented on May 27, 2024

from oceanmesh2d.

DrakonianMight avatar DrakonianMight commented on May 27, 2024

Apologies for taking so long to get back to you, I had some other priorities and I was awaiting our upgrade to a newer version of Matlab.

I have now started testing on 2019a, however unfortunately I am still getting the same error.

``179837` Records in file, by 500:

.......................................................................................................................................................................................................................................................................................................................................................................Partitioning the boundary into islands, mainland, ocean
Smoothing coastline with 5 point window
Reading shapefile with m_shaperead
5706 Records in file, by 500:

...........Partitioning the boundary into islands, mainland, ocean
'Read in meshing boundary: ' 'GSHHS_f_L1'

Building feature size function...
man, no medial points!
Error using &
Matrix dimensions must agree.

Error in edgefx/finalize (line 775)
hh_m(nearshore & hh_m > obj.max_el_ns) = obj.max_el_ns;

Error in edgefx (line 246)
obj = finalize(obj,feat);

Error in Example_1_NZ (line 19)
fh = edgefx('geodata',gdat,...``

I am using projection branch, commit: e434912

I have downloaded and placed m_map in the root folder and I do not have gdal installed.

from oceanmesh2d.

krober10nd avatar krober10nd commented on May 27, 2024

from oceanmesh2d.

DrakonianMight avatar DrakonianMight commented on May 27, 2024

I have zipped my directory (link below), to confirm I am running the linux edition of matlab.

https://send.firefox.com/download/ca60087ab82ec052/#KsUCxOg-N9C5ER8vcPnx0g

from oceanmesh2d.

krober10nd avatar krober10nd commented on May 27, 2024

I just ran your exact code with the inputs and unfortunately for this issue, it worked just fine.

All I did is was right click the working directory and click Add to path --> Selected folders and subfolders.
Screen Shot 2019-07-28 at 8 18 15 PM

I tried with and without the paid mapping toolbox and they both operated fine.

from oceanmesh2d.

DrakonianMight avatar DrakonianMight commented on May 27, 2024

Well I guess that suggests that it might be a linux version of Matlab problem.

We have dug through it and isolated where it fails, get_dist (line371 in edfefx.m) fails specifically at line 374, when @dpoly is called. Sadly this fails silently, despite adding a number of comments throughout.

Going to track down a windows version in the next couple of days and try some testing on it.

from oceanmesh2d.

krober10nd avatar krober10nd commented on May 27, 2024

from oceanmesh2d.

DrakonianMight avatar DrakonianMight commented on May 27, 2024

Scientific Linux, perhaps not one of the common distributions, but its based on Red Hat.

from oceanmesh2d.

krober10nd avatar krober10nd commented on May 27, 2024

from oceanmesh2d.

HamishB avatar HamishB commented on May 27, 2024

What version of Scientific Linux are you using?

from oceanmesh2d.

HamishB avatar HamishB commented on May 27, 2024

I've just tried Example_1_NZ.m from the git repo on CentOS 7.6 with Matlab R2016b and it all worked ok. The only change I made to the code was changing the line endings from DOS to UNIX in @geodata/geodata.m.

I did get a couple warnings:
Warning: no polyshape or polybool available to merge possible overlapping of mainland and inner


When I tried using the min_el, max_el, etc. terms from the July 4th user guide everything took quite a bit longer and used a bunch more RAM (peak >3.5GB). But it worked.

Also to note it left a Temp_grid.mat file behind, don't know if that is desired.

regards,
Hamish

from oceanmesh2d.

krober10nd avatar krober10nd commented on May 27, 2024

from oceanmesh2d.

HamishB avatar HamishB commented on May 27, 2024

By the way, if anyone wants a higher resolution coastline shapefile and bathy data for NZ:

https://koordinates.com/from/data.linz.govt.nz/layer/51153/

(250m res is aspirational in places)
https://koordinates.com/layer/8678-niwa-new-zealand-bathymetic-grid-2016/

both licensed as CC-By.

from oceanmesh2d.

DrakonianMight avatar DrakonianMight commented on May 27, 2024

FYI I got everything working as expected on a fresh Matlab install on Windows.
It seems that there is a missing dependency on some Linux distributions (Redhat and Scientific Linux) which is causing the issue, sadly not something I was able to change on the HPC I was using. I will try and get some more details.

Thanks for the support and for responding quickly.

from oceanmesh2d.

krober10nd avatar krober10nd commented on May 27, 2024

Thanks DrakonianMight. Glad you got it working!

from oceanmesh2d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.