> Then I would guess that you would rather visualize a 2D grid of
 temperatures spanning the pipe. So modify the input data to reflect
 both the X (distance down pipe) and Y (distance from pipe) for each
 record. Same concept that each record carries all necessary info.
 Then you can import all the data at once (not in separate files as
 suggested earlier). Use Construct to build a grid of appropriate
 dimensions, then feed your 2D data into Construct (properly oriented
 with Y changing faster than X), and you can Autocolor and view the
 whole colorized grid. ImportSpreadsheet brings all values in as
 separate components in a field, so you need to Mark or Extract the
 "temperature" component which should be arranged (as I just said)
 with Y varying faster (x0y0, x0y1, etc.). Use column names in your
 Excel file (save as tab-delimited text, then set header line to 1 and
 separator to \t in ImportSpreadsheet) and the components will acquire
 the column names making it easy to tell what's what.

OK, sorry to bother you again, I guess I am just not seeing how to do this.
I have moved my file around so that I have the following columns:

Date    Time    Thermistor#     X       Y       Temp

I can get the program to import the spreadsheet, but I have not been able to
figure out how to get it to plot a simple 2-D visualization.  I assume I need
to use an include, but am not sure.  Could you walk me though the objects,
starting with the "import Spreadsheet"?
Thanks,
Fred


First, use Print('rd') a lot. Attach it to the various outputs as you go along, open the Message Window, File:Clear, then Execute Once to see the latest result (skip the Clear if you are trying to compare to a previous result). Most of DX is manipulating field structures and you need a way to see the interim results.

So if you Print the output of ImportSpreadsheet (ISS) (left hand one) you see a field with components named Date, Time, etc., assuming you also told ISS that your header line is line 1 (and in fact included the header line in the file as written above). This helps a lot because your field components have friendly names you'll recognize.

I also assume you arranged the data rowwise such that the value for X0Y0 is first, then X0Y1...X0Yn-1, X1Y0, X1Y1, and so on.

Attach two Mark modules in parallel to ISS output. Set one to Mark ("X") and one to Mark("Y"). Print the result of each. Note that the "data" component is now a copy of "X" or "Y". These two different fields (from the same parent) can be fed to a Compute. Doesn't matter which order in this case.

Compute expression is:  [a, b]
(or rename the inputs inside Compute to "x" and "y", then expression is [x, y])

Print the output. See that the data is now a 2-vector. Note that all other components from ISS are being carried along. How convenient!

Use Unmark("positions") to force this 2-vector array to become the "positions" of the new field. Print the result. (I said the "new" field. Each output really does represent a new object, but all prior objects are still accessible from their respective outputs. Under the covers, DX uses a lot of pointers to components to save on memory, but conceptually, you are creating a new field each time, and it helps to think of each field as standing alone, at least in my mind).

Now, here's the rub with ISS. It knows nothing about the desired connectivity between input data records (rows), so assumes you want a 1-D line connecting point 0 to 1 to 2, etc. Sometimes very convenient, here a PITA. So Remove ("connections").

Now Mark("Temp") to make the Temperature values the "data".

AutoGlyph, AutoColor, Image, Execute once: Picture!

Should show colored balls of various sizes on your 2-D grid. Scaling may need work, but this will probably be not too bad for starters. It's just not what you want.

Add a Construct to the net. Make its origin a 2-vector equal to your real-world spatial origin like:
[20.0, 120.4] (or [0,0] if that's what it is).

Make its deltas equal to your deltas (x, then y as a 2-vector).

Make its counts equal to your counts of x and y as a 2-vector. The x*y product should be equal to the number of data rows in the input file.

Print the output of Construct (which is otherwise not yet connected to any other module). You have a nice 2-D grid with no data. You could ShowConnections and Image this to see the result as well.

To get your temperature data onto this grid (and only because the two 2-D grids are topologically conformal), take the output of Mark("Temp") into the "data" input of Construct. At the output of Construct, add another AutoColor, then Image.

Should be a 2-D colored (interpolated) grid corresponding to your real world coordinates (which may not be perfectly grid regular).
--

Chris Pelkie
Vice President/Scientific Visualization Producer
Conceptual Reality Presentations, Inc.
30 West Meadow Drive
Ithaca, NY 14850
[EMAIL PROTECTED]

Reply via email to