DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Transform an Matrix from INCA to a DIAdem Matrix

Hello,

I've the problem to trnasform the following Matrix I get from INCA

float y \ x 700 800 1.000 1.300 1.600
0,4 0,0000 0,0000 0,0000 0,0000 0,0000
0,5 0,0000 0,0000 0,0000 0,0000 0,0000
0,6 0,0000 0,0000 0,0000 0,0000 0,0000
0,7 0,0000 0,0000 0,0000 0,0000 0,0000
0,8 70,0000 10,0000 14,0000 20,3000 25,3000
0,9 70,0000 30,0000 34,0000 40,3000 45,3000
1,0 70,0000 30,0000 34,0000 40,3000 45,3000
1,1 70,0000 30,0000 34,0000 40,3000 45,3000
1,2 70,0000 30,0000 34,0000 40,3000 45,3000
1,3 70,0000 30,0000 34,0000 40,3000 45,3000
1,4 70,0000 30,0000 34,0000 40,3000 45,3000
1,5 70,0000 30,0000 34,0000 40,3000 45,3000
to a Trippel or Matrix as it is used at DIAdem.

Regards Michael

P.S. I use DIAdem 9.1 SP2
0 Kudos
Message 1 of 6
(4,190 Views)
Hello Michael,

if the INCA matrix is stored in an ASCII format as shown you can use the ASCII wizard to import the data into DIAdem.
After first use of the wizard an stp file is created containing all settings (how many columns, decimal delimiter etc.).
You can uses this stp file for later loading without the wizard dialog.

The following script imports "INCA-Matrix.txt" into DIAdem and prepares a DIAdem matrix and triple structure for further use:

' ----------------------------------------
Option Explicit

Call DataDelAll(1)

' Load ASCII file with INCA matrix
'Call DataFileLoad("INCA-Matrix.txt","asciiFilter","Load")
Call ASCIIConfigLoad(AutoActPath & "INCA-Matrix.stp")
Call ASCIILoad(AutoActPath & "INCA-Matrix.txt", 0)

Dim nCountZChns: nCountZChns = GlobUsedChn - 1
Dim nFirstZChn: nFirstZChn = 2

' Prepare y channel
Call ChnAlloc("y", nCountZChns)
ChnLength("y") = nCountZChns
Dim i
For i = 1 To nCountZChns
  ' Assume:
  ' Decimal delimiter in ASCII file is equal to Windows settings.
  ' 1000 delimiter in ASCII file is equal to Windows settings.
  ChD(i, "y") = CDbl(ChnName(nFirstZChn - 1 + i))
Next
Call ChnCharacter("y")

' Prepare x channel
ChnName("float y \ x") = "x"

' Prepare z channels
For i = 1 To nCountZChns
  ChnName(nFirstZChn - 1 + i) = "z" & i
Next

' Move x channel before first z channel
Call ChnMove("y", GroupDefaultGet, 2)
Call ChnRenumber()

' Optionally convert matrix to triple structure
Call MatChnConvert("x", "y", "'z1'-'z" & nCountZChns & "'")

' ----------------------------------------

If you're familiar in creating DataPlugins you can use a DataPlugin instead of the ASCII wizard.
Maybe DIAdem 9.1 already allows building a DataPlugin from within the wizard.

Christian
0 Kudos
Message 2 of 6
(4,179 Views)
Hi Michael,

I forgot to attach the prepared stp file.

Christian
0 Kudos
Message 3 of 6
(4,176 Views)

Hi Michael,

If indeed you do have this data in an ASCII file, then I would suggest a DataPlugin that maps the column header values (700 ..1600) to a y values channel inserted between the x values channel and the first z values channel.  Then you've got it as a DIAdem matrix structure ready for 3D graphing or analysis.

Let us know if you need help with that,
Brad Turpin
DIAdem Product Support Engineer
National Instruments 

0 Kudos
Message 4 of 6
(4,164 Views)
Hi Brad,

I need your help.

Many thanks,

Michael.

P.S. Attached you find the original file I get from Inca


0 Kudos
Message 5 of 6
(4,161 Views)

Hi Michael,

I went ahead and created a DataPlugin for you that loads the file you attached.  Is this a standard file format-- i.e. would it make sense to post this at the www.ni.com/dataplugins web site, or is this something special that really only you would be interested in?

Note that DIAdem 10.1 Beta has a new built-in Characteristic Diagram (Kennfeldanalyse) 3D plotting type-- this should make the rest of your steps in DIAdem much easier after loading the data.

Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 6 of 6
(4,127 Views)