質問

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?

正しい解決策はありません

他のヒント

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top