Skip to content

Unexpected values obtained when reading in data using ncdf and ncdf4

1 message · Louise Mair

#
Hi Dave, Roy and R-users,

Many thanks for your suggestions - in later correspondence Dave suggested that I ask the data provider to run a md5 checksum on the problem files, and compare their results against a md5 checksum on my copies of the files. Having done this, I found that the results didn't match (which they should do if the files were identical), and so this indicated that some corruption must have occurred during the file transfer.

Unfortunately we haven't discovered the source of the problem, but it was very helpful to learn how to compare files and identify the problem, so thanks very much for your help!

Best wishes,
Louise




-----Original Message-----
From: Roy Mendelssohn - NOAA Federal [mailto:roy.mendelssohn at noaa.gov] 
Sent: den 22 april 2016 17:31
To: Louise Mair
Cc: r-help at r-project.org; David W. Pierce
Subject: Re: [R] Unexpected values obtained when reading in data using ncdf and ncdf4

Hi Louise:

If Dave can?t figure it out, I can give a look also.  A couple of things I would suggest:

1.  Don?t use the name ?data? in the nc_open command, that is a reserved command in R and you never know what problems that can cause.

2. You are doing calculations to get set the start and count values in the ncvar_get commands, print those values out before you make the calls to make certain they are valid.

HTH,

-Roy
**********************
"The contents of this message do not reflect any position of the U.S. Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new address and phone***
110 Shaffer Road
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: Roy.Mendelssohn at noaa.gov www: http://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected" 
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.