-
Notifications
You must be signed in to change notification settings - Fork 0
/
read_atms_sdr.pro
148 lines (120 loc) · 3.99 KB
/
read_atms_sdr.pro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; ATMS SDR simplest reader
;;; Purpose: Use IDL to read and display a ATMS SDR granule in HDF5 format with minimal coding.
;;; Author: Likun.Wang@noaa.gov from UMD/ESSIC/CICS
;;; Date: August 23, 2016
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; 08/23/2016 First wrote it by modifying the VIIRS SDR reader.
PRO Read_ATMS_SDR, sdrFile, geoFile, $
bt=bt, $
lat=lat, lon=lon, $
midTime=midTime, $
satZenith=SatZenith, satAzimuth=satAzimuth, $
solarZenith=solarZenith, $
range=range, $
sdrQa=sdrQa, geoQa=geoQa,$
satPos=satPos, satVel=satVel,$
satAtt=satAtt
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; READ SDR file first
file_id = H5F_OPEN(sdrFile)
IF ARG_PRESENT(BT) THEN BEGIN
;get one band radiances
Data='/All_Data/ATMS-SDR_All/BrightnessTemperature'
dataset_id= H5D_OPEN(file_id,Data)
BT = H5D_Read(dataset_id)
H5D_CLOSE, dataset_id
Data='/All_Data/ATMS-SDR_All/BrightnessTemperatureFactors'
dataset_id= H5D_OPEN(file_id,Data)
factor = H5D_Read(dataset_id)
BT = factor[0]*BT + factor[1]
H5D_CLOSE, dataset_id
ENDIF
;;; get the SDR Quality Flag
IF ARG_PRESENT(sdrQa) THEN BEGIN
Data='/All_Data/'+VIIRSBAND+'/QF1_VIIRSMBANDSDR/'
dataset_id= H5D_OPEN(file_id, Data)
sdrQa = H5D_Read(dataset_id)
H5D_CLOSE, dataset_id
ENDIF
H5F_CLOSE, file_id
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; geolocation information
file_id = H5F_OPEN(GeoFile)
Geo=H5G_GET_MEMBER_NAME(file_id,'All_Data',0)
;get latitude
IF ARG_PRESENT(lat) or ARG_PRESENT(lon) THEN BEGIN
Data='/All_Data/'+Geo+'/Latitude'
dataset_id= H5D_OPEN(file_id,Data)
lat = H5D_Read(dataset_id)
H5D_CLOSE, dataset_id
;get longitude
Data='/All_Data/'+Geo+'/Longitude'
dataset_id= H5D_OPEN(file_id,Data)
lon = H5D_Read(dataset_id)
H5D_CLOSE, dataset_id
ENDIF
; get satellite zenith angle
IF ARG_PRESENT(satZenith) THEN BEGIN
Data='/All_Data/'+Geo+'/SatelliteZenithAngle/'
dataset_id= H5D_OPEN(file_id,Data)
satZenith = H5D_Read(dataset_id)
H5D_CLOSE, dataset_id
endIF
; get satellite azimuth angle
IF ARG_PRESENT(satAzimuth) THEN BEGIN
Data='/All_Data/'+Geo+'/SatelliteAzimuthAngle/'
dataset_id= H5D_OPEN(file_id,Data)
satAzimuth = H5D_Read(dataset_id)
H5D_CLOSE, dataset_id
endIF
;get mid scan time
IF ARG_PRESENT(midTime) THEN BEGIN
Data='/All_Data/'+Geo+'/MidTime/'
dataset_id= H5D_OPEN(file_id,Data)
midTime = H5D_Read(dataset_id)
midTIme = midTime*0.000001D
H5D_CLOSE, dataset_id
ENDIF
;;; get the GEO Quality Flag
IF ARG_PRESENT(geoQa) THEN BEGIN
Data='/All_Data/'+Geo+'/QF2_VIIRSSDRGEO/'
dataset_id= H5D_OPEN(file_id, Data)
geoQa = H5D_Read(dataset_id)
H5D_CLOSE, dataset_id
ENDIF
IF ARG_PRESENT(range) THEN BEGIN
Data='/All_Data/'+Geo+'/SatelliteRange/'
dataset_id= H5D_OPEN(file_id,Data)
range = H5D_Read(dataset_id)
H5D_CLOSE, dataset_id
ENDIF
IF ARG_PRESENT(satPos) THEN BEGIN
Data='/All_Data/'+Geo+'/SCPosition/'
dataset_id= H5D_OPEN(file_id,Data)
satPos = H5D_Read(dataset_id)
H5D_CLOSE, dataset_id
ENDIF
IF ARG_PRESENT(satVel) THEN BEGIN
Data='/All_Data/'+Geo+'/SCVelocity/'
dataset_id= H5D_OPEN(file_id,Data)
satVel = H5D_Read(dataset_id)
H5D_CLOSE, dataset_id
ENDIF
IF ARG_PRESENT(satAtt) THEN BEGIN
Data='/All_Data/'+Geo+'/SCAttitude/'
dataset_id= H5D_OPEN(file_id,Data)
satAtt = H5D_Read(dataset_id)
H5D_CLOSE, dataset_id
ENDIF
;;; Solor angles
IF ARG_PRESENT(SolarZenith) THEN BEGIN
Data='/All_Data/'+Geo+'/SolarZenithAngle/'
dataset_id= H5D_OPEN(file_id,Data)
solarZenith = H5D_Read(dataset_id)
H5D_CLOSE, dataset_id
ENDIF
H5F_CLOSE, file_id
return
END