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

Home » Public Forums » archive » plotting missing values
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: plotting missing values [message #86798 is a reply to message #86797] Wed, 04 December 2013 07:45 Go to previous messageGo to previous message
Fabzi is currently offline  Fabzi
Messages: 305
Registered: July 2010
Senior Member
Hi David,

On 04.12.2013 16:41, David Fanning wrote:
> Does anyone know if there is a simple test I can perform in IDL
> to tell if the file is a netCDF3 as opposed to a netCDF4 file?

I had a support request on this a couple of months ago. It will be
included in IDL 8.3, I've been told. In the mean time they gave me
following code, which works:

;+
; :Description:
; Checks the format of a NCDF file without opening it
; (CLASSIC, 64BIT or NETCDF4)
;
; :Returns:
; A string::
; - 'FORMAT_CLASSIC'
; - 'FORMAT_64BIT'
; - 'FORMAT_NETCDF4'
; - 'Unknown'
;
; :Params:
; filename: in, string
; the path to the file to check
;
; :Author: Anonymous Developer from Exelis
;-
function w_ncdf_format, filename

ON_ERROR, 2

openr, unit, filename, /get_lun
data = bytarr(4)
readu, unit, data
free_lun, unit

case string(data) of
string([67b, 68b, 70b, 1b]): return, 'FORMAT_CLASSIC'
string([67b, 68b, 70b, 2b]): return, 'FORMAT_64BIT'
string([137b, 72b, 68b, 70b]): return, 'FORMAT_NETCDF4'
else: return, 'UNKNOWN'
endcase

end
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: 3D VOLUME VISUALIZATION
Next Topic: RETURN

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

Current Time: Wed Oct 08 15:17:44 PDT 2025

Total time taken to generate the page: 0.00454 seconds