pro l1b2_wrapper ; This example routine demonstrates use of the HDF-EOS read utilites with a ; MISR Level 1B2 radiance file to access data fields, global attributes, ; grid attributed, and the per-block metadata vdata. Once the stop statement is ; reached, the variables containing the values read can be examined in the ; idlde variable watch window or with the IDL HELP command. filename = DIALOG_PICKFILE(TITLE="Select MISR Level 1B2 data file:") ; get the grid names and corresponding field names for the radiance data bands num_grid = EOS_GD_INQGRID(filename,gridlist) fid = EOS_GD_OPEN(filename,/READ) gridnames = strsplit(gridlist,',',/EXTRACT) fieldnames = strarr(4) for i=0,3 do begin ; first four grids contain the radiance data gid = EOS_GD_ATTACH(fid,gridnames[i]) status = EOS_GD_INQFIELDS(gid,fieldlist,ranks,fieldtypes) fields = strsplit(fieldlist,',',/EXTRACT) fieldnames[i] = fields[0] endfor status = EOS_GD_DETACH(gid) status = EOS_GD_CLOSE(fid) ; get the start and end block numbers for the file status = read_global_attr(filename,"Start_block",start_block) status = read_global_attr(filename,"End block",end_block) start_block = start_block[0] end_block = end_block[0] ; read the blue radiance data status = read_grid_field(filename,gridnames[0],fieldnames[0],blueraddata) ; read the blue radiance scale factor attrname = "Scale factor" status = read_grid_attr(filename,gridnames[0],attrname,blue_scale_factor) ; get the Sun Distance value status = read_grid_attr(filename,gridnames[0],"SunDistanceAU",sun_distance) grid = "GeometricParameters" field = "SolarZenith" status = read_grid_field(filename,grid,field,szdata) vdname = "PerBlockMetadataCommon" status = read_vdata(filename,vdname,vdrec_struc) help,vdrec_struc,/structure print,"Number of vdata records: ",n_elements(vdrec_struc) stop end