Changeset 45
- Timestamp:
- 07/24/14 17:12:02 (10 years ago)
- Location:
- trunk/src/scripts_Laura/ARCTIC/Travail_CEN
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/scripts_Laura/ARCTIC/Travail_CEN/discrim_rate_espec-elamb_espec.py
r44 r45 50 50 ### AMSUA23 ### 51 51 print 'open data file' 52 fichier = Dataset('/net/argos/data/parvati/lahlod/ARCTIC/monthly_GLACE/gridded_data/cartesian_grid_monthly_data_lamb_spec_near_nadir_AMSUA 89_' + str(month[imo]) + '2009.nc', 'r', format='NETCDF3_CLASSIC')52 fichier = Dataset('/net/argos/data/parvati/lahlod/ARCTIC/monthly_GLACE/gridded_data/cartesian_grid_monthly_data_lamb_spec_near_nadir_AMSUA50_' + str(month[imo]) + '2009.nc', 'r', format='NETCDF3_CLASSIC') 53 53 xdist = fichier.variables['longitude'][:] 54 54 ydist = fichier.variables['latitude'][:] … … 96 96 for imo in range (0, M): 97 97 print 'map month ' +str(month[imo]) 98 map_cartesian_grid.draw_map_cartes_l(x_coast, y_coast, z_coast, volume, xdist, ydist, monthly_ratio[imo, :, :], 0., 10., 0.1, colormap, 'emissivity ratio [(LAMB - SPEC)/SPEC]*100')99 title(month[imo] + ' 2009 - AMSUA 89GHz')100 plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/comp_lamb_spec/space_evolution/EMIS/cartesian_grid/emis_ratio/emis_ratio_spec-lamb_AMSUA 89_' + month[imo] + '2009.png')98 map_cartesian_grid.draw_map_cartes_l(x_coast, y_coast, z_coast, volume, xdist, ydist, monthly_ratio[imo, :, :], 0., 20., 0.1, colormap, 'emissivity ratio [(LAMB - SPEC)/SPEC]*100') 99 title(month[imo] + ' 2009 - AMSUA 50GHz') 100 plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/comp_lamb_spec/space_evolution/EMIS/cartesian_grid/emis_ratio/emis_ratio_spec-lamb_AMSUA50_' + month[imo] + '2009.png') 101 101 102 102 … … 112 112 for imo in range (0, M): 113 113 print 'stack in file month ' + str(month[imo]) 114 rootgrp = Dataset('/net/argos/data/parvati/lahlod/ARCTIC/monthly_GLACE/gridded_data/cartesian_grid_monthly_lamb-spec_ratio_near_nadir_AMSUA 89_' + month[imo] + '2009.nc', 'w', format='NETCDF3_CLASSIC')114 rootgrp = Dataset('/net/argos/data/parvati/lahlod/ARCTIC/monthly_GLACE/gridded_data/cartesian_grid_monthly_lamb-spec_ratio_near_nadir_AMSUA50_' + month[imo] + '2009.nc', 'w', format='NETCDF3_CLASSIC') 115 115 rootgrp.createDimension('longitude', len(xdist)) 116 116 rootgrp.createDimension('latitude', len(ydist)) -
trunk/src/scripts_Laura/ARCTIC/Travail_CEN/ice_delimit_AMSUB_data.py
r44 r45 17 17 import map_cartesian_grid 18 18 19 20 21 19 22 MONTH = np.array(['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']) 20 23 month = np.array(['JANUARY', 'FEBRUARY', 'MARCH', 'APRIL', 'MAY', 'JUNE', 'JULY', 'AUGUST', 'SEPTEMBER', 'OCTOBER', 'NOVEMBER', 'DECEMBER']) … … 48 51 spec_emis_vec = np.zeros([M, ny * nx], float) 49 52 lamb_emis_vec = np.zeros([M, ny * nx], float) 53 print 'read data from files' 50 54 for imo in range (0, M): 51 55 print 'month: ' + month[imo] 52 56 ### emissivity ### 53 57 print 'open emissivity file' 54 fichier_emis = Dataset('/net/argos/data/parvati/lahlod/ARCTIC/monthly_GLACE/gridded_data/cartesian_grid_monthly_data_lamb_spec_near_nadir_AMSUA 23_' + str(month[imo]) + '2009.nc', 'r', format='NETCDF3_CLASSIC')58 fichier_emis = Dataset('/net/argos/data/parvati/lahlod/ARCTIC/monthly_GLACE/gridded_data/cartesian_grid_monthly_data_lamb_spec_near_nadir_AMSUA89_' + str(month[imo]) + '2009.nc', 'r', format='NETCDF3_CLASSIC') 55 59 xdist = fichier_emis.variables['longitude'][:] 56 60 ydist = fichier_emis.variables['latitude'][:] … … 66 70 ### monthly emissivity ratio ### 67 71 print 'open emissivity ratio file' 68 fichier_ratio = Dataset('/net/argos/data/parvati/lahlod/ARCTIC/monthly_GLACE/gridded_data/cartesian_grid_monthly_lamb-spec_ratio_near_nadir_AMSUA 23_' + str(month[imo]) + '2009.nc', 'r', format='NETCDF3_CLASSIC')72 fichier_ratio = Dataset('/net/argos/data/parvati/lahlod/ARCTIC/monthly_GLACE/gridded_data/cartesian_grid_monthly_lamb-spec_ratio_near_nadir_AMSUA89_' + str(month[imo]) + '2009.nc', 'r', format='NETCDF3_CLASSIC') 69 73 xdist = fichier_ratio.variables['longitude'][:] 70 74 ydist = fichier_ratio.variables['latitude'][:] … … 89 93 90 94 c = np.array(['r', 'b', 'c', 'm', 'y', 'g']) 95 limit_coef_spec = np.array([0.6, 0.7, 0.8]) # i1 = 23GHz / i2 = 50GHz / i3 = 89GHz 96 limit_coef_lamb = np.array([0.6, 0.8, 0.8]) # i1 = 23GHz / i2 = 50GHz / i3 = 89GHz 97 idata = 2 98 print 'distribution of emissivity values' 91 99 ################################### 92 100 # distribution of SPEC emissivity # 93 101 ################################### 102 print 'spec' 94 103 hist_vals_spec = np.zeros([M, 50], float) 95 104 corresp_emis_spec = np.zeros([M, 50], float) … … 112 121 fontP.set_size('small') 113 122 legend(loc = 2, prop = fontP) 114 plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/ice_class_AMSUA/emiss_spec_AMSUA23_JANUARY-JUNE_2009.png')123 #plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/ice_class_AMSUA/emiss_spec_AMSUA50_JANUARY-JUNE_2009.png') 115 124 ## plot six following months of spec emissivity histograms ## 116 125 figure() … … 123 132 ylabel('frequency of occurence') 124 133 legend(loc = 9, prop = fontP) 125 plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/ice_class_AMSUA/emiss_spec_AMSUA23_JULY-DECEMBER_2009.png')134 #plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/ice_class_AMSUA/emiss_spec_AMSUA50_JULY-DECEMBER_2009.png') 126 135 127 136 # find the emissivity value corresponding to the threshold of ice/no_ice limit … … 129 138 for imo in range (0, M): 130 139 print 'month ' + str(month[imo]) 131 bb = np.where((corresp_emis_spec[imo, :] < 0.6))[0] # only consider low emissivity values (open sea) // CHANGE EMISSIVITY VALUE ACCORDING TO FREQUENCY140 bb = np.where((corresp_emis_spec[imo, :] < limit_coef_spec[idata]))[0] # only consider low emissivity values (open sea) // CHANGE EMISSIVITY VALUE ACCORDING TO FREQUENCY 132 141 aa = np.where(hist_vals_spec[imo, bb] < max(hist_vals_spec[imo, bb]) / 2.)[0] # of these latter values, only consider emissivity values lower than 1/4*peak emissivity 133 142 cc = np.where(hist_vals_spec[imo, bb] == max(hist_vals_spec[imo, bb]))[0] # which emissivity index corresponds to peak emissivity … … 138 147 figure() 139 148 plot(np.arange(0, M, 1), emis_lim_spec, 'b-+', label = 'emis SPEC') 140 ylabel('emissivity SPEC threshold - AMSUA 23GHz')149 ylabel('emissivity SPEC threshold') 141 150 grid() 142 151 xticks(np.arange(0, M, 1), month, rotation = 25) 143 152 legend(loc = 2) 144 153 xlim(-1, M) 145 plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/ice_class_AMSUA/emis_lim_frequ_SPEC_AMSUA23_2009.png')154 #plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/ice_class_AMSUA/emis_lim_frequ_SPEC_AMSUA50_2009.png') 146 155 147 156 … … 149 158 # distribution of LAMB emissivity # 150 159 ################################### 160 print 'lamb' 151 161 hist_vals_lamb = np.zeros([M, 50], float) 152 162 corresp_emis_lamb = np.zeros([M, 50], float) … … 166 176 ylabel('frequency of occurence') 167 177 legend(loc = 2, prop = fontP) 168 plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/ice_class_AMSUA/emiss_lamb_AMSUA 23_JANUARY-JUNE_2009.png')178 plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/ice_class_AMSUA/emiss_lamb_AMSUA50_JANUARY-JUNE_2009.png') 169 179 ## plot six following months of spec emissivity histograms ## 170 180 figure() … … 177 187 ylabel('frequency of occurence') 178 188 legend(loc = 9, prop = fontP) 179 plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/ice_class_AMSUA/emiss_lamb_AMSUA23_JULY-DECEMBER_2009.png')189 #plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/ice_class_AMSUA/emiss_lamb_AMSUA50_JULY-DECEMBER_2009.png') 180 190 181 191 # find the emissivity value corresponding to the threshold of ice/no_ice limit … … 183 193 for imo in range (0, M): 184 194 print 'mont ' + str(month[imo]) 185 bb = np.where((corresp_emis_lamb[imo, :] < 0.6))[0] # only consider low emissivity values (open sea) // CHANGE EMISSIVITY VALUE ACCORDING TO FREQUENCY195 bb = np.where((corresp_emis_lamb[imo, :] < limit_coef_lamb[idata]))[0] # only consider low emissivity values (open sea) // CHANGE EMISSIVITY VALUE ACCORDING TO FREQUENCY 186 196 aa = np.where(hist_vals_lamb[imo, bb] < max(hist_vals_lamb[imo, bb]) / 2.)[0] # of these latter values, only consider emissivity values lower than 1/4*peak emissivity 187 197 cc = np.where(hist_vals_lamb[imo, bb] == max(hist_vals_lamb[imo, bb]))[0] # which emissivity index corresponds to peak emissivity … … 192 202 figure() 193 203 plot(np.arange(0, M, 1), emis_lim_lamb, 'b-+', label = 'emis LAMB') 194 ylabel('emissivity LAMB threshold - AMSUB 23GHz')204 ylabel('emissivity LAMB threshold') 195 205 grid() 196 206 xticks(np.arange(0, M, 1), month, rotation = 25) 197 207 legend(loc = 2) 198 208 xlim(-1, M) 199 plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/ice_class_AMSUA/emis_lim_frequ_LAMB_AMSUA23_2009.png')209 #plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/ice_class_AMSUA/emis_lim_frequ_LAMB_AMSUA50_2009.png') 200 210 201 211 … … 204 214 # distribution of emissivity rate # 205 215 ################################### 216 print 'rate' 206 217 hist_vals_rate = np.zeros([M, 50], float) 207 218 corresp_emis_rate = np.zeros([M, 50], float) … … 221 232 ylabel('frequency of occurence') 222 233 legend(prop = fontP) 223 plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/ice_class_AMSUA/emiss_rate_AMSUA23_JANUARY-JUNE_2009.png')234 #plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/ice_class_AMSUA/emiss_rate_AMSUA50_JANUARY-JUNE_2009.png') 224 235 ## plot six following months of spec emissivity histograms ## 225 236 figure() … … 232 243 ylabel('frequency of occurence') 233 244 legend(loc = 9, prop = fontP) 234 plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/ice_class_AMSUA/emiss_rate_AMSUA23_JULY-DECEMBER_2009.png')245 #plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/ice_class_AMSUA/emiss_rate_AMSUA50_JULY-DECEMBER_2009.png') 235 246 236 247 # no definition of threshold for ICE / NO_ICE delimitation because no apparent distinction signal // use of this signal for internal ice classification … … 263 274 plot(np.arange(0, M, 1), emis_lim_spec, 'b-+', label = 'emis SPEC') 264 275 plot(np.arange(0, M, 1), emis_lim_lamb, 'g-+', label = 'emis LAMB') 265 ylabel('emissivity threshold - AMSUA 23GHz')276 ylabel('emissivity threshold') 266 277 grid() 267 278 xticks(np.arange(0, M, 1), month, rotation = 25) 268 279 legend(loc = 2, prop = fontP) 269 280 xlim(-1, M) 270 plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/ice_class_AMSUA/emis_lim_frequ_spec_and_lamb_AMSUA23_2009.png')281 #plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/ice_class_AMSUA/emis_lim_frequ_spec_and_lamb_AMSUA50_2009.png') 271 282 272 283 … … 276 287 # delimitation ice - no_ice with emissivity or ratio threshold # 277 288 ################################################################ 289 print 'definition of ice extent' 278 290 x_ind, y_ind, z_ind, volume = arctic_map.arctic_map_lat50() 279 291 x_coast = x_ind 280 292 y_coast = y_ind 281 293 z_coast = z_ind 282 ice_zone = np.zeros([M, 151, 139], float) 294 #### SPEC emiss #### 295 print 'spec' 296 ice_zone_spec = np.zeros([M, 151, 139], float) 283 297 for imo in range (0, M): 284 298 print 'month: ' + str(month[imo]) … … 286 300 for ilon in range (0, 139): 287 301 if (isnan(emis_spec_month[imo, ilat, ilon]) == True): 288 ice_zone [imo, ilat, ilon] = NaN302 ice_zone_spec[imo, ilat, ilon] = NaN 289 303 else: 290 304 if (emis_spec_month[imo, ilat, ilon] <= emis_lim_spec[imo]): # use the monthly SPEC emissivity threshold 291 ice_zone [imo, ilat, ilon] = 0.305 ice_zone_spec[imo, ilat, ilon] = 0. 292 306 else: 293 ice_zone[imo, ilat, ilon] = 1. 294 map_cartesian_grid.draw_map_cartes_l(x_coast, y_coast, z_coast, volume, xdist, ydist, ice_zone[imo, :, :], -1, 2., 1., colors.ListedColormap(['0.5', 'blue']), 'Ice limit (threshold : emis_SPEC > ' + str(emis_lim_spec[imo])[0:6] + ')') 295 title(str(month[imo]) + ' 2009 - AMSUA 23GHz') 296 plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/ice_class_AMSUA/AMSUA23_ice_emis_spec_thresh' + '_' + month[imo] + '2009.png') 297 298 307 ice_zone_spec[imo, ilat, ilon] = 1. 308 '''map_cartesian_grid.draw_map_cartes_l(x_coast, y_coast, z_coast, volume, xdist, ydist, ice_zone_spec[imo, :, :], -1, 2., 1., colors.ListedColormap(['0.5', 'blue']), 'Ice limit (threshold : emis_SPEC > ' + str(emis_lim_spec[imo])[0:6] + ')') 309 title(str(month[imo]) + ' 2009 - AMSUA 89GHz') 310 plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/ice_class_AMSUA/AMSUA89_ice_emis_spec_thresh' + '_' + month[imo] + '2009.png')''' 311 312 #### LAMB emiss #### 313 print 'lamb' 314 ice_zone_lamb = np.zeros([M, 151, 139], float) 315 for imo in range (0, M): 316 print 'month: ' + str(month[imo]) 317 for ilat in range (0, 151): 318 for ilon in range (0, 139): 319 if (isnan(emis_lamb_month[imo, ilat, ilon]) == True): 320 ice_zone_lamb[imo, ilat, ilon] = NaN 321 else: 322 if (emis_lamb_month[imo, ilat, ilon] <= emis_lim_lamb[imo]): # use the monthly SPEC emissivity threshold 323 ice_zone_lamb[imo, ilat, ilon] = 0. 324 else: 325 ice_zone_lamb[imo, ilat, ilon] = 1. 326 '''map_cartesian_grid.draw_map_cartes_l(x_coast, y_coast, z_coast, volume, xdist, ydist, ice_zone_lamb[imo, :, :], -1, 2., 1., colors.ListedColormap(['0.5', 'blue']), 'Ice limit (threshold : emis_LAMB > ' + str(emis_lim_lamb[imo])[0:6] + ')') 327 title(str(month[imo]) + ' 2009 - AMSUA 89GHz') 328 plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/ice_class_AMSUA/AMSUA89_ice_emis_lamb_thresh' + '_' + month[imo] + '2009.png')''' 299 329 300 330 … … 304 334 ########################### 305 335 # nb of pixels near pole = 926 336 print 'calculation of ice area' 306 337 pix_area = 40. * 40. 307 nb_pix = np.zeros([M], float) 308 total_ice_area = np.zeros([M], float) 309 for imo in range (0, M): 310 ice = reshape(ice_zone[imo, :, :], size(ice_zone[imo, :, :])) 311 nb_pix[imo] = len(np.where(ice == 1.)[0]) 312 total_ice_area[imo] = (pix_area * nb_pix[imo]) + (926. * pix_area) 313 314 315 spec_ice_area = total_ice_area 316 317 318 figure() 319 plot(lamb_ice_area, 'g', label = 'lamb') 320 plot(spec_ice_area, 'b', label = 'spec') 321 plot(total_monthly_ice_area_osisaf, 'r', label = 'OSISAF') 322 ylabel('total ice area (square km)') 323 grid() 324 xticks(np.arange(0, M, 1), month, rotation = 25) 325 legend(loc = 3, prop = fontP) 326 title('AMSUA 23GHz') 327 xlim(-1, M) 328 plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/total_ice_area_AMSUA23_OSISAF_2009.png') 338 #### SPEC #### 339 print 'spec' 340 nb_pix_spec = np.zeros([M], float) 341 total_ice_area_spec = np.zeros([M], float) 342 for imo in range (0, M): 343 ice_spec = reshape(ice_zone_spec[imo, :, :], size(ice_zone_spec[imo, :, :])) 344 nb_pix_spec[imo] = len(np.where(ice_spec == 1.)[0]) 345 total_ice_area_spec[imo] = (pix_area * nb_pix_spec[imo]) + (926. * pix_area) 346 347 348 #### LAMB #### 349 print 'lamb' 350 nb_pix_lamb = np.zeros([M], float) 351 total_ice_area_lamb = np.zeros([M], float) 352 for imo in range (0, M): 353 ice_lamb = reshape(ice_zone_lamb[imo, :, :], size(ice_zone_lamb[imo, :, :])) 354 nb_pix_lamb[imo] = len(np.where(ice_lamb == 1.)[0]) 355 total_ice_area_lamb[imo] = (pix_area * nb_pix_lamb[imo]) + (926. * pix_area) 356 357 358 359 ########################################## STACK DATA ################################################### 360 329 361 330 362 ########################## 331 363 # stack of ice area data # 332 364 ########################## 333 # stack in .dat file OSISAF data334 print 'start stacking in .dat file'335 data_osisaf = open ('/net/argos/data/parvati/lahlod/ARCTIC/OSISAF_Ice_Types/OSISAF_daily_ice_no-ice_2009.dat', 'a')336 for imo in range (0, M):337 for ijr in range (0, month_day[imo]):338 data_osisaf.write(('%(months)10s %(days)2.0f %(total_monthly_ice_area_osisaf)10.5f %(total_ice_area_osisaf)10.5f \n' % {339 'months':month[imo],340 'days':np.arange(1, month_day[imo] + 1)[ijr],341 'total_monthly_ice_area_osisaf':total_monthly_ice_area_osisaf[imo],342 'total_ice_area_osisaf':total_ice_area_osisaf[imo, ijr],343 }))344 345 data_osisaf.close()346 347 348 365 # stack in .dat file 349 366 print 'start stacking in .dat file' 350 data_classif = open ('/net/argos/data/parvati/lahlod/ARCTIC/ 2009.dat', 'a')351 for imo in range (0, 50):352 for ii in range (0, month_day[imo]):353 data_classif.write(('%(months)10s %(hist_vals_spec)10.5f %(corresp_emis_spec)10.5f %(hist_vals_lamb)10.5f %( orresp_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' % {367 data_classif = open ('/net/argos/data/parvati/lahlod/ARCTIC/AMSUA_ice_class/AMSUA89_data_classification_parameters_ice_no-ice_2009.dat', 'a') 368 for 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' % { 354 371 'months':month[imo], 355 372 'hist_vals_spec':hist_vals_spec[imo, ii], … … 358 375 'corresp_emis_lamb':corresp_emis_lamb[imo, ii], 359 376 'hist_vals_rate':hist_vals_rate[imo, ii], 377 'corresp_emis_rate':corresp_emis_rate[imo, ii], 360 378 'emis_lim_spec':emis_lim_spec[imo], 361 379 'emis_lim_lamb':emis_lim_lamb[imo], 362 'spec_ice_area': spec_ice_area[imo],363 'lamb_ice_area': lamb_ice_area[imo],380 'spec_ice_area':total_ice_area_spec[imo], 381 'lamb_ice_area':total_ice_area_lamb[imo], 364 382 })) 365 383 366 384 data_classif.close() 367 385 ''' 368 386 # stack in netcdf file 369 387 print 'start stacking' 370 388 for imo in range (0, M): 371 389 print 'stack in file month ' + str(month[imo]) 372 rootgrp = Dataset('/net/argos/data/parvati/lahlod/ARCTIC/AMSUA_ice_class/cartesian_grid_map_ice_no-ice_' + month[imo] + '2009_AMSUA 23.nc', 'w', format='NETCDF3_CLASSIC')390 rootgrp = Dataset('/net/argos/data/parvati/lahlod/ARCTIC/AMSUA_ice_class/cartesian_grid_map_ice_no-ice_' + month[imo] + '2009_AMSUA50_spec_lamb_thresholds.nc', 'w', format='NETCDF3_CLASSIC') 373 391 rootgrp.createDimension('longitude', len(xdist)) 374 392 rootgrp.createDimension('latitude', len(ydist)) 375 393 nc_lon = rootgrp.createVariable('longitude', 'f', ('longitude',)) 376 394 nc_lat = rootgrp.createVariable('latitude', 'f', ('latitude',)) 377 nc_ice = rootgrp.createVariable('ice_area', 'f', ('latitude', 'longitude')) 395 nc_ice_spec = rootgrp.createVariable('spec_ice_area', 'f', ('latitude', 'longitude')) 396 nc_ice_lamb = rootgrp.createVariable('lamb_ice_area', 'f', ('latitude', 'longitude')) 378 397 nc_lon[:] = xdist 379 398 nc_lat[:] = ydist 380 nc_ice[:] = ice_zone[imo, :, :] 399 nc_ice_spec[:] = ice_zone_spec[imo, :, :] 400 nc_ice_lamb[:] = ice_zone_lamb[imo, :, :] 381 401 rootgrp.close() 382 383 384 ############################################################################################################# 385 386 ######################################### 387 # comparison with OSISAF sea ice extent # 388 ######################################### 389 osi_ice = np.zeros([M, 31, 151, 139]) 390 for imo in range (0, M): 391 print 'open OSISAF file month ' + str(month[imo]) 392 fichier_osisaf = Dataset('/net/argos/data/parvati/lahlod/ARCTIC/OSISAF_Ice_Types/OSISAF_ice_types_cartesian_grid/OSISAF_ice_types_cartes_grid_' + str(month[imo]) + '_2009.nc', 'r', format='NETCDF3_CLASSIC') 393 xdist = fichier_osisaf.variables['longitude'][:] 394 ydist = fichier_osisaf.variables['latitude'][:] 395 day = fichier_osisaf.variables['days'][:] 396 osi_type = fichier_osisaf.variables['osi_ice_type'][:] 397 fichier_osisaf.close() 398 for ilon in range (0, len(xdist)): 399 for ilat in range (0, len(ydist)): 400 for ijr in range (0, month_day[imo]): 401 if ((isnan(osi_type[ijr, ilat, ilon]) == True) & (xdist[ilon] >= -312.5) & (xdist[ilon] <= 328.5) & (ydist[ilat] >=-334.3) & (ydist[ilat] <= 338.5)): 402 osi_ice[imo, ijr, ilat, ilon] = 1. 403 else: 404 if (osi_type[ijr, ilat, ilon] >= 2.): 405 osi_ice[imo, ijr, ilat, ilon] = 1. 406 else: 407 if (isnan(osi_type[ijr, ilat, ilon]) == True): 408 osi_ice[imo, ijr, ilat, ilon] = NaN 409 else: 410 osi_ice[imo, ijr, ilat, ilon] = 0. 411 412 413 # test: 414 colormap = colors.ListedColormap(['cyan','blue']) 415 map_cartesian_grid.draw_map_cartes_l(x_coast, y_coast, z_coast, volume, xvec, yvec, osi_ice[10, 0, :, :], -1, 2, 1, colormap, 'ice_type') 416 417 418 ################################## 419 # calculation of OSISAF ice area # 420 ################################## 421 pix_area = 40. * 40. 422 nb_pix_osisaf = np.zeros([M, 31], float) 423 total_ice_area_osisaf = np.zeros([M, 31], float) 424 total_monthly_ice_area_osisaf = np.zeros([M], float) 425 for imo in range (0, M): 426 for ijr in range (0, month_day[imo]): 427 ice = reshape(osi_ice[imo, ijr, :, :], size(osi_ice[imo, ijr, :, :])) 428 nb_pix_osisaf[imo, ijr] = len(np.where(ice == 1.)[0]) 429 total_ice_area_osisaf[imo, ijr] = pix_area * nb_pix_osisaf[imo, ijr] 430 total_monthly_ice_area_osisaf[imo] = mean(total_ice_area_osisaf[imo, 0 : month_day[imo]][nonzero(isnan(total_ice_area_osisaf[imo, 0 : month_day[imo]]) == False)]) + (926. * pix_area) 431 432 433 434 435 402 ''' 403 404 405 406 407 ''' 436 408 ################################### 437 409 # plot time evolution of ice area # … … 448 420 grid() 449 421 plt.savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/ice_pix_area/total_ice_area_AMSUB_SPEC_LAMB_OSISAF_2009.png') 450 451 452 453 454 455 456 457 422 ''' 423 424 425 426 427 428 429 -
trunk/src/scripts_Laura/ARCTIC/Travail_CEN/read_cartesian_gridded_AMSUA23.py
r44 r45 34 34 x0 = -3000. # min limit of grid 35 35 x1 = 2500. # max limit of grid 36 dx = 40. 36 dx = 40. # resolution for AMSUA data = 40km // resultion for AMSUB data = 20km 37 37 xvec = np.arange(x0, x1+dx, dx) 38 38 nx = len(xvec) 39 39 y0 = -3000. # min limit of grid 40 40 y1 = 3000. # max limit of grid 41 dy = 40. 41 dy = 40. # resolution for AMSUA data = 40km // resultion for AMSUB data = 20km 42 42 yvec = np.arange(y0, y1+dy, dy) 43 43 ny = len(yvec) … … 53 53 for imo in range (0, M): 54 54 print 'open file ' + str(month[imo]) 55 file_amsua = Dataset('/net/argos/data/parvati/lahlod/ARCTIC/monthly_GLACE/gridded_data/cartesian_grid_monthly_data_lamb_spec_near_nadir_AMSUA 89_' + month[imo] + '2009.nc', 'r', format='NETCDF3_CLASSIC')55 file_amsua = Dataset('/net/argos/data/parvati/lahlod/ARCTIC/monthly_GLACE/gridded_data/cartesian_grid_monthly_data_lamb_spec_near_nadir_AMSUA50_' + month[imo] + '2009.nc', 'r', format='NETCDF3_CLASSIC') 56 56 lon_amsua = file_amsua.variables['longitude'][:] 57 57 lat_amsua = file_amsua.variables['latitude'][:] … … 78 78 for imo in range (0, M): 79 79 # emiss SPEC 80 map_cartesian_grid.draw_map_cartes_l(x_coast, y_coast, z_coast, volume, xvec, yvec, es_a_month[imo, :, :], 0. 6, 1.02, 0.01, colormap, 'emissivity SPEC')81 title(month[imo] + ' 2009 - AMSUA 89GHz')82 savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/comp_lamb_spec/space_evolution/EMIS/cartesian_grid/emis_spec_AMSUA 89_' + month[imo] + '2009.png')80 map_cartesian_grid.draw_map_cartes_l(x_coast, y_coast, z_coast, volume, xvec, yvec, es_a_month[imo, :, :], 0.4, 1.02, 0.01, colormap, 'emissivity SPEC') 81 title(month[imo] + ' 2009 - AMSUA 50GHz') 82 savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/comp_lamb_spec/space_evolution/EMIS/cartesian_grid/emis_spec_AMSUA50_' + month[imo] + '2009.png') 83 83 # emis SPEC-LAMB 84 map_cartesian_grid.draw_map_cartes_l(x_coast, y_coast, z_coast, volume, xvec, yvec, esl_a_month[imo, :, :], 0., 0. 04, 0.001, colormap, 'emissivity LAMB - SPEC')85 title(month[imo] + ' 2009 - AMSUA 89GHz')86 savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/comp_lamb_spec/space_evolution/EMIS/cartesian_grid/emis_spec-lamb_AMSUA 89_' + month[imo] + '2009.png')84 map_cartesian_grid.draw_map_cartes_l(x_coast, y_coast, z_coast, volume, xvec, yvec, esl_a_month[imo, :, :], 0., 0.12, 0.001, colormap, 'emissivity LAMB - SPEC') 85 title(month[imo] + ' 2009 - AMSUA 50GHz') 86 savefig('/usr/home/lahlod/twice_d/figure_output_ARCTIC/figure_output_CEN/comp_lamb_spec/space_evolution/EMIS/cartesian_grid/emis_spec-lamb_AMSUA50_' + month[imo] + '2009.png') 87 87 88 88 -
trunk/src/scripts_Laura/ARCTIC/Travail_CEN/read_osisaf_ice_types.py
r42 r45 31 31 x0 = -3000. # min limit of grid 32 32 x1 = 2500. # max limit of grid 33 dx = 40.33 dx = 10. 34 34 xvec = np.arange(x0, x1+dx, dx) 35 35 nx = len(xvec) 36 36 y0 = -3000. # min limit of grid 37 37 y1 = 3000. # max limit of grid 38 dy = 40.38 dy = 10. 39 39 yvec = np.arange(y0, y1+dy, dy) 40 40 ny = len(yvec) … … 76 76 ################################################ 77 77 print 'open file month' + str(month[imo]) 78 rootgrp = Dataset('/net/argos/data/parvati/lahlod/ARCTIC/OSISAF_Ice_Types/OSISAF_ice_types_cartesian_grid/OSISAF_ice_types_cartes_grid_ ' + str(month[imo]) + '_2009.nc', 'w', format='NETCDF3_CLASSIC')78 rootgrp = Dataset('/net/argos/data/parvati/lahlod/ARCTIC/OSISAF_Ice_Types/OSISAF_ice_types_cartesian_grid/OSISAF_ice_types_cartes_grid_res-10_' + str(month[imo]) + '_2009.nc', 'w', format='NETCDF3_CLASSIC') 79 79 rootgrp.createDimension('longitude', len(xvec)) 80 80 rootgrp.createDimension('latitude', len(yvec)) -
trunk/src/scripts_Laura/ARCTIC/Travail_CEN/read_spec_lamb_nadir.py
r44 r45 31 31 x0 = -3000. # min limit of grid 32 32 x1 = 2500. # max limit of grid 33 dx = 40.33 dx = 20. 34 34 xvec = np.arange(x0, x1+dx, dx) 35 35 nx = len(xvec) 36 36 y0 = -3000. # min limit of grid 37 37 y1 = 3000. # max limit of grid 38 dy = 40.38 dy = 20. 39 39 yvec = np.arange(y0, y1+dy, dy) 40 40 ny = len(yvec) … … 57 57 esl75 = np.zeros([ny, nx, 31, M], float) 58 58 esl100 = np.zeros([ny, nx, 31, M], float)''' 59 for imo in range ( 0, M):59 for imo in range (10, M): 60 60 print 'month: ' + month[imo] 61 fichier = open('/net/argos/data/parvati/lahlod/ARCTIC/monthly_GLACE/lamb_spec_param_near_nadir_' + month[imo] + '2009 _AMSUA89.dat','r')61 fichier = open('/net/argos/data/parvati/lahlod/ARCTIC/monthly_GLACE/lamb_spec_param_near_nadir_' + month[imo] + '2009.dat','r') 62 62 numlines = 0 63 63 for line in fichier: numlines += 1 64 64 fichier.close 65 fichier = open('/net/argos/data/parvati/lahlod/ARCTIC/monthly_GLACE/lamb_spec_param_near_nadir_' + month[imo] + '2009 _AMSUA89.dat','r')65 fichier = open('/net/argos/data/parvati/lahlod/ARCTIC/monthly_GLACE/lamb_spec_param_near_nadir_' + month[imo] + '2009.dat','r') 66 66 nbtotal = numlines-1 67 67 iligne = 0 … … 189 189 ############################################### 190 190 print 'stacking of gridded data' 191 rootgrp = Dataset('/net/argos/data/parvati/lahlod/ARCTIC/monthly_GLACE/gridded_data/cartesian_grid_ monthly_data_lamb_spec_near_nadir_AMSUA89_' + month[imo] + '2009.nc', 'w', format='NETCDF3_CLASSIC')191 rootgrp = Dataset('/net/argos/data/parvati/lahlod/ARCTIC/monthly_GLACE/gridded_data/cartesian_grid_res-20_monthly_data_lamb_spec_near_nadir_AMSUB89_' + month[imo] + '2009.nc', 'w', format='NETCDF3_CLASSIC') 192 192 rootgrp.createDimension('longitude', nx) 193 193 rootgrp.createDimension('latitude', ny)
Note: See TracChangeset
for help on using the changeset viewer.