Skip to content

What_does_that_dims=[0]_field_in_a_MeqComposer_node_do?

Gijs Molenaar edited this page Feb 13, 2014 · 2 revisions
> I was just looking at your Workshop2007/Intro2/demo2-spigots.py script. There,
> when constructing the inspector you give it a dims=[0] parameter followed
> by the cryptic comment # compose in tensor mode. However by the
> time things end up in the collections plotter dims has changed
> to [351,2,2]; if I comment out dims=[0] in the setup for the inspector,
> the whole plot falls over. What's going on behind the scenes? At present
> if a dims=[0] actually ended up in the collections plotter it would just
> be ignored.

dims=[0] is a special case telling the Composer to treat the "children" axis as an extra tensor dimension. So given 351 children all returning 2x2 tensors, it produces a 351x2x2 tensor, which is what the Collections Plotter needs (of course all children need to have the same tensor dims to begin with, otherwise it will complain). With no dims specified, it will simply unroll everything it receives into a flat vector of length 1402, which is what we don't need. It was a pain working out what the tensor dims should be each time, so I added dims=[0] to let the Composer do it automatically.

Clone this wiki locally