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

Home » Public Forums » archive » CDF question
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
CDF question [message #5405] Wed, 27 December 1995 00:00 Go to next message
thompson is currently offline  thompson
Messages: 584
Registered: August 1991
Senior Member
Please excuse me if this is a little outside the scope of this newsgroup, but I
couldn't find one specifically for Common Data Format.

I'm reading some FITS binary table files that were converted from CDF format.
The original CDF files have descriptions such as

!----------------------------------------------------------- --
! Variable Data Number Record Dim
! Name Type Elements Variance Variance
! ------- ---- -------- -------- --------
"LAT_SPACE" CDF_REAL8 1 T F

! Attribute Data Value
! Name Type
!----------- ----- ------
"FIELDNAM" CDF_CHAR { "Heliographic Lat of the Craft" }
"VALIDMIN" CDF_REAL8 { -1.570796327 }
"VALIDMAX" CDF_REAL8 { 1.570796327 }
"SCALEMIN" CDF_REAL8 { -1.570796327 }
"SCALEMAX" CDF_REAL8 { 1.570796327 }
"LABLAXIS" CDF_CHAR { "Helio Lat" }
"UNITS" CDF_CHAR { "rad" }
"FORMAT" CDF_CHAR { "F7.3" }
"DEPEND_0" CDF_CHAR { "Epoch" }
"FILLVAL" CDF_REAL8 { -1.0E31 }
"VAR_TYPE" CDF_CHAR { "data" }
"DICT_KEY" CDF_CHAR { " " }.

It appears that the data in the FITS binary table file has the same resolution
as that given in the FORMAT statement, rather than the full resolution of the
Real*8 data type. In the above example, the numbers are quantized to 0.001
radians, even though the double precision numbers are theoretically much more
precise than this.

I'm not very familiar with CDF, so I have some simple questions:

1. Are all CDF files written out to the resolution given by the FORMAT
statement? Or is there a mode of writing CDF files that automatically
applies this quantization?

2. If not, is it possible that the process of reading the CDF file
unintentionally quantized the values? In other words, is there a mode of
reading CDF files that automatically applies this quantization?

3. Failing the above two possibilities, is it standard practice for CDF files
written by some of the groups here at Goddard to write out data to a
quantization given by the FORMAT specification.

Please excuse these possibly naive questions.

Thank you,

Bill Thompson
Re: CDF question [message #14930 is a reply to message #5405] Mon, 12 April 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Harald Frey (hfrey@ssl.berkeley.edu) writes:

> I found at least the solution for the first problem. In some way IDL is
> sensitive to upper/lower case
> statements in that case. I have a variable in the cdf-file 'EPOCH'.
>
> IDL> print,!version
> { sparc sunos unix 5.1 Apr 13 1998}
> IDL> id=cdf_open('WIC')
> IDL> result2=cdf_varinq(id,1)
> IDL> print,result2.name
> EPOCH
> IDL> var=result2.name
> IDL> cdf_control,id,variable=var,get_var_info=info
> IDL> help,info,/struc
> ** Structure <83850>, 7 tags, length=28, refs=1:
> EXTENDRECS LONG 0
> MAXALLOCREC LONG 3
> MAXREC LONG 3
> MAXRECS LONG 3
> NINDEXENTRIES LONG 2
> NINDEXRECORDS LONG 1
> PADVALUE INT 0
>
> Everything works in this case. However, if I specify the variable var in
> lower

File names on UNIX systems are *always* case sensitive.
And string comparisons in IDL are *always* case sensitive,
since an uppercase letter has a different ASCII value than
a lowercase letter.

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: CDF question [message #14933 is a reply to message #5405] Mon, 12 April 1999 00:00 Go to previous message
Harald Frey is currently offline  Harald Frey
Messages: 41
Registered: March 1997
Member
Harald Frey wrote:

> I started working with CDF files and encountered two problems/questions.
>
> 1.
> IDL> id=cdf_open('WIC')
> IDL> cdf_control,id,variable='epoch',get_var_info=info
> % CDF_CONTROL: Must specify a variable via VARIABLE keyword.
> % Execution halted at: READ_THE_WIC_CDF 26 read_the_wic_cdf.pro
> % $MAIN$
>
> I think I have specified a variable 'epoch'?
>
> 2. I have several variables in a CDF record of different size (2D
> arrays, single numbers etc.). The procedure CDF_VARGET requires keywords
> interval and offset. How do I specify these vectors in a universal
> manner?
>
> I would very much appreciate getting an example program.
>
> Harald Frey
> Space Sciences Laboratory
> UC Berkeley
>
> hfrey@ssl.berkeley.edu

I found at least the solution for the first problem. In some way IDL is
sensitive to upper/lower case
statements in that case. I have a variable in the cdf-file 'EPOCH'.

IDL> print,!version
{ sparc sunos unix 5.1 Apr 13 1998}
IDL> id=cdf_open('WIC')
IDL> result2=cdf_varinq(id,1)
IDL> print,result2.name
EPOCH
IDL> var=result2.name
IDL> cdf_control,id,variable=var,get_var_info=info
IDL> help,info,/struc
** Structure <83850>, 7 tags, length=28, refs=1:
EXTENDRECS LONG 0
MAXALLOCREC LONG 3
MAXREC LONG 3
MAXRECS LONG 3
NINDEXENTRIES LONG 2
NINDEXRECORDS LONG 1
PADVALUE INT 0

Everything works in this case. However, if I specify the variable var in
lower
case letters, then I get this stupid and misleading error message.

IDL> var='epoch'
IDL> cdf_control,id,variable=var,get_var_info=info
% CDF_CONTROL: Must specify a variable via VARIABLE keyword.
% Execution halted at: $MAIN$

I don't fully understand this behaviour. Maybe it's UNIX related? But
cdf-files
should be platform compatible. However, I found my way around it and don't
care
much more.

Harald
Re: CDF question [message #15025 is a reply to message #5405] Mon, 12 April 1999 00:00 Go to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Harald Frey (hfrey@ssl.berkeley.edu) writes:


> I agree, that string comparisons are case sensitive. However, the online
> documentation for cdf_control:

Oh, well, on-line documentation...

This is not my favorite subject right at the moment. :-(

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
Re: CDF question [message #15026 is a reply to message #5405] Mon, 12 April 1999 00:00 Go to previous message
Harald Frey is currently offline  Harald Frey
Messages: 41
Registered: March 1997
Member
David Fanning wrote:

>
> File names on UNIX systems are *always* case sensitive.
> And string comparisons in IDL are *always* case sensitive,
> since an uppercase letter has a different ASCII value than
> a lowercase letter.
>
> Cheers,
>
> David
> --

I agree, that string comparisons are case sensitive. However, the online
documentation for cdf_control:

> VARIABLE
> Set this keyword to a name or index to set the current variable. For
example,
>
> CDF_CONTROL, id, VAR='MyData', SET_INITIALRECS=20
>
> specifies that the variable MyData should have 20 records written to it
initially.

did not sound like a string comparison to me.

Harald
hfrey@ssl.berkeley.edu
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: spline_p help
Next Topic: CW_PDMENU, changing

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

Current Time: Wed Oct 08 13:33:29 PDT 2025

Total time taken to generate the page: 0.00901 seconds