i2i

From DavinciWiki
Jump to: navigation, search

Description

Convert (resample/rescale) spectra from one IR instrument to another. See i2i_tutorial() or Instrument_to_Instrument_Resampling_with_i2i for some example usage.

Arguments and Return Values

Arguments: a spectrum, the to/from spectral ranges (either a pre-defined instrument or custom scale)

Return Value: the resampled spectrum

Usage

Syntax: i2i(spec, from=STRING/VAL, to=STRING/VAL [, wave=BOOL][, cm=BOOL][, full=BOOL][, filters=BOOL][, descend=BOOL])

spec - a spectrum the size of from

OR

spec - can also be a structure with .data, .label, and .xaxis


from - may be either a predefined instrument or a custom xaxis scale

to - may be either a predefined instrument or custom xaxis scale

Allowed 'from' instruments are lab1, lab2, tes, tes5, mtes and the data's xaxis
Allowed 'to' instrument are lab1, lab2, tes, tes5, mtes, themis, aster, tims, master
Both 'from' and 'to' can be arrays of xaxis values. Size of 'from' must equal size of spec
Use 'to'=xaxis or 'from'=xaxis' to create or use customized output or input spectra.
Default instrument input (from) spectra must be in ascending, cm-1 form
Exception is converting broadband instrument from ascending wavelength to ascending cm
  This mode also returns the xaxis to avoid any confusion
  Ex: a = i2i(spect, from='themis', to='themis') returns 'a' in ascending cm form
Default 'to' spectra are in ascending (low to high) cm for spectrometers or ascending wavelength for broadband instruments

Options:

wave=1 - returns spectra in ascending wavelength form

cm=1 - returns spectra in ascending wavenumber (cm) form

descend=1 - returns spectrum in descending wavelength or wavenumber order

full=1 - returns both spectrum and xaxis

filters=1 - returns spectrum, xaxis, and filter functions

Note: Non-standard cm or wave modes return both spectra and xaxis

Example Usage:

speca = i2i(spec, from='lab1', to='themis')
speca = i2i(spec, from='lab1', to='aster', wave=1)
speca = i2i(spec, from='lab1', to='lab1', wave=1)
speca = i2i(spec, from='tes', to='aster', cm=1)
speca = i2i(spec, from='lab1', to= my_out_axis)
speca = i2i(spec, from=my_in_axis, to= my_out_axis)
speca = i2i(spec, from='tes', to= my_out_axis)

Examples

dv> spec=bbr(250,make_band(tes1))
1x1x143 array of double, bsq format [1,144 bytes]

dv> out=i2i(spec,from='tes',to='themis')
doing broadband
................................1x1x10 array of float, bsq format [40 bytes]
6.753726484e-05

6.753726484e-05

5.671190956e-05

5.194100595e-05

4.685497697e-05

4.215575609e-05

3.838338307e-05

3.538411329e-05

3.262764949e-05

2.644573578e-05

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

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

All other topics

  • See navigation on the left

Major Sub-Functions

Recent Library Changes

Created On: 07-29-2010
Modified On: 07-25-2012

Personal tools