Set the wavelength value of a band to resample to.


int miraacq_SetResamplingWavelength(makernelpma, int band, double wavelength);


Parameters:


Return value:

MIRA_OK (0) or an error code.


Description:

miraacq_SetResamplingWavelength will set the wavelength of a specific band, the wavelengths need to be between the camera wavelength range (miraacq_GetFrameWavelength). Resampling requires that the camera is able to retrieve wavelengths (miraacq_CanReturnWavelengths).


Example:

Note the MIRAACQ_CHECK macro, which will check if the return value was MIRA_OK (0) or an error code. In case of an error code, it will jump to a label called Error.


  1. int bands = ((1000 - 400) / 2) + 1; // + 1 is used to keep the final (1000 nm) band
  2. MIRAACQ_CHECK(miraacq_SetResamplingWavelengthCount(pma, bands));
  3. for (int i = 0; i < bands; i++) {
  4.     MIRAACQ_CHECK(miraacq_SetResamplingWavelength(pma, i, 400 + (2 * i)));
  5. }
  6. MIRAACQ_CHECK(miraacq_SetResampling(pma, 1));

  7. Error:
  8. if (res != MIRA_OK) {
  9.     printf("Error %d: %s", miraacq_GetErrorCode(pma), miraacq_GetErrorMsg(pma));
  10. }