Skip to content

Commit

Permalink
fix getLineOpacities sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
AWehrhahn committed May 4, 2021
1 parent ca6118e commit ce35f3a
Showing 1 changed file with 21 additions and 15 deletions.
36 changes: 21 additions & 15 deletions src/pysme/sme_synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,24 +377,27 @@ def Opacity(self, getData=False, motype=1):
Returns
-------
copblu : array of size (nmu,)
copblu : array of size (nrhox,)
only if getData is True
copred : array of size (nmu,)
copred : array of size (nrhox,)
only if getData is True
copstd : array of size (nmu,)
copstd : array of size (nrhox,)
only if getData is True and motype is 0
"""
args = []
type = ""
if getData:
nmu = self.nmu
copblu = np.zeros(nmu)
copred = np.zeros(nmu)
args = [nmu, copblu, copred]
assert (
self.atmo is not None
), "Need to set the atmosphere model before retrievieng Opacities"
nrhox = len(self.atmo.rhox)
copblu = np.zeros(nrhox)
copred = np.zeros(nrhox)
args = [nrhox, copblu, copred]
type = ["s", "d", "d"]

if motype == 0:
copstd = np.zeros(nmu)
copstd = np.zeros(nrhox)
args += [copstd]
type += ["d"]

Expand Down Expand Up @@ -661,14 +664,17 @@ def GetLineOpacity(self, wave):
csf : array
Continuum source function
"""
nmu = self.nmu
lop = np.zeros(nmu)
cop = np.zeros(nmu)
scr = np.zeros(nmu)
tsf = np.zeros(nmu)
csf = np.zeros(nmu)
assert (
self.atmo is not None
), "Need to set the atmosphere model before retrievieng Opacities"
nrhox = len(self.atmo.rhox)
lop = np.zeros(nrhox)
cop = np.zeros(nrhox)
scr = np.zeros(nrhox)
tsf = np.zeros(nrhox)
csf = np.zeros(nrhox)
type = "dsddddd"
self.lib.GetLineOpacity(wave, nmu, lop, cop, scr, tsf, csf, type=type)
self.lib.GetLineOpacity(wave, nrhox, lop, cop, scr, tsf, csf, type=type)
return lop, cop, scr, tsf, csf

def GetLineRange(self):
Expand Down

0 comments on commit ce35f3a

Please sign in to comment.