Chris Pelkie wrote:
Yes, Append. Use this in a macro loop. I usually initialize GetLocal
with CollectSeries (empty), so the object hierarchy is established on
the first pass. Then extract or derive a valid series member ID from
ForEachMember and feed it and the series member itself to Append. This
keeps adding a new member to the end of the growing series. Thus Append
has only 3 wires ever: the initial object from GetLocal, the current
member field and the current member ID.
I am having trouble with what you are saying. I have attached a
.net/cfg file with what I think you are talking about, however, I am not
sure if I got it right. (My ascii art for this stuff is really bad BTW)
I thought the problem you were trying to solve was how to visualize
doubles but preserve them on output. There shouldn't be any particular
reason why you can't cast double to float JUST for the viz (you can't
see doubles anyway: not enough pixels (:-)), but preserve the double
array and Export it, as a user-defined 'data' or 'double-data' component
of each series member.
No, I have a .nc archive file that I don't wanna change (too much) that
I wish to be able to ship a .net file out with so people can viz my data
w/o a problem. However, the positions are doubles, not floats, and that
is the problem. It seems that dx should auto-demote the data instead of
what it does (AFAICT it reads in the data assuming it was floats and
therefore gets garbage data in, example, I have 0,1,0,1 and it get
something odd in. Also, it does not use the nc_get routines to read
data but seems to do it itself???)) Oh well
Thanks
Matt
//
// time: Tue Aug 6 08:11:12 2002
//
// version: 3.1.2 (format), 4.2.0 (DX)
//
// Message Window:
// window: position = (0.2750,0.6392), size = 0.3825x0.2192
//
// time: Tue Aug 6 08:11:12 2002
//
// version: 3.1.2 (format), 4.2.0 (DX)
//
//
// MODULE main
// workspace: width = 504, height = 709
// layout: snap = 0, width = 50, height = 50, align = NN
//
macro main(
) -> (
) {
//
// node CollectSeries[2]: x = 17, y = 429, inputs = 6, label = CollectSeries
//
main_CollectSeries_2_out_1 =
CollectSeries(
main_CollectSeries_2_in_1,
main_CollectSeries_2_in_2,
main_CollectSeries_2_in_3,
main_CollectSeries_2_in_4,
main_CollectSeries_2_in_5,
main_CollectSeries_2_in_6
) [instance: 2, cache: 1];
//
// node GetLocal[1]: x = 159, y = 522, inputs = 3, label = GetLocal
//
main_GetLocal_1_out_1,
main_GetLocal_1_out_2 =
GetLocal(
main_CollectSeries_2_out_1,
main_GetLocal_1_in_2,
main_GetLocal_1_in_3
) [instance: 1, cache: 1];
//
// node Import[1]: x = 240, y = 124, inputs = 6, label = Import
// input[1]: defaulting = 0, visible = 1, type = 32, value = "file.nc"
//
main_Import_1_out_1 =
Import(
main_Import_1_in_1,
main_Import_1_in_2,
main_Import_1_in_3,
main_Import_1_in_4,
main_Import_1_in_5,
main_Import_1_in_6
) [instance: 1, cache: 1];
//
// node Select[1]: x = 123, y = 230, inputs = 3, label = Select
// input[2]: defaulting = 0, visible = 1, type = 32, value =
"real_positions"
//
main_Select_1_out_1 =
Select(
main_Import_1_out_1,
main_Select_1_in_2,
main_Select_1_in_3
) [instance: 1, cache: 1];
//
// node Compute[1]: x = 164, y = 316, inputs = 3, label = Compute
// input[1]: defaulting = 0, visible = 0, type = 32, value = "float($0)"
// expression: value = float(a)
// name[2]: value = a
// name[3]: value = b
//
main_Compute_1_out_1 =
Compute(
main_Compute_1_in_1,
main_Select_1_out_1,
main_Compute_1_in_3
) [instance: 1, cache: 1];
//
// node Select[2]: x = 377, y = 237, inputs = 3, label = Select
// input[2]: defaulting = 0, visible = 1, type = 32, value = "Pressure"
//
main_Select_2_out_1 =
Select(
main_Import_1_out_1,
main_Select_2_in_2,
main_Select_2_in_3
) [instance: 2, cache: 1];
//
// node ForEachMember[1]: x = 353, y = 355, inputs = 1, label =
ForEachMember
//
main_ForEachMember_1_out_1,
main_ForEachMember_1_out_2,
main_ForEachMember_1_out_3 =
ForEachMember(
main_Select_2_out_1
) [instance: 1, cache: 1];
//
// node Replace[1]: x = 270, y = 457, inputs = 4, label = Replace
// input[4]: defaulting = 0, visible = 1, type = 32, value = "positions"
//
main_Replace_1_out_1 =
Replace(
main_Compute_1_out_1,
main_ForEachMember_1_out_1,
main_Replace_1_in_3,
main_Replace_1_in_4
) [instance: 1, cache: 1];
//
// node Append[1]: x = 384, y = 549, inputs = 5, label = Append
//
main_Append_1_out_1 =
Append(
main_GetLocal_1_out_1,
main_Replace_1_out_1,
main_ForEachMember_1_out_2,
main_Append_1_in_4,
main_Append_1_in_5
) [instance: 1, cache: 1];
//
// node Print[4]: x = 305, y = 647, inputs = 3, label = Print
// input[2]: defaulting = 0, visible = 1, type = 32, value = "rd"
//
Print(
main_Append_1_out_1,
main_Print_4_in_2,
main_Print_4_in_3
) [instance: 4, cache: 1];
// network: end of macro body
}
main_CollectSeries_2_in_1 = NULL;
main_CollectSeries_2_in_2 = NULL;
main_CollectSeries_2_in_3 = NULL;
main_CollectSeries_2_in_4 = NULL;
main_CollectSeries_2_in_5 = NULL;
main_CollectSeries_2_in_6 = NULL;
main_CollectSeries_2_out_1 = NULL;
main_GetLocal_1_in_2 = NULL;
main_GetLocal_1_in_3 = NULL;
main_GetLocal_1_out_1 = NULL;
main_Import_1_in_1 = "file.nc";
main_Import_1_in_2 = NULL;
main_Import_1_in_3 = NULL;
main_Import_1_in_4 = NULL;
main_Import_1_in_5 = NULL;
main_Import_1_in_6 = NULL;
main_Import_1_out_1 = NULL;
main_Select_1_in_2 = "real_positions";
main_Select_1_in_3 = NULL;
main_Select_1_out_1 = NULL;
main_Compute_1_in_1 = "float($0)";
main_Compute_1_in_3 = NULL;
main_Compute_1_out_1 = NULL;
main_Select_2_in_2 = "Pressure";
main_Select_2_in_3 = NULL;
main_Select_2_out_1 = NULL;
main_ForEachMember_1_out_1 = NULL;
main_ForEachMember_1_out_2 = NULL;
main_Replace_1_in_3 = NULL;
main_Replace_1_in_4 = "positions";
main_Replace_1_out_1 = NULL;
main_Append_1_in_4 = NULL;
main_Append_1_in_5 = NULL;
main_Append_1_out_1 = NULL;
main_Print_4_in_2 = "rd";
main_Print_4_in_3 = NULL;
Executive("product version 4 2 0");
$sync
main();