Re: fast spectral resampling [message #71361] |
Fri, 11 June 2010 05:08 |
Brian Daniel
Messages: 80 Registered: July 2009
|
Member |
|
|
On Jun 11, 6:59 am, "lbus...@yahoo.it" <lbus...@yahoo.it> wrote:
> Hi all,
>
> I need to resample of a huge number (hundreds of thousands) of
> spectra produced by a radiative transfer model (2100 bands, with a 1
> nm spectral interval) to the spectral characteristics of a given
> sensor, expressed as the center wavelength and gaussian FWHM of the
> different bands. The number of output bands can be as high as a few
> thousands.
>
> I'm currently building a matrix (hcrf_in) containing some thousands of
> the input spectra (one spectra per column) and performing the
> resampling with the ENVI_RESAMPLE_SPECTRA routine, which gives in
> output a new matrix (hcrf_out) containing the resampled data. The
> command is like the following.
>
> ENVI_RESAMPLE_SPECTRA, in_wl, hcrf_in, out_wl, hcrf_out,
> OUT_DT=float , OUT_FWHM=out_fwhm , interleave = 2
>
> The routine works well, but it is really slow, and I don't have access
> to the code in order to try to optimize the computation.
>
> Does anybody know if there are any other routines or methods that can
> be implemented in order to speed-up the computation ? Keep in mind
> that that spectral sampling and FWHM of the different output bands can
> be variable.
>
> Thanks in advance for the help,
>
> Lorenzo
My first approach would be to break up the calculation into smaller
sets of spectra. Many "IDL ways" of doing things are RAM intensive.
Creating a matrix of (hundreds of thousands) x (2100) will suck up the
RAM and depending on your OS, use virtual memory - which is really
slow. By breaking up the calculation to be within the RAM
capabilities of your machine, each run will go much faster. It will
also allow you to use some clustering protocols, like CONDOR, but that
may be overkill.
Best of luck,
Brian
|
|
|