Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import custom atmospheric profile #26

Open
chrismolli opened this issue Apr 27, 2023 · 1 comment
Open

Import custom atmospheric profile #26

chrismolli opened this issue Apr 27, 2023 · 1 comment

Comments

@chrismolli
Copy link

I would like to adapt the implementation to be able to input custom atmospheric profiles for ITYPE=2 slant H1 to H2 calculations. I have seen the part in the documentation regarding custom model input at CARD 2C and following. I am not sure though on how these would translate to the input using the Python interface.

Could you give me a hint how to ingress a custom atmospheric model?

@chrismolli
Copy link
Author

I tried it like this, in theory the Fortran interface supports giving multiple values for temperature, pressure and layer altitude. However, it does not finish computing anything.

import lowtran
from lowtran.base import golowtran
import numpy as np 

# custom fake atmosphere
steps = 5
altitudes = (np.arange(steps))/steps*100+10
temps = np.ones(steps)*300
press = np.arange(steps)*200
press = press[::-1]
wmols = np.zeros((12))
wmols = np.array(
    [0.5,0.3,0.1,0,0,0,0,0,0,0,0,0]
)

# setup settings
c1 = {
    # wave length settings
    "wllong": 15000,   # max wavelength
    "wlshort": 8000.0, # min wavelength
    "wlstep" : 20,     # step resolution
    # model type
    "model" :  7, # 7 custom model, 0 custom horizontal, 1-6 standard models
    "itype" :  2, # 2 slant path
    "iemsct" : 1, # 0 transmission only, 1 thermal radiance
    "im" :     1, # 0 use existing model, 1 read in new model
    "iseasn" : 0, # 0 default season, unused
    "ird1" :   1, # 1 read atmospheric densities from wmols
    # atmospheric properties
    "zmdl" : altitudes.tolist(),
    "p" : press.tolist(),
    "t" : temps.tolist(),
    "wmol" : wmols.tolist(),
    # observer settings
    "h1" : 0.0,     # km, starting height
    "h2" : 550.0,   # km, final height
    "angle" : 0,    # zenit angle
    "range_km" : 0, # km, path length
}

TR = golowtran(c1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant