diff --git a/src/pysme/nlte.py b/src/pysme/nlte.py index dee475a5..6d79c459 100644 --- a/src/pysme/nlte.py +++ b/src/pysme/nlte.py @@ -1065,7 +1065,7 @@ def update_coefficients(self, sme, dll, lfs_nlte): # loop through the list of relevant _lines_, substitute both their levels into the main b matrix # Make sure both levels have corrections available if lr[0] != -1 and lr[1] != -1: - dll.InputDepartureCoefficients(bmat[:, lr].T, li) + dll.InputDepartureCoefficients(bmat[:, lr], li) for elem in marked_for_removal: self.remove_nlte(elem) diff --git a/src/pysme/smelib/_smelib.cpp b/src/pysme/smelib/_smelib.cpp index 0ccfc565..e5d163fb 100644 --- a/src/pysme/smelib/_smelib.cpp +++ b/src/pysme/smelib/_smelib.cpp @@ -637,16 +637,16 @@ static PyObject *smelib_InputDepartureCoefficients(PyObject *self, PyObject *arg PyErr_SetString(PyExc_ValueError, "Expected bmatrix with ndim == 2"); return NULL; } - if (PyArray_DIM(bmatrix_arr, 0) != 2) + if (PyArray_DIM(bmatrix_arr, 1) != 2) { Py_XDECREF(bmatrix_arr); - PyErr_SetString(PyExc_ValueError, "Expected bmatrix with shape (2, nrhox)"); + PyErr_SetString(PyExc_ValueError, "Expected bmatrix with shape (nrhox, 2)"); return NULL; } - if (PyArray_DIM(bmatrix_arr, 1) != nrhox) + if (PyArray_DIM(bmatrix_arr, 0) != nrhox) { Py_XDECREF(bmatrix_arr); - PyErr_SetString(PyExc_ValueError, "Expected bmatrix with shape (2, nrhox)"); + PyErr_SetString(PyExc_ValueError, "Expected bmatrix with shape (nrhox, 2)"); return NULL; }