;$Id$ function read_ecm_v1_5_lut, lut_name ;--- Missing = -999.0 ;--- open cdfid = ncdf_open(lut_name) ;--- attributes ncdf_attget, cdfid, /GLOBAL, 'n_class', N_Class ncdf_attget, cdfid, /GLOBAL, 'n_sfc_type', N_Sfc ncdf_attget, cdfid, /GLOBAL, 'n_bins_reg', N_Bins ;--- allocate space in structure Ecm_Lut = {N_Sfc : N_Sfc, $ N_Class : N_Class, $ N_Bins : N_Bins, $ Sfc_Type_Names : strarr(N_Sfc), $ Classifier_Names : strarr(N_Class), $ Prior_Prob : fltarr(N_Sfc), $ Optimal_Post_Prob : fltarr(N_Sfc), $ Class_Cond_Ratio : fltarr(N_Bins,N_Class,N_Sfc), $ Class_Bin_Size : fltarr(N_Class,N_Sfc), $ Class_Bin_Start : fltarr(N_Class,N_Sfc), $ Class_Bin_End : fltarr(N_Class,N_Sfc), $ Class_Solzen_Min : fltarr(N_Class), $ Class_Solzen_Max : fltarr(N_Class), $ Class_Glintzen_Min : fltarr(N_Class), $ Class_Glintzen_Max : fltarr(N_Class), $ Class_Tsfc_Min : fltarr(N_Class), $ Class_Tsfc_Max : fltarr(N_Class), $ Class_Zsfc_Min : fltarr(N_Class), $ Class_Zsfc_Max : fltarr(N_Class), $ Class_Coast_Min : intarr(N_Class), $ Class_Coast_Max : intarr(N_Class), $ Class_Sfc_Type_Flag : intarr(N_Class,N_sfc),$ Log10_Emiss_Tropo_Class_Idx : 0, $ Emiss_Tropo_Class_Idx : 0, $ T_11_Class_Idx : 0, $ T_Std_Class_Idx : 0, $ Log10_T_Std_Class_Idx : 0, $ T_Max_Class_Idx : 0, $ T_Clear_Class_Idx : 0, $ FMFT_Class_Idx : 0, $ Emiss_375_All_Class_Idx : 0, $ Emiss_375_Day_Class_Idx : 0, $ Emiss_375_Night_Class_Idx : 0, $ Emiss_375_Emiss_Tropo_Class_Idx : 0, $ Log10_Ref_063_Day_Class_Idx : 0, $ Ref_063_Day_Class_Idx : 0, $ Ref_063_Min_3x3_Day_Class_Idx : 0, $ Ref_Std_Day_Class_Idx : 0, $ Ref_086_Day_Class_Idx : 0, $ Ref_Ratio_Day_Class_Idx : 0, $ Ref_138_Day_Class_Idx : 0, $ Ref_375_Day_Class_Idx : 0, $ Ndsi_Day_Class_Idx : 0, $ Btd_11_85_Class_Idx : 0, $ Btd_375_11_Night_Class_Idx : 0, $ Btd_375_11_Day_Class_Idx : 0, $ Btd_375_11_All_Class_Idx : 0, $ Bt_11_67_Covar_Class_Idx : 0, $ Btd_11_67_Class_Idx : 0, $ Btd_85_73_Class_Idx : 0, $ Opd_063_Day_Class_Idx : 0, $ Log10_Opd_063_Day_Class_Idx : 0, $ Zcld_Opa_Class_Idx : 0} ;--- read data ncdf_varget, cdfid, ncdf_varid(cdfid,'sfc_type_names'), Sfc_Type_Names_Byte ncdf_varget, cdfid, ncdf_varid(cdfid,'classifier_names'), Classifier_Names_Byte ncdf_varget, cdfid, ncdf_varid(cdfid,'optimal_posterior_prob'), x Ecm_Lut.Optimal_Post_Prob = x ncdf_varget, cdfid, ncdf_varid(cdfid,'prior_yes'), x Ecm_Lut.Prior_Prob = x ncdf_varget, cdfid, ncdf_varid(cdfid,'optimal_posterior_prob'), x Ecm_Lut.Optimal_Post_Prob = x ncdf_varget, cdfid, ncdf_varid(cdfid,'delta_bin'), x Ecm_Lut.Class_Bin_Size = x ncdf_varget, cdfid, ncdf_varid(cdfid,'bin_start'), X Ecm_Lut.Class_Bin_Start = x ncdf_varget, cdfid, ncdf_varid(cdfid,'bin_end'), x Ecm_Lut.Class_Bin_End = x ncdf_varget, cdfid, ncdf_varid(cdfid,'class_cond_ratio_reg'), x Ecm_Lut.Class_Cond_Ratio = x ncdf_varget, cdfid, ncdf_varid(cdfid,'solzen_min'), x Ecm_Lut.Class_Solzen_Min = x ncdf_varget, cdfid, ncdf_varid(cdfid,'solzen_max'), x Ecm_Lut.Class_Solzen_Max = x ncdf_varget, cdfid, ncdf_varid(cdfid,'glintzen_min'), x Ecm_Lut.Class_Glintzen_Min = x ncdf_varget, cdfid, ncdf_varid(cdfid,'glintzen_max'), x Ecm_Lut.Class_Glintzen_Max = x ncdf_varget, cdfid, ncdf_varid(cdfid,'tsfc_min'), x Ecm_Lut.Class_Tsfc_Min = x ncdf_varget, cdfid, ncdf_varid(cdfid,'tsfc_max'), x Ecm_Lut.Class_Tsfc_Max = x ncdf_varget, cdfid, ncdf_varid(cdfid,'zsfc_min'), x Ecm_Lut.Class_Zsfc_Min = x ncdf_varget, cdfid, ncdf_varid(cdfid,'zsfc_max'), x Ecm_Lut.Class_Zsfc_Max = x ncdf_varget, cdfid, ncdf_varid(cdfid,'coast_min'), x Ecm_Lut.Class_Coast_Min = x ncdf_varget, cdfid, ncdf_varid(cdfid,'coast_max'), x Ecm_Lut.Class_Coast_Max = x ncdf_varget, cdfid, ncdf_varid(cdfid,'sfc_type_flag'), x Ecm_Lut.Class_Sfc_Type_Flag = x ;--- read class on/off and order flags ncdf_attget, cdfid, /GLOBAL, 'log10_emiss_tropo_class_idx', x & Ecm_Lut.Log10_Emiss_Tropo_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 'emiss_tropo_class_idx', x & Ecm_Lut.Emiss_Tropo_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 't_11_class_idx', x & Ecm_Lut.T_11_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 't_std_class_idx', x & Ecm_Lut.T_Std_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 'log10_t_std_class_idx', x & Ecm_Lut.Log10_T_Std_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 't_max-t_class_idx', x & Ecm_Lut.T_Max_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 't_clear-t_class_idx', x & Ecm_Lut.T_Clear_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 'fmft_class_idx', x & Ecm_Lut.FMFT_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 'emiss_375_all_class_idx', x & Ecm_Lut.Emiss_375_All_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 'emiss_375_day_class_idx', x & Ecm_Lut.Emiss_375_Day_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 'emiss_375_night_class_idx', x & Ecm_Lut.Emiss_375_Night_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 'emiss_375_emiss_tropo_class_idx', x & Ecm_Lut.Emiss_375_Emiss_Tropo_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 'log10_ref_063_day_class_idx', x & Ecm_Lut.Log10_Ref_063_Day_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 'ref_063_day_class_idx', x & Ecm_Lut.Ref_063_Day_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 'ref_063_min_3x3_day_class_idx', x & Ecm_Lut.Ref_063_Min_3x3_Day_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 'ref_std_day_class_idx', x & Ecm_Lut.Ref_Std_Day_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 'ref_086_day_class_idx', x & Ecm_Lut.Ref_086_Day_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 'ref_ratio_day_class_idx', x & Ecm_Lut.Ref_Ratio_Day_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 'ref_138_day_class_idx', x & Ecm_Lut.Ref_138_Day_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 'ref_375_day_class_idx', x & Ecm_Lut.Ref_375_Day_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 'ndsi_day_class_idx', x & Ecm_Lut.Ndsi_Day_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 'btd_11_85_class_idx', x & Ecm_Lut.Btd_11_85_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 'btd_375_11_night_class_idx', x & Ecm_Lut.Btd_375_11_Night_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 'btd_375_11_day_class_idx', x & Ecm_Lut.Btd_375_11_Day_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 'btd_375_11_all_class_idx', x & Ecm_Lut.Btd_375_11_All_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 'bt_11_67_covar_class_idx', x & Ecm_Lut.Bt_11_67_Covar_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 'btd_11_67_class_idx', x & Ecm_Lut.Btd_11_67_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 'btd_85_73_class_idx', x & Ecm_Lut.Btd_85_73_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 'opd_063_day_class_idx', x & Ecm_Lut.Opd_063_Day_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 'log10_opd_063_day_class_idx', x & Ecm_Lut.Log10_Opd_063_Day_Class_Idx = x ncdf_attget, cdfid, /GLOBAL, 'zcld_opd_class_idx', x & Ecm_Lut.Zcld_Opa_Class_Idx = x ;--- close ncdf_close, cdfid ;---- make strings arrays for the bytes read in for isfc = 0, N_Sfc-1 do begin Ecm_Lut.Sfc_Type_Names[isfc] = strtrim(string(Sfc_Type_Names_Byte[*,isfc])) endfor for iclass = 0, N_Class-1 do begin Ecm_Lut.Classifier_Names[iclass] = strtrim(string(Classifier_Names_Byte[*,iclass])) endfor return, Ecm_Lut end