Skip to content

Instantly share code, notes, and snippets.

@Try2Code
Created July 8, 2020 11:34
Show Gist options
  • Save Try2Code/12a285584bc9c1067e57e7b66eeff4df to your computer and use it in GitHub Desktop.
Save Try2Code/12a285584bc9c1067e57e7b66eeff4df to your computer and use it in GitHub Desktop.
How to use CDO inside Julia
# {{{ some steps before
# import Pkg
# Pkg.add("PyCall")
# }}}
using PyCall
pycdo = pyimport("cdo")
cdo = pycdo.Cdo()
print(cdo.topo())
numpy_data = cdo.topo(;returnArray="topo")
#print(numpy_data)
xarray_data = cdo.topo(;returnXArray="topo")
#print(xarray_data)
# chains
masked_data = cdo.setrtomiss(-100000,0;input="-expr,'logTopo=log(abs(topo)+0.1)' -topo,r10x10", returnArray="logTopo")
print(masked_data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment