array of structures -- error Conflicting data structures [message #93826] |
Tue, 01 November 2016 03:31  |
gunvicsin11
Messages: 93 Registered: November 2012
|
Member |
|
|
Hi all,
I need to create an array of structures,
I have created structure like this, I have put this in a loop
create_struct,ca,'ksom',['DATA','XC','YC','DX','DY','TIME'], 'd(767,684),d(1),d(1),d(1),d(1),a(1)'
ksom=replicate(ca,6)
im getting error like this,
Conflicting data structures: KSOM,<STRUCT Array[1]>.
can anyone let me know what is the problem here.
thanks
|
|
|
Re: array of structures -- error Conflicting data structures [message #93827 is a reply to message #93826] |
Tue, 01 November 2016 06:21  |
dcleuclidwl
Messages: 6 Registered: July 2016
|
Junior Member |
|
|
You don't show us what is in your loop but I suspect you are trying to change a named structure, which is forbidden.
For example, if you create a structure and name it 'ksom'
create_struct,ca,'ksom',['DATA','XC','YC','DX','DY','TIME'], 'd(767,684),d(1),d(1),d(1),d(1),a(1)'
ksom=replicate(ca,6)
then you cannot later define a structure named 'ksom' with a different sized array.
IDL> create_struct,ca,'ksom',['DATA','XC','YC','DX','DY','TIME'], 'd(245,839),d(1),d(1),d(1),d(1),d(1)'
% Conflicting data structures: <DOUBLE Array[767, 884]>,KSOM.
I suspect you want to use an anonymous structure (use '' instead of 'ksom' ) though you could also use a different name each time the structure definition changes.
(Note that the procedure CREATE_STRUCT is not native to IDL
http://idlastro.gsfc.nasa.gov/ftp/pro/structure/create_struc t.pro
though the *function* CREATE_STRUCT() is. ) --Wayne
On Tuesday, November 1, 2016 at 6:31:02 AM UTC-4, sid wrote:
> Hi all,
> I need to create an array of structures,
> I have created structure like this, I have put this in a loop
>
> create_struct,ca,'ksom',['DATA','XC','YC','DX','DY','TIME'], 'd(767,684),d(1),d(1),d(1),d(1),a(1)'
>
> ksom=replicate(ca,6)
>
>
> im getting error like this,
> Conflicting data structures: KSOM,<STRUCT Array[1]>.
>
>
> can anyone let me know what is the problem here.
>
> thanks
|
|
|