문제

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