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 
Return to the default flat view Create a new topic Submit Reply
Re: truncation when reading variables from netcdf file? [message #77613] Thu, 15 September 2011 20:33 Go to previous message
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.")
[Message index]
 
Read Message
Read Message
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 19:50:54 PDT 2025

Total time taken to generate the page: 0.00585 seconds