GithubHelp home page GithubHelp logo

cdr30 / rapidmoc Goto Github PK

View Code? Open in Web Editor NEW
20.0 4.0 8.0 5.62 MB

Calculates observational-style decomposition of AMOC using output from an ocean general circulation model.

License: Other

Python 99.10% Shell 0.90%
amoc

rapidmoc's People

Contributors

cdr30 avatar cdr30ec avatar willirath avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

rapidmoc's Issues

Section interpolation and masking.

Running run_rapidmoc.py on output from various models on their native grids, for some models the program fails and returns:

`

thetao: using mask information from {DATA_LOC}/thetao_RAW.nc.

so: using mask information from {DATA_LOC}/so_RAW.nc.

tauuo: using mask information from {DATA_LOC}/tauuo_RAW.nc.

vo: using mask information from {DATA_LOC}/vo_RAW.nc.

Traceback (most recent call last):

File "{CODE_LOC}/RapidMoc/run_rapidmoc.py", line 16, in <module>

main()

File "{CODE_LOC}/RapidMoc/rapidmoc/rapidmoc.py", line 112, in main

t_on_v = sections.interpolate(t, v)

File "{CODE_LOC}RapidMoc/rapidmoc/sections.py", line 446, in interpolate

sinterp.data = np.ma.MaskedArray(s1.interp_along_section(dist, x0, y0), mask=mask)    

File "{PYTHON_LOC}/lib/python3.9/site-packages/numpy/ma/core.py", line 2909, in __new__

raise MaskError(msg % (nd, nm))

numpy.ma.core.MaskError: Mask and data not compatible: data size is 3061620, mask size is 1270200.

`

Has anyone had experience with this error? It works on some models and not others, but it's not clear why.

Thank you for your help in advance!

netCDF4/num2date and matplotlib

I'm experiencing an issue by which pcolormesh fails due to the dts array having type real_datetime. From looking around it seems this is due to a change in netCDF4 where num2date previously returned datetime objects but now returns real_datetime objects, which matplotlib has issues with.

The following workaround seems to patch things up (in plotdiag.py):

import cftime; import datetime; matplotlib.units.registry[cftime.real_datetime] = matplotlib.units.registry[datetime.datetime]

but is a bit clunky.

Error related to time coordinate

Hi Thanks for the package.
I am facing some issue with the time dimension of my model output data.

Traceback (most recent call last):
  File "/home/dass/miniconda3/bin/run_rapidmoc.py", line 8, in <module>
    sys.exit(main())
  File "/home/dass/miniconda3/lib/python3.10/site-packages/rapidmoc/rapidmoc.py", line 106, in main
    t = sections.ZonalSections(args.tfile, config, 'temperature')
  File "/home/dass/miniconda3/lib/python3.10/site-packages/rapidmoc/sections.py", line 79, in __init__
    self._read_tcoord()
  File "/home/dass/miniconda3/lib/python3.10/site-packages/rapidmoc/sections.py", line 411, in _read_tcoord
    t = nc.variables[self.tcoord]
KeyError: 'Time_in_years'

I am also attaching the config file here. Please tale a look.

config_veros.txt

Missing pandas and error with TKAgg within matplot

Hi, thanks for sharing this nice tool package!

However, I found two issue before I can run this package:

  1. missing the pandas package
  2. error with the TkAgg:
Traceback (most recent call last):
  File "plot_rapid_regions.py", line 17, in <module>
    matplotlib.use("TkAgg")
  File "/nird/home/yanchun/.local/lib/python3.8/site-packages/matplotlib/__init__.py", line 1171, in use
    plt.switch_backend(name)
  File "/nird/home/yanchun/.local/lib/python3.8/site-packages/matplotlib/pyplot.py", line 284, in switch_backend
    raise ImportError(
ImportError: Cannot load backend 'TkAgg' which requires the 'tk' interactive framework, as 'headless' is currently running

The first can be easily fixed by install the pandas, and would you suggest how to fix the second issue? many thanks!

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.