On Mar 28, 7:54 am, Heinz Stege <public.215....@arcor.de> wrote:
> HiErini,
>
> it seems, that there are no other PV-Wave users in this group. I
> myself switched to IDL 5 years ago. :-) Before that I used PV-Wave
> for a long time. So I will try to help. See below.
>
>
>
>
>
>
>
>
>
> On Tue, 27 Mar 2012 10:43:40 -0700 (PDT),EriniLambrideswrote:
>> I get this error message:
>
>> % Internal error: Attempt to store into Temp variable with dynamic
>> allocation..
>> % Execution halted at COMPARE_TARGET_OFFSET2 <C:\wave_bin\pvpro
>> \elam_pro/compare_target_offset2.pro( 80)> (DC_WRITE_FREE).
>> % Called from $MAIN$ .
>
>> Right after the loop finishes its first iteration. This is the code:
>
>> loop4:
>> artar=fltarr(nfiles)
>> axc=fltarr(nfiles)
>> ayc=fltarr(nfiles)
>
>> for i=0, nfiles-1 do begin
>
>> spherecenter,aimg(*,*,1),rtar,xc,yc,1,1
>> artar(i)=rtar
>> axc(i)=xc
>> ayc(i)=yc
>
>> status= DC_WRITE_FREE('C:\Cryo\SphereCenterData
>> \referencetargetdata.txt',fnames(i),artar(i),/Column, $
>> Dt_Template=[1], Format="(A10, 1X, F4.2)")
>
>> endfor
>
>> fnames(i): String=Array(5)
>> artar(i):Float=Array(5)
>
> The error message from PV-Wave is not very helpful for me. So I played
> around a little with DC_WRITE_FREE. The following is working without
> errors. All tests with PV-WAVE Version 7.51 (i386nt Windows-NT 80x86):
>
> filename='Testfile_'+string(indgen(20),form='(i2.2)')+'.tmp'
> a='a'+strtrim(sindgen(10),2)
> b=findgen(10)
> info,dc_write_free(filename(0),a,b,/column)
> info,dc_write_free(filename(1),a,b(0),/column)
> a0=a(0)
> info,dc_write_free(filename(2),a0,b,/column)
> info,dc_write_free(filename(3),[a(0)],b,/column)
>
> But the following statement does not work. It throws the same error
> message as your code:
>
> info,dc_write_free(filename(4),a(0),b,/column)
>
> I don't really know why. As the error message says, it is an "Internal
> error". Does PV-Wave need to temporary write something into the
> parameter? The command with b(0) was working. DC_WRITE_FREE seems to
> make a difference between a scalar _string_ expression and a scalar
> _floating point_ expression.
>
> What is your intend with the Dt_Template=[1] keyword? As I understand
> the manual, it has to be used in combination with date/time data
> represented in the !DT structure format. Another question: Why don't
> you use PRINTF instead of DC_WRITE_FREE? I myself always felt happy
> with PRINTF (and WRITEU).
>
> Cheers, Heinz
Your suggestions worked perfectly! And I will continue to use Printf
from now on - I too now prefer this. I used the dc_functions simply
because that was suggested. It is my own fault for not trying my own
way first! Thank you very much!
-Erini Lambrides
|