[Thread Prev][Thread Next][Index]

[ferret_users] Bitwise operations in Ferret

Title: Bitwise operations in Ferret
Dear Ferreters,

Are there some tricks to do bitwise operations in Ferret? I have some MODIS satellite data that has quality assurance (QA) information saved at the bit level. For example, for a particular byte of the QA data, bits 1 & 2 are used for the optical thickness confidence QA, and bits 6 & 7 are used for the effective radius confidence QA. I would like to do masking on particular settings of these bits. How can I do that?

My search so far has not found anything. The AND and OR operators just treat 0 as false and non-zero as true—they do not operate at the bit level. I have pondered doing this with an external function, but that defeats the simplicity I am looking for. I need to hand of the final script to other users that would not necessarily have the know-how to install external functions on their machines.

Thanks for any suggestions!

William I. Gustafson Jr., Ph.D.
Pacific Northwest National Laboratory
P.O. 999, MSIN K9-30
Richland, WA  99352
Tel: 509-372-6110

[Thread Prev][Thread Next][Index]

Contact Us
Dept of Commerce / NOAA / OAR / PMEL / TMAP

Privacy Policy | Disclaimer | Accessibility Statement