GithubHelp home page GithubHelp logo

powellb / seapy Goto Github PK

View Code? Open in Web Editor NEW
28.0 28.0 20.0 2 MB

State Estimation and Analysis in Python

License: MIT License

Python 71.18% Fortran 28.82%
analysis grid model numpy oceanography roms

seapy's People

Contributors

hadfieldnz avatar ocefpaf avatar powellb 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

seapy's Issues

Segmentation fault in seapy.roms.interp.__interp_grids lines 261-314

I am trying to create a climatology file in seapy using a grid created using pyroms. I am getting a segmentation fault using Python 3.5.1 on OS X El Cap. I have traced the error as far as I can, and it appears to be coming from lines 261-314 in interp.py. It may be occurring in __interp2_thread or interp3_thread, but I am unfamiliar with joblib to troubleshoot any further. Can anybody else reproduce this? It might be caused by an error in my grid, but I thought I'd share the segmentation fault anyway. On a side note... Are there any plans for a Python 2.x version? I would love to be able to use this side-by-side with my pyroms installation. The output I am getting is below is repeated several times before Python quits. Thanks.

/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/numpy/lib/shape_base.py:873: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future return c.reshape(shape_out) /Users/redacted/src/seapy/roms/interp.py:90: UserWarning: nx or ny values are too large for stable OA, 71.000000 warn("nx or ny values are too large for stable OA, {:f}".format(ksize)) /Users/redacted/src/seapy/lib.py:195: MaskedArrayFutureWarning: setting an item on a masked array which has a shared mask will not copy the mask and also change the original mask array in the future. Check the NumPy 1.11 release notes for more information. fld[lst] = nfld[lst] / count[lst]

obs.x (and all others) wtr to python start 0 and fortan (ROMS) start 1?

Brian & Dale,
I am puzzled as when you call seapy gridder and use grid.ij (or grid.ijk) you have all indexes starting from 0 (as python counts)/ You need that when searching in the matrices etc. However, when putting all into netcdf we have to follow fortran which use start from 1. Is it possible that seapy created obs.x, .y, .z which are -1 from the one created before with matlab's obs_gridder? Should we in to_netcdf add obs.x += 1 (the same for y)?
Those are the only indexes, others are real locations, values...

Cheers,
Ivica

Build issues

Tried building as instructed with make all, but build failed -- couldn't find oalib.so.

Tried doing cd src; make oalib, which gave warnings:

oalib.F:832.28:

      call inverse(Gp,c,c,A,issing)
                            1
Warning: Type mismatch in argument 'issing' at (1); passed INTEGER(4) to REAL(8)
oalib.F:1114.28:

and failed to copy the existing oalib.so because it didn't get picked up by the regex:

