;$Id$ pro read_2d_table, nc_filename, lut, attributes, channels_used, success_flag success_flag = file_test(nc_filename) if (success_flag ne 1) then begin print, 'failed read for ', nc_filename success_flag = 0 return endif sd_id = ncdf_open(nc_filename) grp_ids = ncdf_groupsinq(sd_id) grp_id = grp_ids[0] classifier_name = ncdf_groupname(grp_id) att_info = NCDF_ATTINQ(grp_id, 'nbins_x', /global) ncdf_attget, grp_id, /global, 'nbins_x', nbins_x ncdf_attget, grp_id, /global, 'nbins_y', nbins_y ncdf_attget, grp_id, /global, 'nsfc', nsfc ;------------------------------------------------- ; read attributes into structure ;------------------------------------------------- @attributes_define.pro read_group_attributes, grp_id, attributes ;------------------------------------------------- ; read data into structure ;------------------------------------------------- @lut_2d_define.pro sds_id = ncdf_varid(grp_id,'obs_table') ncdf_varget, grp_id, sds_id, x & for isfc = 0, attributes.nsfc - 1 do lut[isfc].obs = x[*,*,isfc] sds_id = ncdf_varid(grp_id,'clear_table') ncdf_varget, grp_id, sds_id, x & for isfc = 0, attributes.nsfc - 1 do lut[isfc].clear = x[*,*,isfc] sds_id = ncdf_varid(grp_id,'ice_table') ncdf_varget, grp_id, sds_id, x & for isfc = 0, attributes.nsfc - 1 do lut[isfc].ice = x[*,*,isfc] sds_id = ncdf_varid(grp_id,'water_table') ncdf_varget, grp_id, sds_id, x & for isfc = 0, attributes.nsfc - 1 do lut[isfc].water = x[*,*,isfc] sds_id = ncdf_varid(grp_id,'cloud_fraction') ncdf_varget, grp_id, sds_id, x & for isfc = 0, attributes.nsfc - 1 do lut[isfc].cloud_fraction = x[isfc] sds_id = ncdf_varid(grp_id,'ice_fraction') ncdf_varget, grp_id, sds_id, x & for isfc = 0, attributes.nsfc - 1 do lut[isfc].ice_fraction = x[isfc] sds_id = ncdf_varid(grp_id,'water_fraction') ncdf_varget, grp_id, sds_id, x & for isfc = 0, attributes.nsfc - 1 do lut[isfc].water_fraction = x[isfc] sds_id = ncdf_varid(grp_id,'observation_count') ncdf_varget, grp_id, sds_id, x & for isfc = 0, attributes.nsfc - 1 do lut[isfc].observation_count = x[isfc] sds_id = ncdf_varid(grp_id,'on_flag') ncdf_varget, grp_id, sds_id, x & for isfc = 0, attributes.nsfc -1 do lut[isfc].on_flag = x[isfc] sds_id = ncdf_varid(grp_id,'channel_wvl') ncdf_varget, grp_id, sds_id, x & channels_used.wvl = x ;--- close the netcdf file ncdf_close, sd_id end ;--------------------------------------------------------------------------------------------- ; ;---------------------------------------------------------------------------------------------