JiaweiZhuang / xESMF

Universal Regridder for Geospatial Data
http://xesmf.readthedocs.io/
MIT License
269 stars 49 forks source link

Unexpected zeros, how to fix #139

Closed amhayes231 closed 1 month ago

amhayes231 commented 1 month ago

Hello there.

I am very new to this sort of work so please bare with me as I try to explain the problem.

I am trying to re-grid WeatherBench dataset so it can be use as initial conditions in climt, as the gridding used in the library is fixed. When doing this, I get the xarry output shown below. Is there a way to fix these zeros. as when plotting there are some awful dark lines at lat 0/360 and lon 0/360. Thank you!


           0.     ],
        [249.07079, 249.23625, 249.39664, ..., 248.30995, 248.97206,
           0.     ],
        [249.8731 , 250.43744, 250.99388, ..., 247.95566, 249.50568,
           0.     ],
        ...,
        [251.01794, 250.19962, 249.37428, ..., 251.45857, 251.20822,
           0.     ],
        [249.57549, 249.13432, 248.68864, ..., 250.00685, 249.79906,
           0.     ],
        [  0.     ,   0.     ,   0.     , ...,   0.     ,   0.     ,
           0.     ]],

       [[  0.     ,   0.     ,   0.     , ...,   0.     ,   0.     ,
           0.     ],
        [249.1897 , 249.49762, 249.7991 , ..., 248.26341, 248.9325 ,
           0.     ],
        [250.1836 , 251.02092, 251.84824, ..., 247.92688, 249.49313,
           0.     ],
        ...,
        [250.94585, 250.14336, 249.33374, ..., 251.25426, 251.05084,
           0.     ],
        [249.43013, 249.05954, 248.68436, ..., 249.85004, 249.64256,
           0.     ],
        [  0.     ,   0.     ,   0.     , ...,   0.     ,   0.     ,
           0.     ]],

       [[  0.     ,   0.     ,   0.     , ...,   0.     ,   0.     ,
           0.     ],
        [249.31895, 249.77692, 250.22723, ..., 248.18008, 248.85457,
           0.     ],
        [250.47346, 251.59164, 252.6979 , ..., 247.86766, 249.43134,
           0.     ],
        ...,
        [251.05522, 250.24855, 249.43376, ..., 251.25182, 251.11485,
           0.     ],
        [249.44243, 249.0159 , 248.58418, ..., 249.69443, 249.55557,
           0.     ],
        [  0.     ,   0.     ,   0.     , ...,   0.     ,   0.     ,
           0.     ]],

       ...,

       [[  0.     ,   0.     ,   0.     , ...,   0.     ,   0.     ,
           0.     ],
        [251.82098, 251.93687, 252.05707, ..., 251.48468, 251.8086 ,
           0.     ],
        [250.96822, 250.91722, 250.87294, ..., 251.37859, 251.78407,
           0.     ],
        ...,
        [250.22952, 249.27382, 248.30455, ..., 252.40129, 251.52245,
           0.     ],
        [247.7297 , 247.20844, 246.67844, ..., 249.03806, 248.50201,
           0.     ],
        [  0.     ,   0.     ,   0.     , ...,   0.     ,   0.     ,
           0.     ]],

       [[  0.     ,   0.     ,   0.     , ...,   0.     ,   0.     ,
           0.     ],
        [251.73138, 251.81941, 251.91237, ..., 251.37039, 251.6436 ,
           0.     ],
        [250.62425, 250.64851, 250.68048, ..., 251.3096 , 251.44734,
           0.     ],
        ...,
        [250.1542 , 249.20566, 248.24295, ..., 251.97887, 251.17451,
           0.     ],
        [247.57036, 247.05243, 246.52542, ..., 248.73785, 248.22661,
           0.     ],
        [  0.     ,   0.     ,   0.     , ...,   0.     ,   0.     ,
           0.     ]],

       [[  0.     ,   0.     ,   0.     , ...,   0.     ,   0.     ,
           0.     ],
        [251.7617 , 251.84221, 251.92844, ..., 251.41685, 251.66629,
           0.     ],
        [250.47476, 250.48363, 250.50143, ..., 251.21722, 251.31245,
           0.     ],
        ...,
        [250.03438, 249.10783, 248.16696, ..., 251.59381, 250.87312,
           0.     ],
        [247.42627, 246.9284 , 246.42133, ..., 248.43564, 247.97375,
           0.     ],
        [  0.     ,   0.     ,   0.     , ...,   0.     ,   0.     ,
           0.     ]]], dtype=float32)```
amhayes231 commented 1 month ago

Nevermind I had "bilinear" not "conservative" in the regridding function. Sorry!