cp oalib.*.so ../oalib.so
cp: cannot stat `oalib.*.so': No such file or directory

Same issue for hindices

Load HYCOM data issues

Hello, everyone
I am currently using SEAPy to make ROMS initial field and boundary field files. But when I run seapy.model.hycom.load_history("hycom_file.nc", start_time=datetime.datetime(2019,8,1), end_time=datetime.datetime(2019,8,31), grid=mygrid, url='http://tds.hycom.org/thredds/dodsC/GLBu0.08/expt_91.1', load_data=True).
Exception: Cannot find valid times.How da I solve this problem?
In addition I also have other problem is that run mygrid = seapy.model.asgrid('roms_sea.nc') warn (" could not compute grid depths. "). Will this error not affect my subsequent interpolation?

No module named 'seapy.external'

Hi,

Is there any suggestion to fix the following error message:

"/home/hugo/Pyroms_roms/seapy/seapy/oa.py", line 13, in
from seapy.external import oalib
ModuleNotFoundError: No module named 'seapy.external'

Thanks
Huy

tide.py and new numpy

in tide.py you should add option for pickle to be compatable with numpy 1.17+
line 25 I think:
with np.load(os.path.dirname(file) + "/constituents.npz", allow_pickle=True) as data:

otherwise install via conda is not working (if having updated numpy)

Cheers
Ivica

The exit codes of the workers are {SIGSEGV (-11)}

Hi, I'm currently using "seapy" to create boundaries, meteorology, and initial data for the ROMS model.
So I was working with reference to README.md,
At the stage of "4. Once you have HYCOM data, interpolate it to your grid", the following error occurs and I am in trouble.

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"})

Output

"joblib.externals.loky.process_executor.TerminatedWorkerError: A worker process managed by the executor was unexpectedly terminated. This could be caused by a segmentation fault while calling the function or by an excessive memory usage causing the Operating System to kill the worker.

The exit codes of the workers are {SIGSEGV (-11)} "

I think "seapy /seapy/roms/interp.py" is involved.

Can you tell me what to do?
thank you.

Question about observation netcdf file

Greetings

Recently our group switched from matlab to python using seapy package
for the pre-process of the observations that are need for ROMS 4DVAR
scheme (formerly PSAS now RBL4DVAR) . I am experiencing a weird
issue with the python processed observation file when i use it: During
the initialization of the first inner loop (outer = 001, inner =001 not 000)
although obs are not rejected ROMS doesn't read their values for the
first 12 hours and this - let's say - gap ends (obviously) to a blowup. Using
matlab processed file with the same datasets for observations model runs smoothly.
obs_error and obs_variance differ between the two files - I am setting
fixed error values for the state variables in the matlab scripts - but also
the number of observations is different, with the seapy produced file having
more compared to matlab's.

My experience with python is limited (now I am learning) and I am trying to understand
why this is happening but I had no luck. Any help or insight will be highly appreciated.

I also am using the matlab scripts from https://www.myroms.org/svn/src/matlab to create the
observation file.

Kind Regards

Giannis Mamoutos

Extreme momentum values created in boundary file

I've created a climatology file using seapy as:

seapy.roms.interp.to_clim(base_dir + "hycom_file.nc",
                          dest_file=base_dir + "my_clim.nc",
                          dest_grid=mygrid, nx=1/25., ny=1/25.,
                          vmap={"zeta":"zeta", "temp":"temp",
                          "u":"u", "v":"v", "salt":"salt"})

Strangely, an ncdump of the climatology file reveals the first couple of lines of data (near the masked data) for ubar and v_bar have some extreme values (e.g., -54,000). Does anyone have any idea of what I might be doing wrong?

Seapy superobs not considering ROMS cell-edges!?

Hi,

It appears that Seapy is not considering the C-staggering locations:

seapy_mur_sst_mapping

A bigger view:
seapy_mur_sst_mapping_rho_geo

Clearly, the code is superobing where it shouldn't. Looks like the cell edges are not taking into account. An offset is missing by the above behaviour.

raw data source: JPLMUR
pseudo code:

 file=mur_file
 otype = seapy.roms.obsgen.ostia_sst_map(grid_file, grid_dt)
 obs = otype.convert_file(file)
 obs.to_netcdf(outfile)

Import of setup duplicated in setup.py

In setup.py on the master branch at lines 6 & 7, the setup function is imported twice.

from setuptools import find_packages, setup
from numpy.distutils.core import setup

The effect of the second import is to replace the first. This gives the correct behaviour (as numpy.distutils.core is the one required) but is potentially confusing. I recommend

from setuptools import find_packages
from numpy.distutils.core import setup

Priority is low as there is no change in function. I have not prepared a PR.

seapy/lib.py

should have in line 25
_default_timeref = "days since " + default_epoch.strftime("%Y-%m-%d %H:%M:%S")
instead
_default_timeref = "days since " + default_epoch.strftime("%Y-%m-%m %H:%M:%S")

You have %m and should be %d for day ...
Ivica

P.S. Not sure if you have it on other places as well

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.