Hi Nikita,

On line 91 you define `rply` to be a list of 16 empty lists, then on
line 148 you try to write in a loop to 64 elements of `rply`. But
there are only 16, so your script errors.

As an aside, you could achieve the same as:
rply = [[],[],[], ....]
with
rply = [[] for i in range(16)]
which would be somewhat more reader-friendly.

Even better is probably to use a multi-dimensional numpy array, for
this and all the Xcomplex_NN variables. Then you could do things like
2's complement conversion in one hit:

my_array[my_array > (2**31 -1)] -= 2**32

For what it's worth, if you use the katcp_wrapper python package (part
of the corr library), or casperfpga it might be easier to get data
than using the katcp library directly. katcp_wrapper.FpgaClient.read()
returns a binary string which you can directly interpret as 2's
complement using struct.unpack with the '>l' format specifier (see
https://docs.python.org/2/library/struct.html) or using numpy's
frombuffer function. (see
https://github.com/casper-astro/tutorials_devel/blob/master/ise/roach2/tut_spec/roach2_tut_spec.py
for a casperfpga example, or
https://github.com/casper-astro/tutorials_devel/blob/v2012/tut3/tut3.py
for a katcp_wrapper example)
In fact, casperfpga is smart enough that if you use a snapshot block
in your design and appropriately set the data type to signed in
simulink, your python will auto-magically interpret the data
correctly.

Hope that helps,

Cheers
Jack

On Fri, 30 Aug 2019 at 07:04, 'Nikita Rathore' via
[email protected] <[email protected]> wrote:
>
> Dear Casperites
>
> I am working on Roach2 and 5Gsps ADC1x5000-8.
>
> During data acquisition for 4 element interferometer I am having following 
> issue in python code. I want to plot and record all the 6 baselines at a time 
> from a single python file.
>
> please find the attached python code file.
>
> Kindly help me to sort out that issue.
>
> root@casper:~/4element_code# python corr_plotting_4element.py 192.168.100.192 
> 30augc_12_cang 30augc_12_camp 30augc_13_cang 30augc_13_camp 30augc_14_cang 
> 30augc_14_camp 30augc_23_cang 30augc_23_camp 30augc_24_cang 30augc_24_camp 
> 30augc_34_cang 30augc_34_camp
> dumping file is missing
> Traceback (most recent call last):
>   File "corr_plotting_4element.py", line 148, in updatefig
>     rply[input]     = map(eval, reply.arguments[1:n_chans/8+1])
> IndexError: list assignment index out of range
> Done with all
>
>
> Thanks & Regards
> Nikita Rathore
>
> --
> You received this message because you are subscribed to the Google Groups 
> "[email protected]" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CAOvmUY787FyLpGGLSDzEQAjZrg9-%2BKDLV1S11zTEk91B0oQEew%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"[email protected]" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/lists.berkeley.edu/d/msgid/casper/CAG1GKSkynVGtVOu8SzJ%3DYJjfk4E7GJrH79kR0X4%3DY11jf45bfg%40mail.gmail.com.

Reply via email to