Accesing CALIPSO metadata with C++
Posted: Wed Jul 24, 2024 10:58 am America/New_York
Hi,
I am trying to read metadata calipso from 5km Cloud Profile files (05kmCPro) using c++ code.
I have a problem for the Lidar_Data_Altitude which is a list of 399 float32. I am using a buffer to read metadata from the 1st one (Product_ID) until Lidar_Data_Altitude. No problem until this list of altitude.
I write this in the readmetadata method :
k = j;
j += 399;
for (i = k; i < j; i++){
METADATA->Lidar_Data_Altitude[i-k] = *(reinterpret_cast<float32*>(&buffer[i]));
}
And the error I have is this one :
CALIOP_L2_CloudProfile.cpp:1583:50: error: types « float32 {aka float}[int] » invalid for table index
1583 | METADATA->Lidar_Data_Altitude[i-k] = *(reinterpret_cast<float32*>(&buffer[i]));
| ^
CALIOP_L2_CloudProfile.cpp: injunction « void CALIOP_L2_CloudProfile::InitializeMETADATA(StructMETADATA_LIDl2cpro*) »:
CALIOP_L2_CloudProfile.cpp:1635:49: error: types « float32 {aka float}[int] » invalid for table index
I am trying to read metadata calipso from 5km Cloud Profile files (05kmCPro) using c++ code.
I have a problem for the Lidar_Data_Altitude which is a list of 399 float32. I am using a buffer to read metadata from the 1st one (Product_ID) until Lidar_Data_Altitude. No problem until this list of altitude.
I write this in the readmetadata method :
k = j;
j += 399;
for (i = k; i < j; i++){
METADATA->Lidar_Data_Altitude[i-k] = *(reinterpret_cast<float32*>(&buffer[i]));
}
And the error I have is this one :
CALIOP_L2_CloudProfile.cpp:1583:50: error: types « float32 {aka float}[int] » invalid for table index
1583 | METADATA->Lidar_Data_Altitude[i-k] = *(reinterpret_cast<float32*>(&buffer[i]));
| ^
CALIOP_L2_CloudProfile.cpp: injunction « void CALIOP_L2_CloudProfile::InitializeMETADATA(StructMETADATA_LIDl2cpro*) »:
CALIOP_L2_CloudProfile.cpp:1635:49: error: types « float32 {aka float}[int] » invalid for table index