State Estimation and Analysis in PYthon (SEAPY)
Tools for working with ocean models and data.
SEAPY requires: numpy, scipy, netCDF4, joblib, and numpy_groupies
Installation
The simplest way to install is:
pip install git+git://github.com/powellb/seapy@master
If you wish to have a copy of the source locally:
git clone https://github.com/powellb/seapy.git
python setup.py install
Examples
Many of the time-saving features are in generating fields for running the ROMS model.
-
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 -
Most methods available in SEAPY require a grid, which can be specified as a "filename" or as a grid object.
-
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'.
-
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"}) -
Generate boundary conditions from the climatology
>> seapy.roms.boundary.from_roms("my_clim.nc", "my_bry.nc") -
Generate initial conditions from the climatology
>> seapy.roms.initial.from_roms("my_clim.nc", "my_ini.nc") -
You now have what you need to run your model
-
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") -
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.
Metadata
Release files for seapy-ocean 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| seapy-ocean-0.4.2.tar.gz | 866.6 kB | Without provenance | Details for seapy-ocean-0.4.2.tar.gz |
Release files / seapy-ocean-0.4.2.tar.gz
| Download URL | seapy-ocean-0.4.2.tar.gz |
|---|---|
| Size | 866.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
75911efa6583fdd0b7d463804201e929c6f37bf8b134e794046e892e60d50857
|
|
BLAKE2b-256 checksum How to use checksums |
2933a2226c8f582a7e7d0825784205a62207977182e54413817022ad5bc23f7e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3
|
Security for seapy-ocean 0.4.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.