comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: truncation when reading variables from netcdf file?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: truncation when reading variables from netcdf file? [message #77613] Thu, 15 September 2011 20:33
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Ashley Berg writes:

> When reading a variable from a netcdf file in IDL, does IDL truncate
> the numbers when it saves them into an array? For example, I am
> reading in a floating array from a netcdf file, and the numbers in the
> file all go to 16 decimal places. I save the numbers into a double
> array, but even double-precision numbers only go to about 14 decimal
> places, right?

If you ask a computer to print a number to 16 or 32
or 48 decimal places, it will happily do so. Now,
whether those number MEAN anything or not, is
another question entirely.

If you have doubles in your file, and you read them
as doubles, you will have no problems. If you have
floats and read them as floats, you will also be
fine. :-)

Many IDL programmers start their journey into numbers
by starting with this article and proceeding from
there:

http://www.idlcoyote.com/math_tips/sky_is_falling.html

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: truncation when reading variables from netcdf file? [message #77614 is a reply to message #77613] Thu, 15 September 2011 19:11 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Sep 15, 10:32 pm, Ashley Berg <ashley.b...@gmail.com> wrote:
> When reading a variable from a netcdf file in IDL, does IDL truncate
> the numbers when it saves them into an array?  For example, I am
> reading in a floating array from a netcdf file, and the numbers in the
> file all go to 16 decimal places.  I save the numbers into a double
> array, but even double-precision numbers only go to about 14 decimal
> places, right?

Can IDL even read a datatype that is not one of the standard types?
The standard types need no conversion, since there are identical
correspondents in IDL.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: truncation when reading variables from netcdf file?
Next Topic: Re: cgAxis labels in different orientation in PS than on screen

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:43:05 PDT 2025

Total time taken to generate the page: 0.00553 seconds