;+ pro process_aster, itype, data=data, srs_smoothed=srs_smoothed dir = './aster/' source = 'ASTER Spectral Library' class = 'Tap Water' format = '(f6.3, 2x, 2f9.4)' ; specify the type itype = itype ; files for different type of surfaces ; 0. tap water ; 1. sea water ; 2. fine size snow ; 3. miedium size granular snow ; 4. deciduous tree ; 5. green grass ; 6. dry grass classes = [ 'tap water', $ 'sea water', $ 'fine size snow', $ 'miedium size granular snow', $ 'deciduous tree', $ 'green grass', $ 'dry grass'] asterfile = ['jhu.becknic.water.tap.none.liquid.tapwater.spectrum.txt', $ 'jhu.becknic.water.sea.none.liquid.seawater.spectrum.txt', $ 'jhu.becknic.water.snow.fine.24um.fine.spectrum.txt', $ 'jhu.becknic.water.snow.granular.82um.medium.spectrum.txt', $ 'jhu.becknic.vegetation.trees.deciduous.solid.decidou.spectrum.txt', $ 'jhu.becknic.vegetation.grass.green.solid.gras.spectrum.txt', $ 'jhu.becknic.vegetation.grass.dry.solid.drygras.spectrum.txt' ] outfiles = ['tap_water.dat', $ 'sea_water.dat', $ 'fine_snow.dat', $ 'medium_snow.dat', $ 'deciduous_tree.dat', $ 'green_grass.dat', $ 'dry_grass.dat' ] nsmooth = [ 21, 21, 5, 5, 5, 5, 21 ] ; number of points used for polynormial smoothness read_aster_srs, dir+asterfile[itype], data srs_smoothed = poly_smooth(data.srs,nsmooth[itype]) n = n_elements( data.lamda ) openw, 11, outfiles[itype] printf, 11, 'Source: ', source printf, 11, 'Class: ', classes[itype] printf, 11, 'Colums: wavelength(um), smoothed spectra, original spectra' printf, 11, n, format='(i5)' for i = 0, n-1 do printf, 11, data.lamda[i], srs_smoothed[i], data.srs[i], format=format close, 11 end