Instrument to Instrument Resampling with i2i

From DavinciWiki
Jump to: navigation, search

Description

Run through a variety of i2i() cases. Here we illustrate the variety of uses for i2i that will allow the user to resample many input spectra types to many output spectra types

Procedure

Read in ASU spectral library

dv> asu = read($DV_EX+'/ASU_minlib.hdf')
data: 225x1x923 array of float, bsq format [830,700 bytes]
label: Text Buffer with 225 lines of text
   1: Andesine BUR-240 1
   2: Spodumene HS-210.4B 2
   3: Magnesiohastingsite HS-115.4B 3
   4: Wollastonite WAR-8884 4
   5: Albite WAR-0244 5
   6: Bronzite BUR-1920 6
   7: Pyroxmangite WAR-6894 7
   8: Forsterite BUR-3720A 8
   9: reject
   10: reject
xaxis: 1x1x923 array of float, bsq format [3,692 bytes]

Resample a lab spectrum to ASTER resolution and plot both vs wavenumber

Create lab1 x axis (default is wavenumber mode for spectrometers)

dv> xlab1 = make_band(lab1=1)
1x1x923 array of float, bsq format [3,692 bytes]

Create aster x axis in wavenumber mode

dv> xastercm = make_band(aster=1, cm=1)
1x1x5 array of float, bsq format [20 bytes]
884.7208252

938.6145630

1102.292847

1159.285767

1208.605225

Resample 1 lab spectrum to ASTER resolution with wavenumber xaxis

dv> aster = i2i(asu.data[1], from = 'lab1', to = 'aster', cm=1)
doing broadband
.............................................
/themis/lib/dav_lib/library/script_files/instrument_parameters/aster_ir_spectral_response_cm.vic: VICAR bsq image: 6x1x401, 32 bits
1x1x5 array of float, bsq format [20 bytes]
0.9491488338

0.9251240492

0.9428701401

0.9358501434

0.9704451561

Plot lab and resampled ASTER spectra

dv> pplot({asu.data[1], aster}, {'Lab Spectrum', 'ASTER'}, {1,5}, xaxis={xlab1, xastercm}, xlabel = \
'Wavenumber', ylabel = 'Emissivity', key = '1400, .95')

i2i tutorial1.png

A simpler approach Resample to ASTER and return xaxis in wavenumber mode by using 'full' mode

dv> aster = i2i(asu.data[1], from='lab1', to='aster', cm=1, full=1)
doing broadband
..............................................................................................
/themis/lib/dav_lib/library/script_files/instrument_parameters/aster_ir_spectral_response_cm.vic: VICAR bsq image: 6x1x401, 32 bits
struct, 2 elements
   data: 1x1x5 array of float, bsq format [20 bytes]
   xaxis: 1x1x5 array of float, bsq format [20 bytes]

Plot lab and resampled ASTER spectra

dv> pplot({asu.data[1], aster.data}, {'Lab Spectrum', 'ASTER'}, {1,5}, xaxis={asu.xaxis, aster.xaxis},\
 xlabel = 'Wavenumber', ylabel = 'Emissivity', key = '1400, .95')

i2i tutorial2.png

Example of how to do a bunch of instruments and plot vs wavelength Create aster x axis in wavelength mode (default is wavelength for broadband insts.)

dv> xaster = make_band(aster=1)
1x1x5 array of float, bsq format [20 bytes]
8.274000168

8.626000404

9.071999550

10.65400028

11.30300045

Create tims x axis in wavelength mode (default)

dv> xtims = make_band(tims=1)
1x1x5 array of float, bsq format [20 bytes]
8.274000168

8.626000404

9.071999550

10.65400028

11.30300045

Create themis x axis in wavelength mode (default)

dv> xthemis = make_band(themis=1)
1x1x10 array of float, bsq format [40 bytes]
6.780000210

6.780099869

7.929999828

8.560000420

9.350000381

10.21000004

11.03999996

11.78999996

12.56999969

14.88000011

Create lab1 x axis in wavelength mode

dv> xlab1wave = make_band(lab1=1, wave=1)
1x1x923 array of float, bsq format [3,692 bytes]

Create tes x axis in wavelength mode

dv> xteswave = make_band(tes=1, wave=1)
1x1x143 array of float, bsq format [572 bytes]

Convert lab spectrum to lab resolution with wavelength xaxis

dv> lab1w = i2i(asu.data[1], from = 'lab1', to = 'lab1', wave=1)
Axis are the same, no need for resample
1x1x923 array of float, bsq format [3,692 bytes]

Resample lab spectrum to TES resolution with wavelength xaxis (default)

dv> tes = i2i(asu.data[1], from = 'lab1', to = 'tes', wave=1)
1x1x143 array of float, bsq format [572 bytes]

Resample lab spectrum to TIMS resolution with wavelength xaxis (default)

