1 | #!/usr/bin/env python |
---|
2 | # -*- coding: utf-8 -*- |
---|
3 | import string |
---|
4 | import numpy as np |
---|
5 | import matplotlib.pyplot as plt |
---|
6 | from pylab import * |
---|
7 | from mpl_toolkits.basemap import Basemap |
---|
8 | from mpl_toolkits.basemap import shiftgrid, cm |
---|
9 | from netCDF4 import Dataset |
---|
10 | |
---|
11 | |
---|
12 | ############################ |
---|
13 | ## monthly mean emisivity ## |
---|
14 | ############################ |
---|
15 | month = array(['JANUARY', 'FEBRUARY', 'MARCH', 'APRIL', 'MAY', 'JUNE', 'JULY']) |
---|
16 | #rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_FEB-APR-JUL_ANTARC.nc', 'w', format = 'NETCDF4') |
---|
17 | rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_JAN-MAR-MAY-JUN_ANTARC.nc', 'w', format = 'NETCDF4') |
---|
18 | rootgrp.createDimension('longitude', len(lon)) |
---|
19 | rootgrp.createDimension('latitude', len(lat)) |
---|
20 | rootgrp.createDimension('channels', 2) |
---|
21 | rootgrp.createDimension('month', 4) |
---|
22 | nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',)) |
---|
23 | nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',)) |
---|
24 | ncchan = rootgrp.createVariable('channels', 'f8', ('channels',)) |
---|
25 | ncmon = rootgrp.createVariable('month', 'f8', ('month',)) |
---|
26 | ncemis = rootgrp.createVariable('emissivity', 'f8', ('month', 'channels', 'latitude', 'longitude')) |
---|
27 | nclon[:] =lon |
---|
28 | nclat[:] = lat |
---|
29 | ncchan[:] = [23.8, 89] |
---|
30 | ncmon[:] = [1., 2., 3., 4.] |
---|
31 | ncemis[:] = mean_outz2 |
---|
32 | |
---|
33 | rootgrp.close() |
---|
34 | |
---|
35 | |
---|
36 | |
---|
37 | ##################### |
---|
38 | ## daily emisivity ## |
---|
39 | ##################### |
---|
40 | month = array(['JANUARY', 'FEBRUARY', 'MARCH', 'APRIL', 'MAY', 'JUNE', 'JULY']) |
---|
41 | len_month = np.array([31, 28, 31, 30, 31, 30, 31]) |
---|
42 | chan = array(['CH1', 'CH2']) |
---|
43 | lon = lonch1_JAN |
---|
44 | lat = latch1_JAN |
---|
45 | |
---|
46 | ## JANUARY ## |
---|
47 | imo = 0 |
---|
48 | rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_fov21_ANTARC.nc', 'w', format = 'NETCDF4') |
---|
49 | rootgrp.createDimension('longitude', len(lon)) |
---|
50 | rootgrp.createDimension('latitude', len(lat)) |
---|
51 | rootgrp.createDimension('channels', len(chan)) |
---|
52 | rootgrp.createDimension('day', len_month[imo]) |
---|
53 | nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',)) |
---|
54 | nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',)) |
---|
55 | ncchan = rootgrp.createVariable('channels', 'f8', ('channels',)) |
---|
56 | ncjours = rootgrp.createVariable('day', 'f8', ('day',)) |
---|
57 | ncemis = rootgrp.createVariable('emissivity', 'f8', ('channels', 'latitude', 'longitude', 'day')) |
---|
58 | nclon[:] =lon |
---|
59 | nclat[:] = lat |
---|
60 | ncchan[:] = [23.8, 89] |
---|
61 | ncjours[:] = np.arange(0, len_month[imo], 1) |
---|
62 | ncemis[:] = OUTZ_JAN |
---|
63 | |
---|
64 | rootgrp.close() |
---|
65 | |
---|
66 | |
---|
67 | ## FEBRUARY ## |
---|
68 | imo = 1 |
---|
69 | rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_fov21_ANTARC.nc', 'w', format = 'NETCDF4') |
---|
70 | rootgrp.createDimension('longitude', len(lon)) |
---|
71 | rootgrp.createDimension('latitude', len(lat)) |
---|
72 | rootgrp.createDimension('channels', len(chan)) |
---|
73 | rootgrp.createDimension('day', len_month[imo]) |
---|
74 | nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',)) |
---|
75 | nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',)) |
---|
76 | ncchan = rootgrp.createVariable('channels', 'f8', ('channels',)) |
---|
77 | ncjours = rootgrp.createVariable('day', 'f8', ('day',)) |
---|
78 | ncemis = rootgrp.createVariable('emissivity', 'f8', ('channels', 'latitude', 'longitude', 'day')) |
---|
79 | nclon[:] =lon |
---|
80 | nclat[:] = lat |
---|
81 | ncchan[:] = [23.8, 89] |
---|
82 | ncjours[:] = np.arange(0, len_month[imo], 1) |
---|
83 | ncemis[:] = OUTZ_FEB |
---|
84 | |
---|
85 | rootgrp.close() |
---|
86 | |
---|
87 | |
---|
88 | ## MARCH ## |
---|
89 | imo = 2 |
---|
90 | rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_fov21_ANTARC.nc', 'w', format = 'NETCDF4') |
---|
91 | rootgrp.createDimension('longitude', len(lon)) |
---|
92 | rootgrp.createDimension('latitude', len(lat)) |
---|
93 | rootgrp.createDimension('channels', len(chan)) |
---|
94 | rootgrp.createDimension('day', len_month[imo]) |
---|
95 | nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',)) |
---|
96 | nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',)) |
---|
97 | ncchan = rootgrp.createVariable('channels', 'f8', ('channels',)) |
---|
98 | ncjours = rootgrp.createVariable('day', 'f8', ('day',)) |
---|
99 | ncemis = rootgrp.createVariable('emissivity', 'f8', ('channels', 'latitude', 'longitude', 'day')) |
---|
100 | nclon[:] =lon |
---|
101 | nclat[:] = lat |
---|
102 | ncchan[:] = [23.8, 89] |
---|
103 | ncjours[:] = np.arange(0, len_month[imo], 1) |
---|
104 | ncemis[:] = OUTZ_MAR |
---|
105 | |
---|
106 | rootgrp.close() |
---|
107 | |
---|
108 | |
---|
109 | ## APRIL ## |
---|
110 | imo = 3 |
---|
111 | rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_fov21_ANTARC.nc', 'w', format = 'NETCDF4') |
---|
112 | rootgrp.createDimension('longitude', len(lon)) |
---|
113 | rootgrp.createDimension('latitude', len(lat)) |
---|
114 | rootgrp.createDimension('channels', len(chan)) |
---|
115 | rootgrp.createDimension('day', len_month[imo]) |
---|
116 | nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',)) |
---|
117 | nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',)) |
---|
118 | ncchan = rootgrp.createVariable('channels', 'f8', ('channels',)) |
---|
119 | ncjours = rootgrp.createVariable('day', 'f8', ('day',)) |
---|
120 | ncemis = rootgrp.createVariable('emissivity', 'f8', ('channels', 'latitude', 'longitude', 'day')) |
---|
121 | nclon[:] =lon |
---|
122 | nclat[:] = lat |
---|
123 | ncchan[:] = [23.8, 89] |
---|
124 | ncjours[:] = np.arange(0, len_month[imo], 1) |
---|
125 | ncemis[:] = OUTZ_APR |
---|
126 | |
---|
127 | rootgrp.close() |
---|
128 | |
---|
129 | |
---|
130 | ## MAY ## |
---|
131 | imo = 4 |
---|
132 | rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_fov21_ANTARC.nc', 'w', format = 'NETCDF4') |
---|
133 | rootgrp.createDimension('longitude', len(lon)) |
---|
134 | rootgrp.createDimension('latitude', len(lat)) |
---|
135 | rootgrp.createDimension('channels', len(chan)) |
---|
136 | rootgrp.createDimension('day', len_month[imo]) |
---|
137 | nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',)) |
---|
138 | nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',)) |
---|
139 | ncchan = rootgrp.createVariable('channels', 'f8', ('channels',)) |
---|
140 | ncjours = rootgrp.createVariable('day', 'f8', ('day',)) |
---|
141 | ncemis = rootgrp.createVariable('emissivity', 'f8', ('channels', 'latitude', 'longitude', 'day')) |
---|
142 | nclon[:] =lon |
---|
143 | nclat[:] = lat |
---|
144 | ncchan[:] = [23.8, 89] |
---|
145 | ncjours[:] = np.arange(0, len_month[imo], 1) |
---|
146 | ncemis[:] = OUTZ_MAY |
---|
147 | |
---|
148 | rootgrp.close() |
---|
149 | |
---|
150 | |
---|
151 | ## JUNE ## |
---|
152 | imo = 5 |
---|
153 | rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_fov21_ANTARC.nc', 'w', format = 'NETCDF4') |
---|
154 | rootgrp.createDimension('longitude', len(lon)) |
---|
155 | rootgrp.createDimension('latitude', len(lat)) |
---|
156 | rootgrp.createDimension('channels', len(chan)) |
---|
157 | rootgrp.createDimension('day', len_month[imo]) |
---|
158 | nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',)) |
---|
159 | nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',)) |
---|
160 | ncchan = rootgrp.createVariable('channels', 'f8', ('channels',)) |
---|
161 | ncjours = rootgrp.createVariable('day', 'f8', ('day',)) |
---|
162 | ncemis = rootgrp.createVariable('emissivity', 'f8', ('channels', 'latitude', 'longitude', 'day')) |
---|
163 | nclon[:] =lon |
---|
164 | nclat[:] = lat |
---|
165 | ncchan[:] = [23.8, 89] |
---|
166 | ncjours[:] = np.arange(0, len_month[imo], 1) |
---|
167 | ncemis[:] = OUTZ_JUN |
---|
168 | |
---|
169 | rootgrp.close() |
---|
170 | |
---|
171 | |
---|
172 | ## JUlY## |
---|
173 | imo = 6 |
---|
174 | rootgrp = Dataset ('/net/argos/data/parvati/lahlod/AMUSUA_CH1-CH15_' + month[imo] +'_fov21_ANTARC.nc', 'w', format = 'NETCDF4') |
---|
175 | rootgrp.createDimension('longitude', len(lon)) |
---|
176 | rootgrp.createDimension('latitude', len(lat)) |
---|
177 | rootgrp.createDimension('channels', len(chan)) |
---|
178 | rootgrp.createDimension('day', len_month[imo]) |
---|
179 | nclon = rootgrp.createVariable('longitude', 'f8', ('longitude',)) |
---|
180 | nclat = rootgrp.createVariable('latitude', 'f8', ('latitude',)) |
---|
181 | ncchan = rootgrp.createVariable('channels', 'f8', ('channels',)) |
---|
182 | ncjours = rootgrp.createVariable('day', 'f8', ('day',)) |
---|
183 | ncemis = rootgrp.createVariable('emissivity', 'f8', ('channels', 'latitude', 'longitude', 'day')) |
---|
184 | nclon[:] =lon |
---|
185 | nclat[:] = lat |
---|
186 | ncchan[:] = [23.8, 89] |
---|
187 | ncjours[:] = np.arange(0, len_month[imo], 1) |
---|
188 | ncemis[:] = OUTZ_JUL |
---|
189 | |
---|
190 | rootgrp.close() |
---|
191 | |
---|
192 | |
---|
193 | |
---|
194 | |
---|