Sorry to break up the answer. Periodic boundaries start at the other side of the source array when the index runs off the end; this is a commonly used term in many scientific communities. Mirror conditions reverse indexing direction at the boundary. Try some cases that bust the boundary by more than one row and you should see the pattern.
(Mobile) On Jun 26, 2010, at 8:16 PM, P Kishor <[email protected]> wrote: > $in = pdl( > [ > [ 0 1 2 3 4] > [ 5 6 7 8 9] > [10 11 12 13 14] > ] > ); > > boundary: f > ----------- > $out = $pdl->range( [2, 0], [4, 2], 'f'); > index out-of-bounds in range at > /usr/local/lib/perl5/site_perl/5.12.1/darwin-2level/PDL/Core.pm line > 2779. > punk...@dyn-72-33-101-43 ~/Data/carbonmodel/daymet$perl pdl.pl > > boundary: t > ----------- > $out = $pdl->range( [2, 0], [4, 2], 't'); > [ > [2 3 4 0] > [7 8 9 0] > ] > > Based on the my understanding of the word 'truncate,' I was expecting > [ > [2 3 4] > [7 8 9] > ] > > Is there any way to get something like above? That is, the range > outside the boundary is just ignored, or, in other words, the range is > "clipped" or truncated based on the boundary? > > boundary: e > ----------- > $out = $pdl->range( [2, 0], [4, 2], 'e'); > [ > [2 3 4 4] > [7 8 9 9] > ] > > boundary: x > ----------- > $out = $pdl->range( [2, 0], [4, 2], 'x'); > Error in rangeb: Unknown boundary condition 'x' in range at > /usr/local/lib/perl5/site_perl/5.12.1/darwin-2level/PDL/Slices.pm line > 332. > punk...@dyn-72-33-101-43 ~/Data/carbonmodel/daymet$perl pdl.pl > > huh! I thought 'x' was a synonym for 'e'. What happened? Is there a > mistake in the docs? > > > boundary: p > ----------- > $out = $pdl->range( [2, 0], [4, 2], 'p'); > [ > [2 3 4 0] > [7 8 9 5] > ] > > I don't understand what 'p' is doing. Could someone explain that > please? Maybe the docs need to be expanded. > > boundary: m > ----------- > $out = $pdl->range( [2, 0], [4, 2], 'm'); > [ > [2 3 4 4] > [7 8 9 9] > ] > > I don't understand what 'm' is doing. Could someone explain please? > > Many thanks. > > > > > -- > Puneet Kishor > > _______________________________________________ > Perldl mailing list > [email protected] > http://mailman.jach.hawaii.edu/mailman/listinfo/perldl > _______________________________________________ Perldl mailing list [email protected] http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
