Decode IASI Satellite Spectrum – convert IDL to python

Question:

Since I have no experience in IDL coding, I need help converting the piece of code below to python.

The following parameters are known and are 1D arrays oder scalars.

IDefScaleSondNbScale, IDefScaleSondScaleFactor,
IDefScaleSondNsfirst, IDefScaleSondNslast,
IDefNsfirst

enter image description here

Asked By: Shaun

||

Answers:

It’s IDL and the python equivalent is the following:

SpectDecoded = np.empty_like(Spect, dtype=float)
for numScale in range(1, int(IDefScaleSondNbScale) + 1):
    SF = IDefScaleSondScaleFactor[numScale - 1]
    for chanNb in range(int(IDefScaleSondNsfirst[numScale - 1]), int(IDefScaleSondNslast[numScale - 1]) + 1):
        w = int(chanNb - IDefNsfirst[0])
        if w < SpectDecoded.shape[0]:
            SpectDecoded[w] = Spect[w] * 10 ** (-SF)
Answered By: Shaun
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.