Hi Matt,

Sounds like you are on the right track. The simplest way to get
your data into DX is probably just to create a delimited text
file and use ImportSpreadsheet (be sure to set the delimiter
input to whatever you use in the file (comma, tab, space, ...)

        time    source1 source2 source3
        0.1     53.2    101.9   82.9
        0.25    57.0    100.2   82.9
        0.4     68.6    97.3    82.5
        ...     ...     ...     ...

The Plot module (under Annotation) will draw the lines for
you. It wants a field with a 'positions' component containing
the X values, and a 'data' component containing the Y. So, to draw
the line for one of your sources, you could rename the time component
as 'positions', then mark the data source component you want to plot,
then pass it to Plot:

                ImportSpreadsheet
                |
                |  "time"
                |  | "positions"
                |  |  |
                Rename
                  |
                  | "source1"
                  | |
                 Mark
                  |
                  |
                 Plot
                  |
                 Image

To plot all three source lines at once, Mark each one separately,
collect the results into a group, and pass that to Plot:

                yourfield
                |
                |  "time"
                |  | "positions"
                |  |  |
                Rename
                  |
                  |-------------+---------------+
                  |             |               |
                  | "source1" |  "Source2"  |  "Source3"
                  | |           |   |           |   |
                 Mark           Mark            Mark
                  |             |               |
                  +---------+   |  +------------+
                            |   |  |
                             Collect    
                                |
                                Plot
                                |
                                Image

To create a scatter plot, say source1 vs. source2, rename source1 to positions, mark source2, and add a "scatter" attribute with a value of 1, just before Plot:

                yourfield
                |
                |  "source1"
                |  | "positions"
                |  |  |
                Rename
                  |
                  | "source2"
                  | |
                 Mark
                  |
                  | "scatter"
                  | |
                  | |  1
                 Options
                  |
                 Plot
                  |
                 Image

For more information, check out the documentation for Plot.


Hope this helps.

Cheers,
Joel

Matt Genovese wrote:
Hello,

I am a little confused regarding the OpenDX data model, and would like to solicit input from those who understand it better than I.

My project is fairly simple: I am writing a C program to capture data as time progresses, and plot it in DX. There are one or more axes (sources of data values), and obviously the time-axis is another source of data (there can actually be multiple discrete time axes, but I'll keep it simple for now). Note that time does not progress at a constant rate.

The goal is to be able to plot any axis vs. a time axis. However, more generally, I'd like to be able to plot any axis vs. any other axis....which is really a scatter plot. The points on the scatter plot are correlated (linked) by the discrete time which they were captured in the simulation.

I'd like to understand how to best assemble this into the DX data model. My attempt is to group all the axes under a DX Field. Each axis is essentially a DX Array of data, which is a component of the Field. However, does this allow me to formulate the time-based plots or scatter plots I am looking for? The Arrays I was building are scalar (rank 0) - just raw values (doubles) obtained over time...one for each axis. I am also confused as to the "rank" and "shape" parameters, and how they affect organization of the data in the Array....so perhaps this is part of my problem.

So for example, my thinking is that if I had 3 data sources, and they're sampled over time, I have: 4 "axes" - 4 DX Arrays as components under 1 DX Field object. Three of the arrays are one-dimensional and contain the data values, and the fouth array is one-dimensional and contains the capture times for all points. Then the three data arrays are somehow linked to the fourth array to correlate the data value with time-of-capture. Again, I'm worried I am going about this all-wrong.

I hope this is not too vague. Thanks in advance for any guidance you can provide.
Best Regards,

Matt Genovese
University of Texas at Austin
--

--

===============================================================
Joel Richardson, Ph.D.   Phone: (207) 288-6435
The Jackson Laboratory   Fax:   (207) 288-6132
600 Main Street          URL:   www.informatics.jax.org
Bar Harbor, Maine 04609
===============================================================

Reply via email to