Print all CALIOP v3 01kmCLay SDS names and attributes in python 2.7

Published: 03 février 2017

DMCA.com Protection Status

Outputs of a code (see bottom of the page) written in python 2.7 to print all CALIOP v3 01kmCLay SDS names and attributes. All SDS infos:

Id Name Nb_Dim Dim Type Nb_attributes
0 Profile_ID 2 [21120, 1] 24 3
1 Latitude 2 [21120, 1] 5 3
2 Longitude 2 [21120, 1] 5 3
3 Profile_Time 2 [21120, 1] 6 3
4 Profile_UTC_Time 2 [21120, 1] 6 3
5 Day_Night_Flag 2 [21120, 1] 20 3
6 Off_Nadir_Angle 2 [21120, 1] 5 3
7 Solar_Zenith_Angle 2 [21120, 1] 5 3
8 Solar_Azimuth_Angle 2 [21120, 1] 5 3
9 Scattering_Angle 2 [21120, 1] 5 3
10 Spacecraft_Position 2 [21120, 3] 6 4
11 Parallel_Column_Reflectance_532 2 [21120, 1] 5 3
12 Parallel_Column_Reflectance_Uncertainty_532 2 [21120, 1] 5 3
13 Perpendicular_Column_Reflectance_532 2 [21120, 1] 5 3
14 Perpendicular_Column_Reflectance_Uncertainty_532 2 [21120, 1] 5 3
15 Column_Integrated_Attenuated_Backscatter_532 2 [21120, 1] 5 3
16 Column_IAB_Cumulative_Probability 2 [21120, 1] 5 3
17 Tropopause_Height 2 [21120, 1] 5 3
18 Tropopause_Temperature 2 [21120, 1] 5 3
19 IGBP_Surface_Type 2 [21120, 1] 20 3
20 NSIDC_Surface_Type 2 [21120, 1] 21 3
21 Lidar_Surface_Elevation 2 [21120, 2] 5 3
22 DEM_Surface_Elevation 2 [21120, 1] 5 3
23 Number_Layers_Found 2 [21120, 1] 20 3
24 Layer_Top_Altitude 2 [21120, 10] 5 3
25 Layer_Base_Altitude 2 [21120, 10] 5 3
26 Layer_Top_Pressure 2 [21120, 10] 5 3
27 Midlayer_Pressure 2 [21120, 10] 5 3
28 Layer_Base_Pressure 2 [21120, 10] 5 3
29 Layer_Top_Temperature 2 [21120, 10] 5 3
30 Midlayer_Temperature 2 [21120, 10] 5 3
31 Layer_Base_Temperature 2 [21120, 10] 5 3
32 Attenuated_Backscatter_Statistics_532 2 [21120, 60] 5 3
33 Integrated_Attenuated_Backscatter_532 2 [21120, 10] 5 3
34 Integrated_Attenuated_Backscatter_Uncertainty_532 2 [21120, 10] 5 3
35 Attenuated_Backscatter_Statistics_1064 2 [21120, 60] 5 3
36 Integrated_Attenuated_Backscatter_1064 2 [21120, 10] 5 3
37 Integrated_Attenuated_Backscatter_Uncertainty_1064 2 [21120, 10] 5 3
38 Volume_Depolarization_Ratio_Statistics 2 [21120, 60] 5 3
39 Integrated_Volume_Depolarization_Ratio 2 [21120, 10] 5 3
40 Integrated_Volume_Depolarization_Ratio_Uncertainty 2 [21120, 10] 5 3
41 Attenuated_Total_Color_Ratio_Statistics 2 [21120, 60] 5 3
42 Integrated_Attenuated_Total_Color_Ratio 2 [21120, 10] 5 3
43 Integrated_Attenuated_Total_Color_Ratio_Uncertainty 2 [21120, 10] 5 3
44 Overlying_Integrated_Attenuated_Backscatter_532 2 [21120, 10] 5 3
45 Layer_IAB_QA_Factor 2 [21120, 10] 5 3
46 CAD_Score 2 [21120, 10] 20 3
47 Feature_Classification_Flags 2 [21120, 10] 23 3

SDS attributes

Profile ID

units NoUnits
valid_range 1...3153600000
format Int_32

Latitude

units deg
valid_range 90.0...90.0
format Float_32

Longitude

units deg
valid_range 180.0...180.0
format Float_32

Profile Time

units sec
valid_range 4.204E8...7.389E8
format Float_64

Profile UTC Time

units NoUnits
valid_range 60426...160601
format Float_64

Day Night Flag

units NoUnits
valid_range 0...1
format Int_8

Off Nadir Angle

units deg
valid_range 0.0...5.0
format Float_32

Solar Zenith Angle

units deg
valid_range 0.0...180.0
format Float_32

Solar Azimuth Angle

units deg
valid_range 180.0...180.0
format Float_32

Scattering Angle

units deg
valid_range 0.0...180.0
format Float_32

Spacecraft Position

units km
valid_range 8000.0 ... 8000.0
fillvalue 9999.0
format Float_64

Parallel Column Reflectance 532

units NoUnits
valid_range 0.0...2.0
format Float_32

Parallel Column Reflectance Uncertainty 532

units NoUnits
valid_range 0.0...TBD
format Float_32

Perpendicular Column Reflectance 532

units NoUnits
valid_range 0.0...2.0
format Float_32

Perpendicular Column Reflectance Uncertainty 532

units NoUnits
valid_range 0.0...TBD
format Float_32

Column Integrated Attenuated Backscatter 532

units 1/sr
valid_range 0.0...2.0
format Float_32

Column IAB Cumulative Probability

units NoUnits
valid_range 0.0...1.0
format Float_32

Tropopause Height

units km
valid_range 4...22
format Float_32

Tropopause Temperature

units degrees C
valid_range 100...20
format Float_32

IGBP Surface Type

units NoUnits
valid_range 1...18
format Int_8

NSIDC Surface Type

units NoUnits
valid_range 0...255
format Uint_8

Lidar Surface Elevation

units km
valid_range 1.0...9.0
format Float_32

DEM Surface Elevation

units km
valid_range 1.0...9.0
format Float_32

Number Layers Found

units NoUnits
valid_range 0...10
format Int_8

Layer Top Altitude

units km
valid_range 0.5...20.2
format Float_32

Layer Base Altitude

units km
valid_range 0.5...20.2
format Float_32

Layer Top Pressure

units hPA
valid_range 1...1086
format Float_32

Midlayer Pressure

units hPA
valid_range 1...1086
format Float_32

Layer Base Pressure

units hPA
valid_range 1...1086
format Float_32

Layer Top Temperature

units degrees C
valid_range 110...60
format Float_32

Midlayer Temperature

units degrees C
valid_range 110...60
format Float_32

Layer Base Temperature

units degrees C
valid_range 110...60
format Float_32

Attenuated Backscatter Statistics 532

units 1/km 1/sr
valid_range N/A
format Float_32

Integrated Attenuated Backscatter 532

units 1/sr
valid_range 0.0...1.8
format Float_32

Integrated Attenuated Backscatter Uncertainty 532

units 1/sr
valid_range 0.0...0.5
format Float_32

Attenuated Backscatter Statistics 1064

units 1/km 1/sr
valid_range N/A
format Float_32

Integrated Attenuated Backscatter 1064

units 1/sr
valid_range 0.0...1.8
format Float_32

Integrated Attenuated Backscatter Uncertainty 1064

units 1/sr
valid_range 0.0...0.5
format Float_32

Volume Depolarization Ratio Statistics

units NoUnits
valid_range N/A
format Float_32

Integrated Volume Depolarization Ratio

units NoUnits
valid_range 0.0...1.0
format Float_32

Integrated Volume Depolarization Ratio Uncertainty

units NoUnits
valid_range 0.0...2.0
format Float_32

Attenuated Total Color Ratio Statistics

units NoUnits
valid_range N/A
format Float_32

Integrated Attenuated Total Color Ratio

units NoUnits
valid_range 0.0...2.0
format Float_32

Integrated Attenuated Total Color Ratio Uncertainty

units NoUnits
valid_range 0.0...3.0
format Float_32

Overlying Integrated Attenuated Backscatter 532

units 1/sr
valid_range 0.0...2.0
format Float_32

Layer IAB QA Factor

units NoUnits
valid_range 0.0...1.0
format Float_32

CAD Score

units NoUnits
valid_range 101...105
format Int_8

Feature Classification Flags

units NoUnits
valid_range 1...49146
format Uint_16

Code source

#!/usr/bin/env python

from pyhdf.SD import SD, SDC

import pprint

file_name = 'CAL_LID_L2_01kmCLay-ValStage1-V3-01.2008-01-08T13-55-27ZD.hdf'

file = SD(file_name, SDC.READ)

file_info = file.info()
print file_info

#----------------------------------------------------------------------------------------#
# print SDS names

datasets_dic = file.datasets()

sds_dic = {}
for key, value in datasets_dic.iteritems():
    #print key, value, value[3]
    sds_dic[value[3]] = key

pprint.pprint( sds_dic )

#----------------------------------------------------------------------------------------#
# print SDS info

for i in range(file_info[0]):
    sds_obj = file.select(sds_dic[i])
    sds_info = sds_obj.info()
    print i, ' | ', sds_dic[i], \
             ' | ', sds_info[1] , \
             ' | ', sds_info[2] , \
             ' | ', sds_info[3] , \
             ' | ', sds_info[4]

#----------------------------------------------------------------------------------------#
# print SDS Attributes

for i in range(127):
    sds_obj = file.select(sds_dic[i])
    sds_attributes = sds_obj.attributes()
    attributes = ''
    for key, value in sds_attributes.iteritems():
        attributes = attributes + key + ' ' + str(value) + '\n'
    print i ,  sds_dic[i]
    print attributes