void readland_cpp(char* byteone,char* landout,int nvals){ //byte 0, bit 6-7 for(int i=0; i < nvals; ++i){ std::bitset<8> myseq(byteone[i]); landout[i] = myseq[6]+(myseq[7]*2); } }
void readthin_cirrus_cpp(char* byteone,char* cirrusout,int nvals){ //byte 1, bit 3 for(int i=0; i < nvals; ++i){ std::bitset<8> myseq(byteone[i]); cirrusout[i] = myseq[3]; } }
void readhigh_cloud_cpp(char* byteone,char* highout,int nvals){ //byte 1, bit 6 for(int i=0; i < nvals; ++i){ std::bitset<8> myseq(byteone[i]); highout[i] = myseq[6]; } }
void readglint_cpp(signed char* byteone,float* glintout,int nvals){ //byte 0 bit 4 for(int i=0; i < nvals; ++i){ std::bitset<8> myseq(byteone[i]); glintout[i] = myseq[4]; } }
void readcloud_cpp(char* byteone,char* maskout,int nvals){ //byte 0, bits 1-2 std::cout << "bitmask pixel dump:" << "-- number of bytes: " << nvals << "-- first byte: " << std::bitset<8>(byteone[0]) << "-- byte 20000: " << std::bitset<8>(byteone[20000]) << std::endl; for(int i=0; i < nvals; ++i){ //cloud flag is either 0, 1, 2 or 3 std::bitset<8> myseq(byteone[i]); maskout[i] = myseq[1] +(myseq[2]*2); } }