两个netCDF文件的比较

编程入门 行业动态 更新时间:2024-10-27 12:29:25
本文介绍了两个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文件的比较

本文发布于:2023-10-22 09:17:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1517093.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:两个   文件   netCDF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!