Giter Site home page Giter Site logo

oceanlab's Introduction

OceanLab

Package of Python scripts for Oceanography (Python +3.6)

Code Example

Check examples folder in our github repository.

Installation

pip install OceanLab

Modules

  • OA
    • vectoa(): Objective analysis for vectorial fields;
    • scaloa(): Objective analysis for scalar fields;
  • DYN
    • dyn_amp(): Makes the projection of every dynamical mode to velocity to obtain its amplitude;
    • zeta(): Calculates the vorticity field by velocity field;
    • psi2uv(): Calculates the velocity field by stream function scalar field;
    • vmodes(): Calculates the QG pressure modes from N2 profile;
    • eqmodes(): Calculates the equatorial pressure and vertical velocity modes from N2 profile;
  • EOF
    • eoft(): Calculates the Empirical Orthogonal Functions;
    • my_eof_interp(): Fillgaps on matrix based on EOFs (translated from Cesar Rocha Matlab version);
    • ceof(): Performs the Complex (or Hilbert) Empirical Orthogonal Functions decomposition;
    • reconstruct_ceof(): Reconstructs the CEOF modes individually;
  • UTILS
    • argdistnear(): Searchs the position of the closest points in an array to a reference point;
    • meaneddy(): Performs an eddy-mean decomposition with a low-pass filter;

Contributors

Everyone can contribute to this code. Some of functions were based on Filipe Fernandes or Cesar Rocha functions and some of them were created with help of Dante C. Napolitano, Hélio M. R. Almeida and Wandrey Watanabe at Ocean Dynamics Lab of University of São Paulo (USP).

oceanlab's People

Contributors

dantecn avatar iuryt avatar mariamigl avatar owang01 avatar vsilvafelipe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

oceanlab's Issues

Thinking of the return of the "utils" module

I liked the idea of simplifying and making OceanLab more direct and specific. But I missed the old utils module, where you could get e.g. argdistnear easily. Why not come up with something like "tools" or "support" and bring back some of the "utils"?

memory usage in scaloa

Hey guys,

I've used your objective mapping function scaloa and noticed there is a simple way to reduce memory usage.

The variables d2 and dc2 can occupy a huge memory space, so deleting them after defining both correlation and cross correlation matrices (A,C, respectively) and before inverting the matrix is useful. In one of my cases, it it frees up a few gbs of memory (of course, this depends on both grid and data).

(...)
    d2 = ((np.tile(x, (n, 1)).T - np.tile(x, (n, 1))) ** 2 +
    (np.tile(y, (n, 1)).T - np.tile(y, (n, 1))) ** 2)
    nv = len(xc)
    xc, yc = np.reshape(xc, (1, nv)), np.reshape(yc, (1, nv))
    # Squared distance between the observations and the grid points.
    dc2 = ((np.tile(xc, (n, 1)).T - np.tile(x, (nv, 1))) ** 2 +
    (np.tile(yc, (n, 1)).T - np.tile(y, (nv, 1))) ** 2)
    # Correlation matrix between stations (A) and cross correlation (stations
    # and grid points (C))
    A = (1 - err) * np.exp(-d2 / corrlen ** 2)
    C = (1 - err) * np.exp(-dc2 / corrlen ** 2)
    if 0: # NOTE: If the parameter zc is used (`scaloa2.m`)
        A = (1 - d2 / zc ** 2) * np.exp(-d2 / corrlen ** 2)
        C = (1 - dc2 / zc ** 2) * np.exp(-dc2 / corrlen ** 2)
        
    # here!!!!!!!!!   <----------
    del(d2, dc2)
        
(...)

LICENSE

@iuryt Choose a license for you project. I recommend MIT or BSD-like (2 or 3 Clauses) licenses.

Here is a typical MIT licenses (automatically generated by GitHub BTW).

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.