Skip to content

ESMF conservative blending when you have missing values #231

Description

@doutriaux1

I'm using the following cdms2 on Linux
cdms2 2.12.2018.02.22.17.40.g09431cb.npy1.13 py27_0 uvcdat/label/nightly

@gleckler1 @durack1 feel free to chime in

code:

from __future__ import print_function
import cdms2, vcs, MV2
import os

data = cdms2.open("data.nc")("ta")
print(data.shape)

tmp = cdms2.open("sft.nc")
sft = tmp("sftlf")
tmp.close()

data2 = MV2.masked_where(MV2.less(sft,50.),data)

tGrid = cdms2.createUniformGrid(-88.875, 72, 2.5, 0, 144, 2.5)
x=vcs.init()
for mthd in ["conservative", "linear"]:
    print("USING REGRID METHOD:",mthd)
    data3 = data2.regrid(tGrid, regridTool="esmf", regridMethod=mthd)
    print("pltting")
    x.plot(data3)
    print("pnging")
    x.png("masked_{}".format(mthd))
    print("clearing")
    x.clear()

produce:
masked_conservative
masked_linear

Data files:

data.zip

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions