All Projects → powellb → seapy

powellb / seapy

Licence: MIT license
State Estimation and Analysis in Python

Programming Languages

python
139335 projects - #7 most used programming language
fortran
972 projects

Projects that are alternatives of or similar to seapy

Uproot3
ROOT I/O in pure Python and NumPy.
Stars: ✭ 312 (+1148%)
Mutual labels:  analysis, numpy
support-tickets-classification
This case study shows how to create a model for text analysis and classification and deploy it as a web service in Azure cloud in order to automatically classify support tickets. This project is a proof of concept made by Microsoft (Commercial Software Engineering team) in collaboration with Endava http://endava.com/en
Stars: ✭ 142 (+468%)
Mutual labels:  model, numpy
gau2grid
Fast computation of a gaussian and its derivative on a grid.
Stars: ✭ 23 (-8%)
Mutual labels:  grid, numpy
Python-for-data-analysis
No description or website provided.
Stars: ✭ 18 (-28%)
Mutual labels:  analysis, numpy
Uproot4
ROOT I/O in pure Python and NumPy.
Stars: ✭ 80 (+220%)
Mutual labels:  analysis, numpy
Awkward 0.x
Manipulate arrays of complex data structures as easily as Numpy.
Stars: ✭ 216 (+764%)
Mutual labels:  analysis, numpy
common-osint-model
Converting data from services like Censys and Shodan to a common data model
Stars: ✭ 35 (+40%)
Mutual labels:  analysis, model
pyrocms-cheatsheet
Pyro CMS - Cheat Sheet
Stars: ✭ 17 (-32%)
Mutual labels:  grid
graphstore
Fast in-memory graph structure, powering Gephi
Stars: ✭ 64 (+156%)
Mutual labels:  analysis
onelinerhub
2.5k code solutions with clear explanation @ onelinerhub.com
Stars: ✭ 645 (+2480%)
Mutual labels:  numpy
zAnalysis
zAnalysis是基于Pascal语言编写的大型统计学开源库
Stars: ✭ 52 (+108%)
Mutual labels:  analysis
sttp-model
Simple Scala HTTP model
Stars: ✭ 30 (+20%)
Mutual labels:  model
NDScala
N-dimensional arrays in Scala 3. Think NumPy ndarray, but type-safe over shapes, array/axis labels & numeric data types
Stars: ✭ 37 (+48%)
Mutual labels:  numpy
audiophile
Audio fingerprinting and recognition
Stars: ✭ 17 (-32%)
Mutual labels:  numpy
python demo
一些简单有趣的Python小Demo
Stars: ✭ 109 (+336%)
Mutual labels:  numpy
yii2-actionbar
A control bar with bulk actions for the GridView widget.
Stars: ✭ 32 (+28%)
Mutual labels:  grid
npbench
NPBench - A Benchmarking Suite for High-Performance NumPy
Stars: ✭ 40 (+60%)
Mutual labels:  numpy
tensorflow-stack-ts
TensorFlow.js Full-Stack Starter Kit
Stars: ✭ 33 (+32%)
Mutual labels:  model
natural-neighbor-interpolation
Fast, discrete natural neighbor interpolation in 3D on the CPU.
Stars: ✭ 63 (+152%)
Mutual labels:  numpy
hagrid
📏 Hagrid is a mixin library for responsive websites and web applications.
Stars: ✭ 30 (+20%)
Mutual labels:  grid

State Estimation and Analysis in PYthon (SEAPY)

Tools for working with ocean models and data.

SEAPY requires: basemap, h5py, joblib, netcdf4, numpy, numpy_groupies, rich and scipy.

Installation

Install from Conda-Forge

Install from conda-forge with the Conda package manager:

$ conda install -c conda-forge seapy

You should also consider making conda-forge your default channel. See the conda-forge tips and tricks page.

The Conda-Forge SEAPY feedstock is maintained by Filipe Fernandes, ocefpaf. As of February 2021 there are binary packages on all the platforms that Conda-Forge supports: Python 3.6 through 3.9 on Linux, Windows and Mac OSX (all 64-bit).

To remove seapy:

$ conda remove seapy

Install from PyPI

Install from PyPI with PIP:

$ pip install seapy-ocean

Note that on PyPI (but nowhere else) the package name is seapy-ocean to avoid a name clash with another package. The module name is still seapy.

