Skip to content

X-axis in plot not reading from T.wavelength_nm? #29

@aeropung

Description

@aeropung

Using the example posted here, I'm trying to find the spectral transmission for a well-known RF regime; let's say 1 GHz- 1.5 GHz. In wavelength, these convert to 299792458 and 199861639 nm, respectively.

Adding these wavelengths, the code becomes:

p = ArgumentParser(description="Lowtran 7 interface")
p.add_argument("-z", "--obsalt", help="altitude of observer [km]", type=float, default=0.0)
p.add_argument(
    "-a",
    "--zenang",
    help="observer zenith angle [deg]",
    type=float,
    nargs="+",
    default=[0, 60, 80],
)
p.add_argument("-s", "--short", help="shortest wavelength nm ", type=float, default=199861639)
p.add_argument("-l", "--long", help="longest wavelength cm^-1 ", type=float, default=299792458)
p.add_argument("-step", help="wavelength step size cm^-1", type=float, default=20)
p.add_argument(
    "--model",
    help='0-6, see Card1 "model" reference. 5=subarctic winter',
    type=int,
    default=2,
)
P = p.parse_args()

c1 = {
    "model": P.model,
    "h1": P.obsalt,
    "angle": P.zenang,
    "wlshort": P.short,
    "wllong": P.long,
    "wlstep": P.step,
}

TR = lowtran.transmittance(c1)

transmission(TR, c1)

show()

But when I run the code, I get the following plot:

Screenshot 2023-07-06 at 8 38 37 AM

Notice that the wavelength range (see question from #28 ) is 199,861,639 - 299792458nm, but the X-axis on the plot only shows a range of 0e6 - 10e6, or 0 - 10,000,000 nm -- a factor of 20 shorter than the shortest wavelength specified in the code. How can I make sense of the output data if I cannot trust the plot? How do I interpret the output?

Further inspection suggests that 10e6 nm is the longest wavelength that can be plotted, even though LOWTRAN 7 is programmed to work from 0 - 50,000 cm^-1, or 200 - Infinity nm. Furthermore, extracting the plotting wavelengths reveals the limitation as well:

>> TR.wavelength_nm.values
array([9999998.,       0.], dtype=float32)

Why is this artificially limited?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions