GithubHelp home page GithubHelp logo

Comments (5)

acapet avatar acapet commented on July 18, 2024 1

Thanks, that's exactly what I needed.
For the record, here's how I got through :

from numpy import meshgrid
lons, lats = meshgrid(g.x_c, g.y_c)
shape = lats.shape

# flat grid before interp
lons, lats = lons.reshape(-1), lats.reshape(-1)

# interp and reshape
ti = t.interp('analysed_sst', lons, lats).reshape(shape).T
ti = ma.masked_invalid(ti)

g.add_grid('sst',ti)

I masked it for later use e.g. g.add_grid('sst_anom',ti-ti.mean()).

The reason I loaded SST everywhere, and not only within contours at this stage, is for a first visual inspection.

Thanks !!!

(PS: I'm preparing a show case with corresponding data files for the gallery)

from py-eddy-tracker.

AntSimi avatar AntSimi commented on July 18, 2024

Hi!

I think you should try something like this :

from numpy import meshgrid
# create mesh
lats, lons = meshgrid(g.y_c, g.x_c)
shape = lats.T.shape
# flat grid before interp
lons, lats = lons.reshape(-1), lats.reshape(-1)
# interp and reshape
ti = g.interp('sst', lons, lats).reshape(shape)

In my mind masked array or not must be the same, but when i read function ... if it's a problem send traceback

I wonder why you want interpolate sst grid on sla resolution before assess mean SST anomalies within contours?
You could get sst pixel within contours directly .

Antoine

from py-eddy-tracker.

acapet avatar acapet commented on July 18, 2024

It seems that add_grid doesn't complete g.variables_description.
As a consequence, I can't for instance use

g.copy("sst", "sst_high")
g.bessel_high_filter('sst_high',100)

to higlight anomalies in SST.

Any hint ?

from py-eddy-tracker.

acapet avatar acapet commented on July 18, 2024

Ok, I went over this issue with

g.variables_description['sst'] = t.variables_description['analysed_sst']

but I'm unsure it would be entirely correct, since there has been an interpolation in between these two..

from py-eddy-tracker.

AntSimi avatar AntSimi commented on July 18, 2024

Good, maybe i will add a method to re-grid a grid on another one (with same code of interpolation) to take all informations in one command

from py-eddy-tracker.

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.