SEAPY packages on PyPI have been built and uploaded by Mark Hadfield, hadfieldnz. There is a source distribution that should build with no problems on Linux (and Mac OSX, but we haven't tested it). In the pst there have been binary distributions for Windows (64-bit), but these have now been deleted as binary builds with PIP are no longer supported.

In a Conda environment, it is quite possible to install with PIP, but dependency handling and updating will be cleaner if you use the Conda package.

To remove seapy-ocean

$ pip uninstall seapy-ocean

Install from source code on GitHub.com

The SEAPY source code is maintained by Brian Powell, (powellb)[https://github.com/powellb]. Releases are made on the master branch

Install from GitHub.com with PIP:

$ pip install git+git://github.com/powellb/seapy@master

OR clone a copy of the source and install in editable mode, eg:

$ git clone https://github.com/powellb/seapy.git
$ pip install -e seapy

With an editable-mode installation, changes you make to your copy of the source code will take effect when you import the module.

In principle it is possible to build from source on Windows--and success with this has been achieved in the past--but the process tends to break with changes in the environment or Python version, so we don't recommend it or support it.

Contributing

If you've installed from source in editable mode, then you should definitely consider forking your own copy of the repository. This allows you to keep your changes under revision control on GitHub.com and potentially contribute them to the main project. You should follow the procedures described in this Git Workflow document.

Forking on GitHub.com is a lightweight process that won't complicate your workflow and keeps the relationship between your work and the original project clear, so it is strongly advised to do it early. However the immutable and unique nature of Git commits means that you can create and populate a fork later if you want to, as long as you have saved your work somewhere in Git format. To create a fork you will need a GitHub.com user account.

All your changes should be committed to a branch other than "master", which is reserved for the master branch in Brian Powell's repository (or copies thereof). A common practice in the existing SEAPY forks is to use a branch name matching your user name for your own work. However if you are developing a specific feature or bug fix to be pulled into master, it may be sensible to name the branch after that feature or bug fix.

Examples

Many of the time-saving features are in generating fields for running the ROMS model.

  1. To load the meta information about a model (ROMS, HYCOM, MITgcm, POM, SODA), load an output file (history, average, climatology, grid, etc.) via:

     >> mygrid = seapy.model.asgrid(filename)
    
     >> mygrid
     C-Grid: 32x194x294
    
     >> print(mygrid)
     filename
     32x194x294: C-Grid with S-level
     Available: I,J,_isroms,_nc,angle,cgrid,cs_r,depth_rho,depth_u,depth_v,dm,dn,eta_rho,eta_u,eta_v,f,filename,h,hc,lat_rho,lat_u,lat_v,lm,ln,lon_rho,lon_u,lon_v,mask_rho,mask_u,mask_v,n,name,pm,pn,s_rho,shape,spatial_dims,tcline,theta_b,theta_s,thick_rho,thick_u,thick_v,vstretching,vtransform,xi_rho,xi_u,xi_v
    
  2. Most methods available in SEAPY require a grid, which can be specified as a "filename" or as a grid object.

  3. Find out how to download global HYCOM data that will span my grid from 1/1/2015 through 5/1/2015:

     >> seapy.model.hycom.load_history("hycom_file.nc", start_time=datetime(2015,1,1),
                                      end_time=datetime(2015,5,1),
                                      grid=mygrid, load_data=False)
     ncks -v water_temp,salinity,surf_el,water_v,water_u -d time,352,352 -d lat,1204,1309 -d lon,2438,2603 http://tds.hycom.org/thredds/dodsC/GLBu0.08/expt_91.1 hycom_file.nc
    

This will display the 'ncks' command necessary to download the data. If you want to have SEAPY download it (not recommended due to server-speed), use 'load_data=True'.

  1. Once you have HYCOM data, interpolate it to your grid

     >> seapy.roms.interp.to_clim("hycom_file.nc", "my_clim.nc",
                       dest_grid=mygrid, nx=1/6, ny=1/6,
                       vmap={"surf_el":"zeta", "water_temp":"temp",
                       "water_u":"u", "water_v":"v", "salinity":"salt"})
    
  2. Generate boundary conditions from the climatology

     >> seapy.roms.boundary.from_roms("my_clim.nc", "my_bry.nc")
    
  3. Generate initial conditions from the climatology

     >> seapy.roms.initial.from_roms("my_clim.nc", "my_ini.nc")
    
  4. You now have what you need to run your model

  5. To set up data assimilation, download the raw observations (e.g., aviso_map_day1.nc, aviso_map_day2.nc, argo_day1.nc ). You can then process the data:

     >> dt = 400/86400       # time-step of the model in days
     >> aviso_gen = seapy.roms.obsgen.aviso_sla_map(mygrid, dt)
     >> aviso_gen.batch_files(seapy.list_files('.','aviso.*nc'), 'aviso_roms_#.nc')
     >> argo_gen = seapy.roms.obsgen.argo_ctd(mygrid, dt)
     >> obs = argo_gen.convert_file("argo_day1.nc")
     >> obs.to_netcdf("argo_roms_1.nc")
    
  6. Put all of the processed observations files together into a file for a given assimilation window

     >> seapy.roms.obs.merge_files(seapy.list_files('.*roms_[0-9]+.nc'), 'roms_obs_#.nc', np.arange([0, 10.1, 5]))
    

There are many more things that can be done, but these show some of the power available via simple commands.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].