#!F-adobe-helvetica-medium-r-normal--18*
#!N 
#!CSeaGreen #!N  #!Rmaping Mapping #!N #!EC #!N #!N There is 
a very useful module called Map in Data Explorer that permits 
you to "map" one data set onto a Field defined by 
another data set. For example, in our rain cloud data, we 
have measured temperature and cloud-water density throughout a volume. We learned 
earlier how to make an isosurface of temperature equal to 12 
degrees C. Now it may be instructive to observe the cloud-water 
density associated with this temperature isosurface. #!N #!N The operation we 
wish to perform is to use our temperature isosurface with its 
arbitrary (data-defined) shape as a sampling surface to pick out the 
values of cloudwater density as they occur throughout the volume. That 
is, conceptually, we will  #!F-adobe-times-medium-i-normal--18*   dip #!EF the temperature isosurface into 
the cloudwater volume. Wherever the isosurface comes in contact with the 
cloudwater volume, the values that  #!F-adobe-times-medium-i-normal--18*   stick #!EF to the isosurface 
represent the values of cloudwater density that occur at that intersection. 
But remember that the isosurface was created using temperature data. The 
isosurface of temperature (the  #!F-adobe-times-medium-i-normal--18*   input #!EF Field to Map in 
this example) had only one data value (12 degrees C) at 
every position, but the mapped isosurface (the output of Map) will 
contain arbitrary patches of data corresponding to the distribution of cloudwater 
density. If we AutoColor this output isosurface, we will see an 
arbitrary geometric surface with a patchy color scheme. The surface is 
the location of all 12 degree temperatures, and the patchy color 
corresponds to the distribution of different cloudwater densities sampled on that 
surface. (Of course, if cloudwater density happened to have the same 
value at all points on the 12-degree temperature surface, we would 
see only one color.) #!N #!N Naturally, you can do the 
opposite! First, make an isosurface of cloudwater density, say at the 
mean value of density. The mean value of a Field is 
taken as the default value by the Isosurface module: this is 
convenient when you start exploring a new data set and do 
not know what the extreme values are. Now map the temperature 
data onto the cloudwater isosurface. Run the output through AutoColor. The 
result will look very different. This time, you have "dipped" the 
cloudwater isosurface into a "bucket" of temperature data. Once again, this 
serves as a reminder that you must indicate to an observer 
exactly what kind of operation you performed if your visualization is 
to bear any meaning. #!N #!N You can also dip the 
cloudwater isosurface into the temperature  #!F-adobe-times-medium-i-normal--18*   colors #!EF . To do 
this, first AutoColor the temperature data set. Then use Mark to 
"mark" the colors as data (this temporarily renames the colors component 
to data, while saving the original data component). Then use Map 
to map this marked Field into the cloudwater isosurface colors component. 
(It is necessary to mark the colors as data before mapping 
because Map always maps from the data component). An example visual 
program that performs each of these mapping operations can be found 
in  #!F-adobe-times-bold-r-normal--18*   /opt/local/dx/samples/programs/UsingMap.net #!EF . #!N #!N Note that we changed 
the order of the modules slightly in the third example. In 
the second case, we Mapped data values from the "map" Field 
(cloudwater density) onto the "input" Field (the temperature isosurface), then AutoColored 
the resulting Field. In the third case, we AutoColored the "map" 
Field (temperature), then mapped color values onto the "input" Field (cloudwater 
density). This illustrates some of the flexibility of both the Map 
module itself and Data Explorer in general. In this case, the 
output image would be similar whether you colored by temperature then 
mapped, or mapped temperature first, then colored by temperature. There will 
be color differences if the range of values that mapped onto 
the isosurface is different from the entire data range used to 
AutoColor the entire temperature Field. You could avoid this problem by 
substituting a Color and Colormap pair in place of AutoColor, then 
connecting the original temperature Field to the input of the Colormap. 
This would automatically lock the minimum and maximum to the entire 
range of temperature, not just to the range of values that 
happened to fall on the isosurface. #!N #!N But there are 
other cases in which commutative ordering of modules will yield a 
quite different visual output. For example, suppose we have a volumetric 
Field containing both vector data and a scalar data set. We 
can generate a series of Streamlines through the vector Field, Map 
the scalar data from the volume through which the Streamlines pass 
onto these lines, then AutoColor the lines according to the scalar 
data. To make the lines easier to see, we employ the 
Tube module to create cylinders along the path of each streamline. 
The radius of the Tubes can be adjusted until we get 
the look we like. By performing the operations in that order, 
the original colors are carried from the lines out to the 
outside of the cylinders, resulting in distinct circumferential bands of color 
on the Tube surfaces. #!N #!N Now, change the order: create 
Streamlines, then Tube the lines. This yields uncolored cylinders. At this 
point, we Map the scalar data values from the volumetric Field 
in which the cylinders are embedded onto the surfaces of the 
cylinders, then AutoColor. This time, we will have patches of color 
on the cylinders, since it is highly unlikely that the volumetric 
data would lie in perfect rings around the outside of the 
tubes. #!N #!N Which of the above two representations is "correct"? 
Both are accurate. Which you choose to show depends on the 
point you are trying to make. In the first case, you 
are illustrating the values of data precisely as they occur along 
the Streamlines: the Tubes are used to make these very thin 
lines more visible. In the second case, you wish to sample 
the data volume at a specified radius away from a given 
Streamline. By varying the radius of the Tubes, you can investigate 
phenomena such as the rate of change of the data Field 
as you move further away from the Streamline itself. #!N #!N 
#!N  #!F-adobe-times-medium-i-normal--18*   Next Topic #!EF #!N #!N  #!Lnorsha,dxall603 h Normals and Shading  #!EL  #!N  #!F-adobe-times-medium-i-normal--18*   #!N 

