Simple1.net

The program

The first, and simplest, DX network (i.e. program) is simple1.net. The graphical program and its output are as follows

[network for simple1.net] [isocontour of double helix]

This program displays a density isocontour from the screw-dynamo calculation. It has been created by placing the three module icons onto the canvas of the Visual Program Editor and dragging the connections with the mouse from the output tab of Import to the first input tab of Isosurface, etc.

If you double click on the Import module, you find that its first input parameter is set to "lam.general" --- this is the name of a header file containing all the information necessary for reading and processing the data.

[The Import Module]

Once the data are imported, you just need to feed them to Isosurface and (possibly) specify a level value there. If you do not set the value field, the mean value of your data will be used --- DX always tries to use reasonable defaults.

[The Isosurface Module]

The output of Isosurface can then be rendered by Image.

How to produce the header file

The contents of the header file "lam.general" are as follows:
  file = lam.dx
  grid = 24 x 24 x 30
  format = lsb ieee
  interleaving = record
  majority = column
  field = lam
  structure = scalar
  type = float
  dependency = positions
  positions = regular, regular, regular, -1.53333, 0.133333, -1.53333, 0.133333, 0, 0.133333
  end
The different entries specify the name of the data file ("lam.dx"), the name of the variable to be imported (`lam'), the data layout, and the grid on which the data are defined.

There are several ways of producing such a header file: you can create it using the DataPrompter that comes together with DX or you can write it by hand. But in fact the application writing the data file normally knows enough about the data to produce a corresponding header file at the same time.

In my case the data are from a Fortran simulation, but I process them in IDL, so both the data file "lam.dx" and the header file "lam.general" are produced by an IDL subroutine called dx_export.pro which is also included in the idl/ directory of my example files.

All I did was to load the data into IDL, such that the three-dimensional field lam[*,*,*] contained the values of ln(rho), and x[*], y[*] and z[*] contained the x, y and z coordinate vectors. Then I just ran

IDL>   dx_export, lam, X=x, Y=y, Z=z, BASE='lam', LABELS=['lam']
and the script produced the two files for me. More examples and better documentation can be found in the file itself.

(NB: If you are working on a big-endian machine, you will have to adapt the IDL script or replace `lsb' (least significant byte first) by `msb' in the header file when you process your own data. Some day, I will make dx_export check for byte order...)

-----[an-owl-on-a-line]--------------------------------------------

Created 17-May-2001 by Wolfgang.Dobler@kis.uni-freiburg.de
Any comments are welcome