[ncl-talk] dim_gbits issue

Rick Brownrigg brownrig at ucar.edu
Mon Mar 2 07:45:08 MST 2015


Hi Kevin,

I get the same result. However, your case is not exactly like the examples
page, which depicts a sequence of bits, whereas you are feeding a sequence
of bytes into the function.  If you look at the series of bits within those
bytes:

0000 0000 | 0000 0001 | 0000 0000 ...
^                ^                ^
x[0]            x[1]           x[2]          ...

and then perform the dim_gbits decomposition on that, you do indeed get (/
0, 0, 2, 0 /)

Hope that helps...
Rick


On Mon, Mar 2, 2015 at 6:00 AM, Kevin Vermeesch <kevin.c.vermeesch at nasa.gov>
wrote:

>  Hi,
> I'm trying to use the built-in function dim_gbits (
> https://www.ncl.ucar.edu/Document/Functions/Built-in/dim_gbits.shtml) and
> am not getting the expected result while trying the example in the link
> above. Looking at the worked example in the Description Section, I used the
> following commands:
>
> x = tobyte((/0,1,0,1,0,1,1,1,1,1,1,0,0,1,0,0,1,1,0,1,0,0/))
> print(dim_gbits(x,5,2,3,4))
>
> I get: (/0,0,2,0/)
> when I was expecting to get: (/3,2,1,0/) as the example indicates.
>
> I am using version 6.1.0 (Cygwin) and 6.2.1 (32-bit CentOS). Is this a bug
> or am I not using/understanding the function correctly?
> thanks,
> Kevin
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150302/cfcf3b56/attachment.html 


More information about the ncl-talk mailing list