Question

I am trying to read in a .gda file into IDL for plotting purposes. I am not familiar with the format and my research indicates it is an unformatted binary data file type. Anyways, here is what I am doing:

pro omidi_contour
openr, 1, 'data.gda'
a = fltarr(128,128,128)
readu, 1, a
close, 1
end

However when I look at the variable definition at the left panel of IDL, it indicates that a is 'undefined'. When I try to print:

print, a[0,0,0]

I get:

Variable is undefined: A

How can I solve this?

No correct solution

OTHER TIPS

I found out that there was nothing wrong with my program. It was reading the right values from the file. However, the IDL "forgot" the value of the variables once the program was done. Solution: DO not run this as a program i.e. remove the following lines:

pro omidi_contour
end

This makes the code to run as if each line were typed into the IDL prompt and IDL does remember the values this time round.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top