Skip to content

Commit

Permalink
fix implemented_models method
Browse files Browse the repository at this point in the history
  • Loading branch information
whitetuft committed Apr 19, 2024
1 parent 5655c97 commit b27bb43
Showing 1 changed file with 31 additions and 45 deletions.
76 changes: 31 additions & 45 deletions pyrtlib/absorption_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
"""

import types
import os
from typing import Tuple, Union, List, Optional, Dict
from netCDF4 import Dataset

import numpy as np

from pyrtlib.climatology import AtmosphericProfiles as atmp
from .utils import dilec12, _dcerror, constants, gas_mass, import_lineshape

PATH = os.path.dirname(os.path.abspath(__file__))

class AbsModelError(Exception):
"""Exception raised for errors in the input model.
Expand Down Expand Up @@ -78,53 +81,36 @@ def implemented_models() -> Dict[str, List[str]]:
>>> from pyrtlib.absorption_model import AbsModel
>>> AbsModel.implemented_models()
{
'Oxygen': ['R98',
'R03',
'R16',
'R17',
'R18',
'R19',
'R19SD',
'R20',
'R20SD',
'R22'],
{'Oxygen': ['R98',
'R03',
'R16',
'R17',
'R18',
'R19',
'R19SD',
'R20',
'R20SD',
'R22'],
'WaterVapour': ['R98',
'R03',
'R16',
'R17',
'R18',
'R19',
'R19SD',
'R20',
'R20SD',
'R21SD',
'R22',
'R22SD']}
'R03',
'R16',
'R17',
'R18',
'R19',
'R19SD',
'R20',
'R20SD',
'R21SD',
'R22SD'],
'Ozone': ['R18', 'R22']}
"""
model = {"Oxygen": ['R98',
'R03',
'R16',
'R17',
'R18',
'R19',
'R19SD',
'R20',
'R20SD',
'R22'],
"WaterVapour": ['R98',
'R03',
'R16',
'R17',
'R18',
'R19',
'R19SD',
'R20',
'R20SD',
'R21SD',
'R22',
'R22SD'],
"Ozone": ['R18', 'R22']}
oxygen_netcdf = Dataset(os.path.join(PATH, '_lineshape', 'o2_lineshape.nc'), mode='r')
wv_netcdf = Dataset(os.path.join(PATH, '_lineshape', 'h2o_lineshape.nc'), mode='r')
ozone_netcdf = Dataset(os.path.join(PATH, '_lineshape', 'o3_lineshape.nc'), mode='r')

model = {"Oxygen": list(oxygen_netcdf.groups.keys()),
"WaterVapour": list(wv_netcdf.groups.keys()),
"Ozone": list(ozone_netcdf.groups.keys())}

return model

Expand Down

0 comments on commit b27bb43

Please sign in to comment.