Code Monkey home page Code Monkey logo

Comments (4)

SorooshMani-NOAA avatar SorooshMani-NOAA commented on June 17, 2024

The main issue when you pass in an array of only z values is that you'd lose all the information about location. So the bbox actually defines locations for you, that's why instead of clipping the original DEM with the given bbox, you actually get the stretched/shrunk version of the same original elevations. The issue with the inversion is related to how data is stored vs plotted when you lose the location info. Your first row of data in the matrix starts from the top. In the plot, your first row of pixels starts from the bottom, and it looks like that's what you see here.

I haven't looked at the DEM code in oceanmesh, I've recently started looking into using this package. So please don't take what I said as given!

from oceanmesh.

ml14je avatar ml14je commented on June 17, 2024

Hi there. Thank you for flagging this! I think I was the one who initially implemented the input of an array/callable function for DEM. It's more or less what was said above in relation to needing to prescribe bbox: by giving an array, you need some information about the positioning. The tuple bbox is required as it defines the positional data. For the input of numpy data, there is also a supposition of how that data is given. It could be that a np.rot90 is needed just after line 676 of geodata.py. I can look into this Wednesday evening. If I understand correctly, you do have a fix for the time-being?

from oceanmesh.

krober10nd avatar krober10nd commented on June 17, 2024

From memory, DEM class takes a tif or netcdf file and reads it in as you show.

I would avoid passing arrays with no meta data.

Sometimes the NetCdf/tif file is packed using a different convention than is expected by the software. What I recall is that the origin is either at the top left or bottom left of the DEM.

In any case, this aspect of the software should be improved and standardized.

from oceanmesh.

krober10nd avatar krober10nd commented on June 17, 2024

Hi @filippogiaroli I have finally found some time to improve this issue. I will merge the branch referenced above shortly but if you want you can use that branch now. Please let me know if you run into any issues with reading or processing your DEM with that branch if you try it. Thanks.

from oceanmesh.

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.