dv> tims = i2i(asu.data[1], from = 'lab1', to = 'tims')
doing broadband
.......................................
/themis/lib/dav_lib/library/script_files/instrument_parameters/tims_ir_spectral_response_avg_cm.vic: VICAR bsq image: 7x1x158, 64 bits
1x1x6 array of float, bsq format [24 bytes]
0.9560140371

0.9354807734

0.9452832937

0.9128332138

0.9275939465

0.9603198171

Resample lab spectrum to TIMS resolution with wavelength xaxis (default)

dv> themis = i2i(asu.data[1], from = 'lab1', to = 'themis')
doing broadband
.........................................................
/themis/lib/dav_lib/library/script_files/instrument_parameters/themis_ir_spectral_response_cm.vic: VICAR bsq image: 11x1x4000, 32 bits
1x1x10 array of float, bsq format [40 bytes]
0.9976508617

0.9976508617

0.9899930954

0.9563778639

0.9324003458

0.9158310890

0.9384429455

0.9638817310

0.9771865606

0.9821818471

Resample lab spectrum to ASTER resolution with wavelength xaxis (default)

dv> aster = i2i(asu.data[1], from = 'lab1', to = 'aster')
doing broadband
.........................................................
/themis/lib/dav_lib/library/script_files/instrument_parameters/aster_ir_spectral_response_cm.vic: VICAR bsq image: 6x1x401, 32 bits
1x1x5 array of float, bsq format [20 bytes]
0.9704451561

0.9358501434

0.9428701401

0.9251240492

0.9491488338

Plot lab and resampled TES, THEMIS, ASTER, and TIMS spectra

dv> pplot({lab1w, tes, themis, aster, tims}, {'Lab Spectrum', 'TES', 'THEMIS', 'ASTER', 'TIMS'}, {1,2,4,5,6},\
 xaxis={xlab1wave, xteswave, xthemis,  xaster, xtims}, xlabel = 'Wavelength', ylabel = 'Emissivity', \
key = '12.5, .94', x1=6., x2=16.)

i2i tutorial3.png

Again - a simpler approach using 'full' mode in i2i Resample lab spectrum to lab resolution with wavelength xaxis (default)

dv> lab = i2i(asu.data[1], from = 'lab1', to = 'lab1', wave=1, full=1)
Axis are the same, no need for resample
struct, 2 elements
   data: 1x1x923 array of float, bsq format [3,692 bytes]
   xto: 1x1x923 array of float, bsq format [3,692 bytes]

Resample lab spectrum to TES resolution with wavelength xaxis (default)

dv> tes = i2i(asu.data[1], from = 'lab1', to = 'tes', wave=1, full=1)
struct, 2 elements
   data: 1x1x143 array of float, bsq format [572 bytes]
   xaxis: 1x1x143 array of float, bsq format [572 bytes]

Resample lab spectrum to THEMIS resolution with wavelength xaxis (default)

dv> themis = i2i(asu.data[1], from = 'lab1', to = 'themis', wave=1, full=1)
doing broadband
...............................................................
/themis /lib/dav_lib/library/script_files/instrument_parameters/themis_ir_spectral_response_cm.vic: VICAR bsq image: 11x1x4000, 32 bits
struct, 2 elements
   data: 1x1x10 array of float, bsq format [40 bytes]
   xaxis: 1x1x10 array of float, bsq format [40 bytes]

Resample lab spectrum to ASTER resolution with wavelength xaxis (default)

dv> aster = i2i(asu.data[1], from = 'lab1', to = 'aster', wave=1, full=1)
doing broadband
.................................................................
/themis/lib/dav_lib/library/script_files/instrument_parameters/aster_ir_spectral_response_cm.vic: VICAR bsq image: 6x1x401, 32 bits
struct, 2 elements
   data: 1x1x5 array of float, bsq format [20 bytes]
   xaxis: 1x1x5 array of float, bsq format [20 bytes]

Resample lab spectrum to TIMS resolution with wavelength xaxis (default)

dv> tims = i2i(asu.data[1], from = 'lab1', to = 'tims', wave=1, full=1)
doing broadband
......................................................................
/themis/lib/dav_lib/library/script_files/instrument_parameters/tims_ir_spectral_response_avg_cm.vic: VICAR bsq image: 7x1x158, 64 bits
struct, 2 elements
   data: 1x1x6 array of float, bsq format [24 bytes]
   xaxis: 1x1x6 array of float, bsq format [24 bytes]

Plot lab and resampled TES, THEMIS, ASTER, and TIMS spectra

dv> pplot({lab.data, tes.data, themis.data, aster.data, tims.data}, {'Lab Spectrum', 'TES', 'THEMIS', 'ASTER', 'TIMS'}, \
{1,2,4,5,6}, xaxis={lab.xto,  tes.xaxis, themis.xaxis, aster.xaxis, tims.xaxis}, xlabel = 'Wavelength', \
ylabel = 'Emissivity', key = '12.5, .94', x1=6., x2=16.)

i2i tutorial4.png

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Functions Used

Personal tools