Skip to content

Inconsistent reporting of number of spectral points #613

@dcmvdbekerom

Description

@dcmvdbekerom

🐛 Describe the bug

When the spectral axis is generated it is done so with wmax inclusive; this leads to numbers of spectral points such as 150001. This is also the number you get when printing len(sf.wavenumber). However, s.conditions['spectral_points'] yields the exclusive answer, i.e. 150000. It would be nice if these values were consistent.

I used the following script:

from radis import SpectrumFactory

sf = SpectrumFactory(
    2150,
    2450,  # cm-1
    molecule="CO2",
    isotope="1,2,3",
    wstep=0.002,
)

sf.fetch_databank("hitemp")

s = sf.eq_spectrum(
    Tgas=1100.0,  # K
    pressure=1,  # bar
    mole_fraction=0.8,
    path_length=0.2,  # cm
)

💡 Possible solutions

Wouldn't it be better to use spectral axes with the wmax exclusive?

Alternatively, when updating the sf.conditions['spectral_points'], rather than calculating the number of points from input parameters the integer value should be read from elsewhere.

🎲 Radis version

0.14

💻 Operating system

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions