两个netCDF文件的比较 [英] Comparison of two netCDF files

查看:64
本文介绍了两个netCDF文件的比较的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理netCDF文件,并且在每个步骤中我都想验证我的温度变量的值是否相同.在每次修改时,我都会保存一个新文件,并使用R运行此文件:

I am working on netCDF files and at each step I want to verify that the value of my temperature variable is the same. At each modification I save a new file and with R I am running this:

for (i in 1: (dim(time1)*dim(long1)*dim(lat1))) {if(var1[i] != var2[i]) {stop(paste("Not the same values",i))}}

Var1是我的第一个文件的温度,而var2是我的第二个文件(修改后的文件)的温度

Var1 is the temperature of my first file and var2 is the temperature of my second file (the modified one)

当我将温度短的文件与温度短于浮点的文件进行比较时,我收到一条消息不同的值",而该文件是相同的值(粘贴时可以看到).

I have a message "Not the same values" when I compare a file with temperature as short to a file with temperature as float whereas it is the same value (I can see it when I paste it).

这正常吗,如何验证修改后的文件中的值是否存在问题?

Is it normal and how can I verify if there is a problem of values on my modified file?

推荐答案

感谢您的评论,我更改为

Thanks for the comment, I change to

for (i in 1: (dim(time1)*dim(long1)*dim(lat1))) {if(all.equal(var1[i], var2[i]) == FALSE) {stop(paste("Pas les mêmes valeurs",i))}}

效果很好

这篇关于两个netCDF文件的比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