Hi Dan,
I haven't looked at your data, but from your description,
you need to do something like the following:
tbl = ImportSpreadsheet(...);
in1 = Mark(tbl, 'x');
in2 = Mark(tbl, 'y');
in3 = Mark(tbl, 'z');
tbl2 = Compute("float([$0, $1, $2])", in1, in2, in3);
tbl3 = Unmark( tbl2, "positions");
tbl4 = Mark( tbl3, "velocity");
At this point, you've got a field with the desired positions
and the velocity column marked as data. You can do further
computations on the data, if needed, and then pass it
to Glyph or AutoGlyph.
Cheers,
Joel
Dan Patnaude wrote:
Maybe this is a fundamental misunderstanding of how DX treats things on my
part. I've updated the data so that I now have four columns:
x,y,z,radial velocity
The x, y, and z positions describe a position in space, and the data at that
position is the radial velocity. If I assume an age and distance to the remnant,
I can decompose the radial velocity into components vx, vy, and vz, but I am
still at a loss. When I read in the spreadsheet, how do I tell DX to associate
v_radial (or vx,vy,vz) with the position (x,y,z)?
I don't understand how to tell DX that the 1st three columns denote positions,
but the 4th column (or 4th, 5th and 6th columns) are data associated with those
positions; i.e. column 4 is the x component of the velocity at the position
(x,y,z).
Moreover, if I do create a three vector for the velocity components, I can't
seem to pass it to the 4th tab in Construct. It returns the following error:
ERROR: Construct: Invalid data: origin must be a vector or vector list
Here is the layout:
ImportSpreadSheet=>Mark(x),Mark(y),Mark(z),Mark(vx),Mark(vy),Mark(vz)
Mark(x,y,z)->Compute([x,y,z])
Mark(vx,vy,vz)->Compute([vx,vy,vz])
[x,y,z]->Construct.origin
[vx,vy,vz]->Construct.data
A little more insight would be helpful. I can't imagine that this is as much of
a hassle as it seems to be. I've attached the network and data in case anyone
would be kind enough to play around with it.
------------------------------------------------------------------------
On May 20, 2005, at 5:29 PM, Chris Pelkie wrote:
I'm not sure if you mean you want all the arrows to originate at 0,0,0, as if
you snapshot the 'explosion', or if you want each arrow to originate at its
x,y,z position, but be directed radially away from 0,0,0. In either case, the
solution is the same, but the 'positions' are different.
To draw 3-d arrow glyphs in space, you need to have 3-d positions and 3-d data
(dep on those positions). You didn't specify what you Mark'ed (I assume
column0, column1, column2), so after creating the 3-vector and (unnecessarily
Unmark'ing) you have 3-d data on the 1-d positions (a line) autocreated by
ImportSpreadsheet (and usually, but not always, worthless).
So to emanate all from the origin, compute the 3-vectors as you have already,
then feed this array to the 4th input of a Construct. Set origin to 0,0,0.
This creates a field with as many 0,0,0 positions as there are data items in
the input array. Autoglyph. Color with Autocolor or Color/Colormap. Image. done.
To do the second layout, separately Compute the array of 3-d positions and
feed it to Construct(origin) and the data array to the same Construct's 4th
input (which I can't think of the formal name of off the top of my head,
either data or input). Same net as above. Use Print("rd") to watch how each
operation changes the data field at the output of each module.
____________________________
Chris Pelkie
Vice President (607) 257-8335
Conceptual Reality Presentations, Inc.
30 West Meadow Drive
Ithaca, NY 14850
On May 19, 2005, at 19:41, Daniel Patnaude wrote:
Hi-
I'm trying to do something which intuitively ought to be quite simple:
I have a data file which looks like:
x_pos,y_pos,v_radial
The data is of ~ 450 ejecta knots in a supernova remnant (3c58 for the
curious). I basically want to make a 'kaboom' type 3-d distribution with the
coords x,y,v_rad, since v_rad is effectively a measure of the z displacement
from the center. The positions should be marked by an arrow which points
radially away from (0,0,0), has a length proportional to the data, and
optionally a color based on the value (bluer for positive, redder for
negative values). Is this an easy thing to do? So far, all I've been able to
do is:
ImportSpreadSheet->(Mark x 3, for each value)->Compute (to make a
vector)->Unmark->Autoglyph->Image
but this only makes a distribution of circles, which looks nice, but isn't
quite what I have in mind.
Any suggestions?
Thanks,
Dan
----------------------------------------------------
Daniel Patnaude
Smithsonian Astrophysical Observatory
60 Garden St
MS-02
Cambridge, MA 02138
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
(617) 496-2087
--
===============================================================
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
===============================================================