You can use ndcoords() if you need coordinates
for all the locations in your mask piddle.
On 11/8/2011 6:35 AM, chm wrote:
The dimensions of whichND are going to be a
dim(0) of length the number of dims in the
mask pdl by the number of true locations in
mask. It is usually easier to sort this out
in one of our interactive shells using a
small dataset, e.g.,
pdl> $a = zeros(3,2)
pdl> p $a->whichND->info
PDL->null
pdl> $a = ones(3,2)
pdl> p $a->whichND->info
PDL: Long D [2,6]
So you can see the same size array can yield
a wide range of output array sizes. Try something
like $niV = whichND( ! $V ) and that should
give you the locations of the false data values.
Cheers,
Chris
On 11/8/2011 1:05 AM, Daniel Atwater wrote:
Hi PDL Gurus,
I seem to be missing an element after the following bit of code
$nc = PDL::NetCDF->new('some_netCDF_file.nc');
$U = $nc->get(<VARIABLE>);
$iU = $U->whichND;
$V = $nc->get(<VARIABLE>);
$iV = $V->whichND;
The dimensions of U and V are [102,74,1] so when I do the masking via
whichND I should get back a matrix that is [3,7548]. While I do get
this for iV the same is not true for iU. In fact, iU is missing a row
-- the dimensions of iU are [3,7547]. Now obviously it must be
something with data (variable) inside the netCDF, however, on initial
inspection via ncdump this variable checks out OK. So I'm at a bit of
a lost and hoping that someone here might quickly be clued in on
something funny that I might inadvertently being doing. Maybe somebody
has a suggestion for a weirdness check on the values; maybe there are
some strange characters that are getting in there and I just can't see
them.
Your thoughts are appreciated.
Sincerely,
Dan
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl
-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1411 / Virus Database: 2092/4004 - Release Date: 11/08/11
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl