Print all CALIOP v4 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 v4 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 3
11 Parallel_Column_Reflectance_532 2 [21120, 1] 5 4
12 Parallel_Column_Reflectance_Uncertainty_532 2 [21120, 1] 5 4
13 Perpendicular_Column_Reflectance_532 2 [21120, 1] 5 4
14 Perpendicular_Column_Reflectance_Uncertainty_532 2 [21120, 1] 5 4
15 Column_Integrated_Attenuated_Backscatter_532 2 [21120, 1] 5 4
16 Column_IAB_Cumulative_Probability 2 [21120, 1] 5 4
17 Tropopause_Height 2 [21120, 1] 5 4
18 Tropopause_Temperature 2 [21120, 1] 5 4
19 IGBP_Surface_Type 2 [21120, 1] 20 3
20 Snow_Ice_Surface_Type 2 [21120, 1] 21 3
21 DEM_Surface_Elevation 2 [21120, 1] 5 3
22 Number_Layers_Found 2 [21120, 1] 20 3
23 Layer_Top_Altitude 2 [21120, 10] 5 4
24 Layer_Base_Altitude 2 [21120, 10] 5 4
25 Layer_Top_Pressure 2 [21120, 10] 5 4
26 Midlayer_Pressure 2 [21120, 10] 5 4
27 Layer_Base_Pressure 2 [21120, 10] 5 4
28 Layer_Top_Temperature 2 [21120, 10] 5 4
29 Layer_Centroid_Temperature 2 [21120, 10] 5 4
30 Midlayer_Temperature 2 [21120, 10] 5 4
31 Layer_Base_Temperature 2 [21120, 10] 5 4
32 Opacity_Flag 2 [21120, 10] 20 4
33 Attenuated_Scattering_Ratio_Statistics_532 2 [21120, 60] 5 4
34 Attenuated_Backscatter_Statistics_532 2 [21120, 60] 5 4
35 Integrated_Attenuated_Backscatter_532 2 [21120, 10] 5 4
36 Integrated_Attenuated_Backscatter_Uncertainty_532 2 [21120, 10] 5 4
37 Attenuated_Backscatter_Statistics_1064 2 [21120, 60] 5 4
38 Integrated_Attenuated_Backscatter_1064 2 [21120, 10] 5 4
39 Integrated_Attenuated_Backscatter_Uncertainty_1064 2 [21120, 10] 5 4
40 Volume_Depolarization_Ratio_Statistics 2 [21120, 60] 5 4
41 Integrated_Volume_Depolarization_Ratio 2 [21120, 10] 5 4
42 Integrated_Volume_Depolarization_Ratio_Uncertainty 2 [21120, 10] 5 4
43 Attenuated_Total_Color_Ratio_Statistics 2 [21120, 60] 5 4
44 Integrated_Attenuated_Total_Color_Ratio 2 [21120, 10] 5 4
45 Integrated_Attenuated_Total_Color_Ratio_Uncertainty 2 [21120, 10] 5 4
46 Overlying_Integrated_Attenuated_Backscatter_532 2 [21120, 10] 5 4
47 Layer_IAB_QA_Factor 2 [21120, 10] 5 4
48 CAD_Score 2 [21120, 10] 20 4
49 Initial_CAD_Score 2 [21120, 10] 20 4
50 Feature_Classification_Flags 2 [21120, 10] 23 3
51 Surface_Top_Altitude_532 2 [21120, 1] 5 4
52 Surface_Base_Altitude_532 2 [21120, 1] 5 4
53 Surface_Integrated_Attenuated_Backscatter_532 2 [21120, 1] 5 4
54 Surface_532_Integrated_Depolarization_Ratio 2 [21120, 1] 5 4
55 Surface_532_Integrated_Attenuated_Color_Ratio 2 [21120, 1] 5 4
56 Surface_Detection_Flags_532 2 [21120, 1] 23 4
57 Surface_Detection_Confidence_532 2 [21120, 1] 5 4
58 Surface_Overlying_Integrated_Attenuated_Backscatter_532 2 [21120, 1] 5 4
59 Surface_Scaled_RMS_Background_532 2 [21120, 1] 5 4
60 Surface_Peak_Signal_532 2 [21120, 1] 5 4
61 Surface_Detections_333m_532 2 [21120, 1] 22 4
62 Surface_Top_Altitude_1064 2 [21120, 1] 5 4
63 Surface_Base_Altitude_1064 2 [21120, 1] 5 4
64 Surface_Integrated_Attenuated_Backscatter_1064 2 [21120, 1] 5 4
65 Surface_1064_Integrated_Depolarization_Ratio 2 [21120, 1] 5 4
66 Surface_1064_Integrated_Attenuated_Color_Ratio 2 [21120, 1] 5 4
67 Surface_Detection_Flags_1064 2 [21120, 1] 23 4
68 Surface_Detection_Confidence_1064 2 [21120, 1] 5 4
69 Surface_Overlying_Integrated_Attenuated_Backscatter_1064 2 [21120, 1] 5 4
70 Surface_Scaled_RMS_Background_1064 2 [21120, 1] 5 4
71 Surface_Peak_Signal_1064 2 [21120, 1] 5 4
72 Surface_Detections_333m_1064 2 [21120, 1] 22 4

Print SDS attributes

Profile ID

units NoUnits
valid_range 1...3153600000
format Int_32

Latitude

units degrees
valid_range 90.0...90.0
format Float_32

Longitude

units degrees
valid_range 180.0...180.0
format Float_32

Profile Time

units seconds
valid_range 4.204E8...1.072E9
format Float_64

Profile UTC Time

units NoUnits
valid_range 60426.0...261231.0
format Float_64

Day Night Flag

units NoUnits
valid_range 0...1
format Int_8

Off Nadir Angle

units degrees
valid_range 0.0...5.0
format Float_32

Solar Zenith Angle

units degrees
valid_range 0.0...180.0
format Float_32

Solar Azimuth Angle

units degrees
valid_range 180.0...180.0
format Float_32

Scattering Angle

units degrees
valid_range 0.0...180.0
format Float_32

Spacecraft Position

units kilometers
valid_range 8000.0...8000.0
format Float_64

Parallel Column Reflectance 532

units NoUnits
valid_range 0.0...2.0
fillvalue 9999.0
format Float_32

Parallel Column Reflectance Uncertainty 532

units NoUnits
valid_range 0.0...TBD
fillvalue 9999.0
format Float_32

Perpendicular Column Reflectance 532

units NoUnits
valid_range 0.0...2.0
fillvalue 9999.0
format Float_32

Perpendicular Column Reflectance Uncertainty 532

units NoUnits
valid_range 0.0...TBD
fillvalue 9999.0
format Float_32

Column Integrated Attenuated Backscatter 532

units per steradian
valid_range 0.0...2.0
fillvalue 9999.0
format Float_32

Column IAB Cumulative Probability

units NoUnits
valid_range 0.0...1.0
fillvalue 9999.0
format Float_32

Tropopause Height

units kilometers
valid_range 4.0...22.0
fillvalue 9999.0
format Float_32

Tropopause Temperature

units degrees C
valid_range 100.0...20.0
fillvalue 9999.0
format Float_32

IGBP Surface Type

units NoUnits
valid_range 1...18
format Int_8

Snow Ice Surface Type

units NoUnits
valid_range 0...255
format UInt_8

DEM Surface Elevation

units kilometers
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 kilometers
valid_range 0.5...20.2
fillvalue 9999.0
format Float_32

Layer Base Altitude

units kilometers
valid_range 0.5...20.2
fillvalue 9999.0
format Float_32

Layer Top Pressure

units hPA
valid_range 1.0...1086.0
fillvalue 9999.0
format Float_32

Midlayer Pressure

units hPA
valid_range 1.0...1086.0
fillvalue 9999.0
format Float_32

Layer Base Pressure

units hPA
valid_range 1.0...1086.0
fillvalue 9999.0
format Float_32

Layer Top Temperature

units degrees C
valid_range 110.0...60.0
fillvalue 9999.0
format Float_32

Layer Centroid Temperature

units degrees C
valid_range 110.0...60.0
fillvalue 9999.0
format Float_32

Midlayer Temperature

units degrees C
valid_range 110.0...60.0
fillvalue 9999.0
format Float_32

Layer Base Temperature

units degrees C
valid_range 110.0...60.0
fillvalue 9999.0
format Float_32

Opacity Flag

units NoUnits
valid_range 0...1
fillvalue 99
format Int_8

Attenuated Scattering Ratio Statistics 532

units NoUnits
valid_range N/A
fillvalue 9999.0
format Float_32

Attenuated Backscatter Statistics 532

units per kilometer per steradian
valid_range N/A
fillvalue 9999.0
format Float_32

Integrated Attenuated Backscatter 532

units per steradian
valid_range 0.0...1.8
fillvalue 9999.0
format Float_32

Integrated Attenuated Backscatter Uncertainty 532

units per steradian
valid_range 0.0...0.5
fillvalue 9999.0
format Float_32

Attenuated Backscatter Statistics 1064

units per kilometer per steradian
valid_range N/A
fillvalue 9999.0
format Float_32

Integrated Attenuated Backscatter 1064

units per steradian
valid_range 0.0...1.8
fillvalue 9999.0
format Float_32

Integrated Attenuated Backscatter Uncertainty 1064

units per steradian
valid_range 0.0...0.5
fillvalue 9999.0
format Float_32

Volume Depolarization Ratio Statistics

units NoUnits
valid_range N/A
fillvalue 9999.0
format Float_32

Integrated Volume Depolarization Ratio

units NoUnits
valid_range 0.0...1.0
fillvalue 9999.0
format Float_32

Integrated Volume Depolarization Ratio Uncertainty

units NoUnits
valid_range 0.0...2.0
fillvalue 9999.0
format Float_32

Attenuated Total Color Ratio Statistics

units NoUnits
valid_range N/A
fillvalue 9999.0
format Float_32

Integrated Attenuated Total Color Ratio

units NoUnits
valid_range 0.0...2.0
fillvalue 9999.0
format Float_32

Integrated Attenuated Total Color Ratio Uncertainty

units NoUnits
valid_range 0.0...3.0
fillvalue 9999.0
format Float_32

Overlying Integrated Attenuated Backscatter 532

units per steradian
valid_range 0.0...2.0
fillvalue 9999.0
format Float_32

Layer IAB QA Factor

units NoUnits
valid_range 0.0...1.0
fillvalue 9999.0
format Float_32

CAD Score

units NoUnits
valid_range 101...106
fillvalue 127
format Int_8

Initial CAD Score

units NoUnits
valid_range 101...119
fillvalue 127
format Int_8

Feature Classification Flags

units NoUnits
valid_range 1...49146
format UInt_16

Surface Top Altitude 532

units kilometers
valid_range 0.5...8.2
fillvalue 9999.0
format Float_32

Surface Base Altitude 532

units kilometers
valid_range 0.5...8.2
fillvalue 9999.0
format Float_32

Surface Integrated Attenuated Backscatter 532

units per steradian
valid_range 0.0...2.0
fillvalue 9999.0
format Float_32

Surface 532 Integrated Depolarization Ratio

units NoUnits
valid_range 0.0...1.0
fillvalue 9999.0
format Float_32

Surface 532 Integrated Attenuated Color Ratio

units NoUnits
valid_range 0.0...2.0
fillvalue 9999.0
format Float_32

Surface Detection Flags 532

units NoUnits
valid_range 0...8192
fillvalue 32768
format UInt_16

Surface Detection Confidence 532

units NoUnits
valid_range 0.0...1.0
fillvalue 9999.0
format Float_32

Surface Overlying Integrated Attenuated Backscatter 532

units per steradian
valid_range 0.0...2.0
fillvalue 9999.0
format Float_32

Surface Scaled RMS Background 532

units per kilometer per steradian
valid_range 0.0...0.05
fillvalue 9999.0
format Float_32

Surface Peak Signal 532

units per kilometer per steradian
valid_range 0.0...3.5
fillvalue 9999.0
format Float_32

Surface Detections 333m 532

units NoUnits
valid_range 0...15
fillvalue 9999
format Int_16

Surface Top Altitude 1064

units kilometers
valid_range 0.5...8.2
fillvalue 9999.0
format Float_32

Surface Base Altitude 1064

units kilometers
valid_range 0.5...8.2
fillvalue 9999.0
format Float_32

Surface Integrated Attenuated Backscatter 1064

units per steradian
valid_range 0.0...2.0
fillvalue 9999.0
format Float_32

Surface 1064 Integrated Depolarization Ratio

units NoUnits
valid_range 0.0...1.0
fillvalue 9999.0
format Float_32

Surface 1064 Integrated Attenuated Color Ratio

units NoUnits
valid_range 0.0...2.0
fillvalue 9999.0
format Float_32

Surface Detection Flags 1064

units NoUnits
valid_range 0...16384
fillvalue 32768
format UInt_16

Surface Detection Confidence 1064

units NoUnits
valid_range 0.0...1.0
fillvalue 9999.0
format Float_32

Surface Overlying Integrated Attenuated Backscatter 1064

units per steradian
valid_range 0.0...2.0
fillvalue 9999.0
format Float_32

Surface Scaled RMS Background 1064

units per kilometer per steradian
valid_range 0.0...0.05
fillvalue 9999.0
format Float_32

Surface Peak Signal 1064

units per kilometer per steradian
valid_range 0.0...3.5
fillvalue 9999.0
format Float_32

Surface Detections 333m 1064

units NoUnits
valid_range 0...15
fillvalue 9999
format Int_16

Code source

#!/usr/bin/env python

from pyhdf.SD import SD, SDC

import pprint

file_name = 'CAL_LID_L2_01kmCLay-Standard-V4-10.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