简体   繁体   English

更改 netCDF4 文件中的纬度值

[英]Changing Latitude Values in a netCDF4 file

I am a climate science student who is still relatively new to the netcdf4 world, and I am seriously struggling with a very tiny thing.我是一名气候科学专业的学生,​​对 netcdf4 世界仍然相对较新,我正在认真地为一件非常小的事情苦苦挣扎。 Any help is greatly appreciated!任何帮助是极大的赞赏!

I was given this nc file with dimensions latitude, longitude, class, but the latitude range is (0,180,1) instead of (-90,90,1).我得到了这个 nc 文件,其中包含维度纬度、经度、类,但纬度范围是 (0,180,1) 而不是 (-90,90,1)。 This means that any mapping is pretty much impossible, especially since I am working with another dataset that has the same grid size, but proper coordinates.这意味着任何映射几乎都是不可能的,特别是因为我正在使用另一个具有相同网格大小但坐标正确的数据集。 I have tried creating a new netcdf4 with correct latitude values and passing the variable through, but it doesn't work.我尝试使用正确的纬度值创建一个新的 netcdf4 并传递变量,但它不起作用。 Does anyone know how to fix this?有谁知道如何解决这一问题?

Thank you!谢谢!

在此处输入图片说明

Did you try你试过了吗

ds['lat'] = ds['lat']-90
display(ds)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM