source: trunk/src/scripts_Laura/ARCTIC/Travail_CEN/ice_delimit_AMSUB_data.py @ 55

Last change on this file since 55 was 54, checked in by lahlod, 10 years ago

modifs

File size: 19.7 KB
Line 
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3import string
4import numpy as np
5import matplotlib.pyplot as plt
6from pylab import *
7from mpl_toolkits.basemap import Basemap
8from mpl_toolkits.basemap import shiftgrid, cm
9from netCDF4 import Dataset
10import arctic_map # function to regrid coast limits
11import cartesian_grid_test # function to convert grid from polar to cartesian
12import scipy.special
13import ffgrid2
14import map_ffgrid
15from matplotlib import colors
16from matplotlib.font_manager import FontProperties
17import map_cartesian_grid
18
19
20
21
22MONTH = np.array(['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'])
23month = np.array(['JANUARY', 'FEBRUARY', 'MARCH', 'APRIL', 'MAY', 'JUNE', 'JULY', 'AUGUST', 'SEPTEMBER', 'OCTOBER', 'NOVEMBER', 'DECEMBER'])
24month_day = np.array([31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31])
25M = len(month)
26
27
28########################
29# grid characteristics #
30########################
31x0 = -3000. # min limit of grid
32x1 = 2500. # max limit of grid
33dx = 40.
34xvec = np.arange(x0, x1+dx, dx)
35nx = len(xvec) 
36y0 = -3000. # min limit of grid
37y1 = 3000. # max limit of grid
38dy = 40.
39yvec = np.arange(y0, y1+dy, dy)
40ny = len(yvec)
41
42
43frequ = 89
44
45#####################
46# read NETCDF files #
47#####################
48emis_spec_month = np.zeros([M, ny, nx], float)
49emis_lamb_month = np.zeros([M, ny, nx], float)
50ratio_emis = np.zeros([M, ny, nx], float)
51ratio_emis_vec = np.zeros([M, ny * nx], float)
52spec_emis_vec = np.zeros([M, ny * nx], float)
53lamb_emis_vec = np.zeros([M, ny * nx], float)
54print 'read data from files'
55for imo in range (0, M):
56    print 'month: ' + month[imo]
57    ### emissivity ###
58    print 'open emissivity file'
59    fichier_emis = Dataset('/net/argos/data/parvati/lahlod/ARCTIC/monthly_GLACE/gridded_data/cartesian_grid/res_40/cartesian_grid_monthly_data_lamb_spec_near_nadir_AMSUB' + str(frequ) + '_' + str(month[imo]) + '2009.nc', 'r', format='NETCDF3_CLASSIC')
60    xdist = fichier_emis.variables['longitude'][:]
61    ydist = fichier_emis.variables['latitude'][:]
62    day = fichier_emis.variables['days'][:]
63    emis_spec = fichier_emis.variables['e_spec'][:]
64    emis_lamb = fichier_emis.variables['e_lamb'][:]
65    fichier_emis.close()
66    ##### calculate monthly mean of emis #####
67    for ilat in range(0, len(ydist)):
68        for ilon in range (0, len(xdist)):
69            emis_spec_month[imo, ilat, ilon] = mean(emis_spec[ilat, ilon, 0 : month_day[imo]][nonzero(isnan(emis_spec[ilat, ilon, 0 : month_day[imo]]) == False)])
70            emis_lamb_month[imo, ilat, ilon] = mean(emis_lamb[ilat, ilon, 0 : month_day[imo]][nonzero(isnan(emis_lamb[ilat, ilon, 0 : month_day[imo]]) == False)])
71    ### monthly emissivity ratio ###
72    print 'open emissivity ratio file'
73    fichier_ratio = Dataset('/net/argos/data/parvati/lahlod/ARCTIC/monthly_GLACE/gridded_data/cartesian_grid/res_40/cartesian_grid_monthly_lamb-spec_ratio_near_nadir_AMSUB' + str(frequ) + '_' + str(month[imo]) + '2009.nc', 'r', format='NETCDF3_CLASSIC')
74    xdist = fichier_ratio.variables['longitude'][:]
75    ydist = fichier_ratio.variables['latitude'][:]
76    ratio_emis[imo, :, :] = fichier_ratio.variables['emis_ratio'][:]
77    fichier_ratio.close()
78    ### reshape in monthly vectors all data in 2D arrays ###
79    print 'reshape data'
80    ratio_emis_vec[imo, :] = reshape(ratio_emis[imo, :, :], size(ratio_emis[imo, :, :]))
81    spec_emis_vec[imo, :] = reshape(emis_spec_month[imo, :, :], size(emis_spec_month[imo, :, :]))
82    lamb_emis_vec[imo, :] = reshape(emis_lamb_month[imo, :, :], size(emis_lamb_month[imo, :, :]))
83
84
85'''
86# test:
87ion()
88x_ind, y_ind, z_ind, volume = arctic_map.arctic_map_lat50()
89x_coast = x_ind
90y_coast = y_ind
91z_coast = z_ind
92map_cartesian_grid.draw_map_cartes_l(x_coast, y_coast, z_coast, volume, xdist, ydist, emis_spec_month[0, :, :], 0.45, 1.02, 0.01, cm.s3pcpn_l_r, 'test')
93'''
94
95
96c = np.array(['r', 'b', 'c', 'm', 'y', 'g'])
97#limit_coef_spec = np.array([0.6, 0.6, 0.7, 0.8, 0.75]) # i1 = AMSUA23GHz / i2 = AMSUA30GHz / i3 = AMSUA50GHz / i4 = AMSUA89GHz / i5 = AMSUB89GHz
98#limit_coef_lamb = np.array([0.6, 0.6, 0.8, 0.8, 0.77]) # i1 = AMSUA23GHz / i2 = AMSUA30GHz / i3 = AMSUA50GHz / i4 = AMSUA89GHz / i5 = AMSUB89GHz
99#idata = 0
100fontP = FontProperties()
101fontP.set_size('small')
102print 'distribution of emissivity values'
103###################################
104# distribution of SPEC emissivity #
105###################################
106print 'spec'
107hist_vals_spec = np.zeros([M, 50], float)
108corresp_emis_spec = np.zeros([M, 50], float)
109for imo in range (0, M):
110    hist_vals_spec[imo, :] = hist(spec_emis_vec[imo, :][nonzero(isnan(spec_emis_vec[imo,:]) == False)], bins = 50, normed = True, histtype='step')[0]
111    for ibin in range (0, 50):
112        corresp_emis_spec[imo, ibin] = mean(hist(spec_emis_vec[imo, :][nonzero(isnan(spec_emis_vec[imo,:]) == False)], bins = 50, normed = True, histtype='step')[1][ibin : ibin + 2])
113
114## plot first six months of spec emissivity histograms ##
115ion()
116figure()
117for imo in range (0, 6):
118    plot(corresp_emis_spec[imo], hist_vals_spec[imo], c = str(c[imo]), label = str(month[imo]))
119
120grid()
121xlim(corresp_emis_spec.min() - 0.02, 1.02)
122xlabel('emissivity SPEC')
123ylabel('frequency of occurence')
124legend(loc = 2, prop = fontP)
125#plt.savefig('/usr/home/lahlod/twice_d/fig_output_ARCTIC/fig_output_sea_ice_study/ice_class_AMSUA/emiss_spec_AMSUA' + str(frequ) + '_JANUARY-JUNE_2009.png')
126## plot six following months of spec emissivity histograms ##
127figure()
128for imo in range (6, M):
129    plot(corresp_emis_spec[imo], hist_vals_spec[imo], c = str(c[imo - 6]), label = str(month[imo]))
130
131grid()
132xlim(corresp_emis_spec.min() - 0.02, 1.02)
133xlabel('emissivity SPEC')
134ylabel('frequency of occurence')
135legend(loc = 9, prop = fontP)
136#plt.savefig('/usr/home/lahlod/twice_d/fig_output_ARCTIC/fig_output_sea_ice_study/ice_class_AMSUA/emiss_spec_AMSUA' + str(frequ) + '_JULY-DECEMBER_2009.png')
137
138# find the emissivity value corresponding to the threshold of ice/no_ice limit
139emis_lim_spec = np.zeros([M], float)
140for imo in range (0, M):
141    print 'month ' + str(month[imo])
142    bb = np.where((corresp_emis_spec[imo, :] > 0.7) & (corresp_emis_spec[imo, :] < 0.77))[0] # only consider low emissivity values (open sea) // CHANGE EMISSIVITY VALUE ACCORDING TO FREQUENCY
143    aa = np.where(hist_vals_spec[imo, bb] == min(hist_vals_spec[imo, bb]))[0] # of these latter values, only consider emissivity values lower than 1/4*peak emissivity
144    #cc = np.where(hist_vals_spec[imo, bb] == max(hist_vals_spec[imo, bb]))[0] # which emissivity index corresponds to peak emissivity
145    #dd = np.where(aa > cc[0])[0]
146    emis_lim_spec[imo] = corresp_emis_spec[imo, bb][aa][0]
147
148# plot monthly evolution of emissivity spec threshold used for delimitation
149figure()
150plot(np.arange(0, M, 1), emis_lim_spec, 'b-+', label = 'emis SPEC')
151ylabel('emissivity SPEC threshold')
152grid()
153xticks(np.arange(0, M, 1), month, rotation = 25)
154legend(loc = 2)
155xlim(-1, M)
156plt.savefig('/usr/home/lahlod/twice_d/fig_output_ARCTIC/fig_output_sea_ice_study/ice_class_AMSUB/emis_lim_frequ_SPEC_AMSUB' + str(frequ) + '_2009.png')
157
158
159###################################
160# distribution of LAMB emissivity #
161###################################
162print 'lamb'
163hist_vals_lamb = np.zeros([M, 50], float)
164corresp_emis_lamb = np.zeros([M, 50], float)
165for imo in range (0, M):
166    hist_vals_lamb[imo, :] = hist(lamb_emis_vec[imo, :][nonzero(isnan(lamb_emis_vec[imo,:]) == False)], bins = 50, normed = True, histtype='step')[0]
167    for ibin in range (0, 50):
168        corresp_emis_lamb[imo, ibin] = mean(hist(lamb_emis_vec[imo, :][nonzero(isnan(lamb_emis_vec[imo,:]) == False)], bins = 50, normed = True, histtype='step')[1][ibin : ibin + 2])
169
170## plot first six months of spec emissivity histograms ##
171figure()
172for imo in range (0, 6):
173    plot(corresp_emis_lamb[imo], hist_vals_lamb[imo], c = str(c[imo]), label = str(month[imo]))
174
175grid()
176xlim(corresp_emis_lamb.min() - 0.02, 1.02)
177xlabel('emissivity LAMB')
178ylabel('frequency of occurence')
179legend(loc = 2, prop = fontP)
180#plt.savefig('/usr/home/lahlod/twice_d/fig_output_ARCTIC/fig_output_sea_ice_study/ice_class_AMSUA/emiss_lamb_AMSUA' + str(frequ) + '_JANUARY-JUNE_2009.png')
181## plot six following months of spec emissivity histograms ##
182figure()
183for imo in range (6, M):
184    plot(corresp_emis_lamb[imo], hist_vals_lamb[imo], c = str(c[imo - 6]), label = str(month[imo]))
185
186grid()
187xlim(corresp_emis_lamb.min() - 0.02, 1.02)
188xlabel('emissivity LAMB')
189ylabel('frequency of occurence')
190legend(loc = 9, prop = fontP)
191#plt.savefig('/usr/home/lahlod/twice_d/fig_output_ARCTIC/fig_output_sea_ice_study/ice_class_AMSUA/emiss_lamb_AMSUA' + str(frequ) + '_JULY-DECEMBER_2009.png')
192
193# find the emissivity value corresponding to the threshold of ice/no_ice limit
194emis_lim_lamb = np.zeros([M], float)
195for imo in range (0, M):
196    print 'month ' + str(month[imo])
197    bb = np.where((corresp_emis_lamb[imo, :] > 0.72) & (corresp_emis_lamb[imo, :] < 0.8))[0] # only consider low emissivity values (open sea) // CHANGE EMISSIVITY VALUE ACCORDING TO FREQUENCY
198    aa = np.where(hist_vals_lamb[imo, bb] == min(hist_vals_lamb[imo, bb]))[0] # of these latter values, only consider emissivity values lower than 1/4*peak emissivity
199    #cc = np.where(hist_vals_lamb[imo, bb] == max(hist_vals_lamb[imo, bb]))[0] # which emissivity index corresponds to peak emissivity
200    #dd = np.where(aa > cc[0])[0]
201    emis_lim_lamb[imo] = corresp_emis_lamb[imo, bb][aa][0]
202
203# plot monthly evolution of emissivity spec threshold used for delimitation
204figure()
205plot(np.arange(0, M, 1), emis_lim_lamb, 'b-+', label = 'emis LAMB')
206ylabel('emissivity LAMB threshold')
207grid()
208xticks(np.arange(0, M, 1), month, rotation = 25)
209legend(loc = 2)
210xlim(-1, M)
211plt.savefig('/usr/home/lahlod/twice_d/fig_output_ARCTIC/fig_output_sea_ice_study/ice_class_AMSUB/emis_lim_frequ_LAMB_AMSUB' + str(frequ) + '_2009.png')
212
213
214
215###################################
216# distribution of emissivity rate #
217###################################
218print 'rate'
219hist_vals_rate = np.zeros([M, 50], float)
220corresp_emis_rate = np.zeros([M, 50], float)
221for imo in range (0, M):
222    hist_vals_rate[imo, :] = hist(ratio_emis_vec[imo, :][nonzero(isnan(ratio_emis_vec[imo,:]) == False)], bins = 50, normed = True, histtype='step')[0]
223    for ibin in range (0, 50):
224        corresp_emis_rate[imo, ibin] = mean(hist(ratio_emis_vec[imo, :][nonzero(isnan(ratio_emis_vec[imo,:]) == False)], bins = 50, normed = True, histtype='step')[1][ibin : ibin + 2])
225
226## plot first six months of spec emissivity histograms ##
227figure()
228for imo in range (0, 6):
229    plot(corresp_emis_rate[imo], hist_vals_rate[imo], c = str(c[imo]), label = str(month[imo]))
230
231grid()
232xlim(corresp_emis_rate.min() - 0.02, corresp_emis_rate.max() + 0.02)
233xlabel('emissivity rate (%)')
234ylabel('frequency of occurence')
235legend(prop = fontP)
236#plt.savefig('/usr/home/lahlod/twice_d/fig_output_ARCTIC/fig_output_sea_ice_study/ice_class_AMSUA/emiss_rate_AMSUA'+str(frequ)+'_JANUARY-JUNE_2009.png')
237## plot six following months of spec emissivity histograms ##
238figure()
239for imo in range (6, M):
240    plot(corresp_emis_rate[imo], hist_vals_rate[imo], c = str(c[imo - 6]), label = str(month[imo]))
241
242grid()
243xlim(corresp_emis_rate.min() - 0.02, corresp_emis_rate.max() + 0.02)
244xlabel('emissivity rate (%)')
245ylabel('frequency of occurence')
246legend(loc = 9, prop = fontP)
247#plt.savefig('/usr/home/lahlod/twice_d/fig_output_ARCTIC/fig_output_sea_ice_study/ice_class_AMSUA/emiss_rate_AMSUA'+str(frequ)+'_JULY-DECEMBER_2009.png')
248
249# no definition of threshold for ICE / NO_ICE delimitation because no apparent distinction signal // use of this signal for internal ice classification
250'''
251# find the emissivity value corresponding to the threshold of ice/no_ice limit
252emis_lim_rate = np.zeros([M], float)
253for imo in range (0, M):
254    bb = np.where((corresp_emis_rate[imo, :] < 0.6))[0] # only consider low emissivity values (open sea) // CHANGE EMISSIVITY VALUE ACCORDING TO FREQUENCY
255    aa = np.where(hist_vals_rate[imo, bb] < max(hist_vals_rate[imo, bb]) / 4.)[0] # of these latter values, only consider emissivity values lower than 1/4*peak emissivity
256    cc = np.where(hist_vals_rate[imo, bb] == max(hist_vals_rate[imo, bb]))[0] # which emissivity index corresponds to peak emissivity
257    dd = np.where(aa > cc[0])[0]
258    emis_lim_rate[imo] = corresp_emis_rate[imo, bb][aa][dd[0]]
259
260# plot monthly evolution of emissivity spec threshold used for delimitation
261figure()
262plot(np.arange(0, M, 1), emis_lim_rate, 'b-+', label = 'emis LAMB')
263ylabel('emissivity rate threshold - AMSUB 89GHz')
264grid()
265xticks(np.arange(0, M, 1), month, rotation = 25)
266legend(loc = 2)
267xlim(-1, M)
268plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/ice_class_AMSUA/emis_lim_frequ_rate_AMSUA89_2009.png')
269'''
270
271
272##############################################################################
273# plot comparison of emissivity thresholds between spec and lamb assumptions #
274##############################################################################
275figure()
276plot(np.arange(0, M, 1), emis_lim_spec, 'b-+', label = 'emis SPEC')
277plot(np.arange(0, M, 1), emis_lim_lamb, 'g-+', label = 'emis LAMB')
278ylabel('emissivity threshold')
279grid()
280xticks(np.arange(0, M, 1), month, rotation = 25)
281legend(loc = 2, prop = fontP)
282xlim(-1, M)
283plt.savefig('/usr/home/lahlod/twice_d/fig_output_ARCTIC/fig_output_sea_ice_study/ice_class_AMSUB/emis_lim_frequ_spec_and_lamb_AMSUB' + str(frequ) + '_2009.png')
284
285
286
287
288################################################################
289# delimitation ice - no_ice with emissivity or ratio threshold #
290################################################################
291print 'definition of ice extent' 
292x_ind, y_ind, z_ind, volume = arctic_map.arctic_map_lat50()
293x_coast = x_ind
294y_coast = y_ind
295z_coast = z_ind
296#### SPEC emiss ####
297print 'spec'
298ice_zone_spec = np.zeros([M, 151, 139], float)
299for imo in range (0, M):
300    print 'month: ' + str(month[imo])
301    for ilat in range (0, 151):
302        for ilon in range (0, 139):
303            if (isnan(emis_spec_month[imo, ilat, ilon]) == True):
304                ice_zone_spec[imo, ilat, ilon] = NaN
305            else:
306                if (emis_spec_month[imo, ilat, ilon] <= emis_lim_spec[imo]): # use the monthly SPEC emissivity threshold
307                    ice_zone_spec[imo, ilat, ilon] = NaN
308                else:
309                    ice_zone_spec[imo, ilat, ilon] = emis_spec_month[imo, ilat, ilon]   
310    map_cartesian_grid.draw_map_cartes_l(x_coast, y_coast, z_coast, volume, xdist, ydist, ice_zone_spec[8, :, :], 0.5, 1.02, 0.01,  cm.s3pcpn_l_r, 'Sea ice emissivity spec (threshold : emis_SPEC > ' + str(emis_lim_spec[imo])[0:6] + ')')
311    title(str(month[imo]) + ' 2009 - AMSUA ' + str(frequ) + 'GHz')
312    plt.savefig('/usr/home/lahlod/twice_d/fig_output_ARCTIC/fig_output_sea_ice_study/ice_class_AMSUA/AMSUA' + str(frequ) + '_ice_emis_spec_thresh' + '_' + month[imo] + '2009.png')
313
314#### LAMB emiss ####
315print 'lamb'
316ice_zone_lamb = np.zeros([M, 151, 139], float)
317for imo in range (0, M):
318    print 'month: ' + str(month[imo])
319    for ilat in range (0, 151):
320        for ilon in range (0, 139):
321            if (isnan(emis_lamb_month[imo, ilat, ilon]) == True):
322                ice_zone_lamb[imo, ilat, ilon] = NaN
323            else:
324                if (emis_lamb_month[imo, ilat, ilon] <= emis_lim_lamb[imo]): # use the monthly SPEC emissivity threshold
325                    ice_zone_lamb[imo, ilat, ilon] = NaN
326                else:
327                    ice_zone_lamb[imo, ilat, ilon] = emis_lamb_month[imo, ilat, ilon]     
328    map_cartesian_grid.draw_map_cartes_l(x_coast, y_coast, z_coast, volume, xdist, ydist, ice_zone_lamb[imo, :, :], 0.5, 1.02, 0.01,  cm.s3pcpn_l_r, 'Sea ice emissivity lamb (threshold : emis_LAMB > ' + str(emis_lim_lamb[imo])[0:6] + ')')
329    title(str(month[imo]) + ' 2009 - AMSUA ' + str(frequ) + 'GHz')
330    plt.savefig('/usr/home/lahlod/twice_d/fig_output_ARCTIC/fig_output_sea_ice_study/ice_class_AMSUA/AMSUA' + str(frequ) + '_ice_emis_lamb_thresh' + '_' + month[imo] + '2009.png')
331
332
333
334###########################
335# calculation of ice area #
336###########################
337# nb of pixels near pole = 926
338print 'calculation of ice area'
339pix_area = 40. * 40.
340#### SPEC ####
341print 'spec'
342nb_pix_spec = np.zeros([M], float)
343total_ice_area_spec = np.zeros([M], float)
344for imo in range (0, M):
345    ice_spec = reshape(ice_zone_spec[imo, :, :], size(ice_zone_spec[imo, :, :]))
346    nb_pix_spec[imo] = len(np.where(isnan(ice_spec) == False)[0])
347    total_ice_area_spec[imo] = (pix_area * nb_pix_spec[imo]) + (926. * pix_area)
348
349
350#### LAMB ####
351print 'lamb'
352nb_pix_lamb = np.zeros([M], float)
353total_ice_area_lamb = np.zeros([M], float)
354for imo in range (0, M):
355    ice_lamb = reshape(ice_zone_lamb[imo, :, :], size(ice_zone_lamb[imo, :, :]))
356    nb_pix_lamb[imo] = len(np.where(isnan(ice_lamb) == False)[0])
357    total_ice_area_lamb[imo] = (pix_area * nb_pix_lamb[imo]) + (926. * pix_area)
358
359
360
361########################################## STACK DATA ###################################################
362
363######################
364# stack in .dat file #
365######################
366print 'start stacking in .dat file'
367data_classif = open ('/net/argos/data/parvati/lahlod/ARCTIC/AMSUB_ice_class/AMSUB'+str(frequ)+'_data_classification_parameters_ice_no-ice_2009.dat', 'a')
368for imo in range (0, M):
369    for ii in range (0, 50):
370        data_classif.write(('%(months)10s    %(hist_vals_spec)10.5f    %(corresp_emis_spec)10.5f    %(hist_vals_lamb)10.5f    %(corresp_emis_lamb)10.5f    %(hist_vals_rate)10.5f    %(corresp_emis_rate)10.5f    %(emis_lim_spec)10.5f    %(emis_lim_lamb)10.5f    %(spec_ice_area)10.5f    %(lamb_ice_area)10.5f   \n' % {
371                                            'months':month[imo],
372                                            'hist_vals_spec':hist_vals_spec[imo, ii],
373                                            'corresp_emis_spec':corresp_emis_spec[imo, ii],
374                                            'hist_vals_lamb':hist_vals_lamb[imo, ii],
375                                            'corresp_emis_lamb':corresp_emis_lamb[imo, ii],
376                                            'hist_vals_rate':hist_vals_rate[imo, ii],
377                                            'corresp_emis_rate':corresp_emis_rate[imo, ii],
378                                            'emis_lim_spec':emis_lim_spec[imo],
379                                            'emis_lim_lamb':emis_lim_lamb[imo],
380                                            'spec_ice_area':total_ice_area_spec[imo],
381                                            'lamb_ice_area':total_ice_area_lamb[imo],
382                                            }))
383
384data_classif.close()
385
386
387
388########################
389# stack in netcdf file #
390########################
391print 'start stacking'
392for imo in range (0, M):
393    print 'stack in file month ' + str(month[imo])
394    rootgrp = Dataset('/net/argos/data/parvati/lahlod/ARCTIC/AMSUB_ice_class/cartesian_grid_map_ice_no-ice_' + month[imo] + '2009_AMSUB' + str(frequ) + '_spec_lamb_thresholds.nc', 'w', format='NETCDF3_CLASSIC')
395    rootgrp.createDimension('longitude', len(xdist))
396    rootgrp.createDimension('latitude', len(ydist))
397    nc_lon = rootgrp.createVariable('longitude', 'f', ('longitude',))
398    nc_lat = rootgrp.createVariable('latitude', 'f', ('latitude',))
399    nc_ice_spec = rootgrp.createVariable('spec_ice_area', 'f', ('latitude', 'longitude'))
400    nc_ice_lamb = rootgrp.createVariable('lamb_ice_area', 'f', ('latitude', 'longitude'))
401    nc_lon[:] = xdist
402    nc_lat[:] = ydist
403    nc_ice_spec[:] = ice_zone_spec[imo, :, :]
404    nc_ice_lamb[:] = ice_zone_lamb[imo, :, :]
405    rootgrp.close()
406
407
408
409
410
411'''
412###################################
413# plot time evolution of ice area #
414###################################
415figure()
416plot(total_ice_area, '-+b', label = 'AMSUB SPEC')
417plot(total_ice_area_osi, '-^r', label = 'OSISAF')
418plot(total_ice_area_l, '-og', label = 'AMSUB LAMB')
419legend(loc = 3)
420xlim(-1, M)
421ylim(0.2*1e7, 1.3*1e7)
422xticks(np.arange(0, M, 1), month, rotation = 25)
423ylabel('totale ice area (square km)')
424grid()
425plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/ice_pix_area/total_ice_area_AMSUB_SPEC_LAMB_OSISAF_2009.png')
426'''
427
428
429
430
431
432
433
Note: See TracBrowser for help on using the repository browser.