Hi Chris,

Wow, you must have spent a lot of time putting this response together. I
sure do appreciate it!

I will work through your instructions and let you know if I have any further
problems. As far as the opendx-users newsgroup, I did send an email to the
group yesterday, but I never saw it in my inbox. I sent another test message
this morning.

Thanks so much,
Liz Cougar



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Chris Pelkie
Sent: Tuesday, January 18, 2000 7:04 AM
To: opendx2-dev@lists.berlios.de
Subject: Re: [opendx-dev] Limiting Domain of Data


Hi Liz. Your questions are more appropriate for the opendx-users list than
the opendx-dev list, which caters more to the developers working on the
source code. Many of them are also power users (not all), but I think
you'll find more users on the -users list.

Anyway, to answer your question, you can use "invalid positions" to mark
off the section of data you want to see. This is another field component
like "positions" or "data" which can be created in a number of ways
(Colormap set to limits other than those of the data, for example). You're
interested in an algorithmic solution apparently. Let's say you want to see
only vorticity in the magnitude range of 0.1-0.5. With a Compute, feed your
field in and create an expression "mag(a)" then feed this to Include and
set the min-max to 0.1 and 0.5. The output field has an "invalid positions"
component that identifies all data outside that range as invalid, and is
therefore "hidden" from the renderer. This solution is easy for scalar
data. (I'm assuming your data is position "dep" (dependent) since that
attribute got trimmed from the end of the data object stanza when you
reduced your data set for the post.)

For vector data, you may want to get trickier and limit based only on one
component. I find it easier here to explicitly create my own "invalid
positions" which are in fact a byte array where byte(0) means valid (cause
0 means NOT invalid) and byte(1) means invalid.

So your Compute might be:
a.x < 0.5 ? byte(0) : byte(1)
to pass only those vortex vectors in which the x component is less than 0.5.
or
a.x < 0.5 && a.y >= 0.3 ? byte(0) : byte(1)  (explanation left to reader)

Out of Compute now comes a field whose "data" component is byte 0 or 1, NOT
your original data. So you have to rejoin this data component to your
original field to mask off the invalid data. Do this by adding a Replace
module below and feed the Compute output to the first input, the original
field to the second output, then open Replace and set the next two values
to "data" and "invalid positions". That is, the "data" of the source field
(the byte array) is stuffed into the destination field as the "invalid
positions" component. The destination field of course already has a "data"
component which is a 2-vector float. Render.

That's all you have to do, unless you really want to cull out the invalids,
in which case you Mark("invalid positions"), Include( min = 0, max = 0),
Unmark.

Once you understand invalidating based on data, you are ready to grasp
invalidating based on position. Same principles apply, but you first have
to Mark ("positions") before the Compute. This makes a (pointer) copy of
the positions array and calls it "data" which is the only component Compute
works on. You didn't have to Mark in the first examples, since the "data"
was already in the "data" component.

To avoid trouble in the future, I should say that one normally Marks(some
component), Computes or something on the new "data", then Unmarks to put
things back where they were before the Mark. This is unnecessary in this
case since you ultimately are not using the field with the Marked
component; you simply create then rip out one component from that field and
stuff it back into the original field. I only mention this because you
can't do two Marks in a row without an intervening Unmark (like nested
parentheses, if you will).

Chris Pelkie
Vice President/Scientific Visualization Producer
Conceptual Reality Presentations, Inc.
30 West Meadow Drive
Ithaca, NY 14850
[EMAIL PROTECTED]
(607) 257-8335 or (607) 254-8794

Reply via email to