Skip to content

Commit

Permalink
add the isnull method to smrt_matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
ghislainp committed May 5, 2020
1 parent 520c387 commit d89ebcc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion smrt/core/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ def full(dims, value, mtype=None):
def npol(self):
return self.values.shape[0]

def isnull(self):
return isnull(self)

def compress(self, mode=None, auto_reduce_npol=False):
"""compress a matrix. This comprises several actions:
1) select one mode, if relevant (dense5, and diagonal5).
Expand Down Expand Up @@ -310,7 +313,7 @@ def isnull(m):

return (m is 0) or \
(getattr(m, "mtype", None) == "0") or \
(~np.any(m))
(not np.any(m))


def abs2(c):
Expand Down
2 changes: 1 addition & 1 deletion smrt/rtsolver/dort.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def dort(self, m_max=0, special_return=False):
for j, i in enumerate(incident_streams):
# the j-th column vector contains the stram i, with angle mu[i]
backscatter_intensity_up[3 * j: 3 * j + 3, :] = intensity_up[3 * i: 3 * i + 3, 3 * j: 3 * j + 3]

outmu = streams.outmu[incident_streams]
intensity_up = backscatter_intensity_up
else:
Expand Down

0 comments on commit d89ebcc

Please sign in to comment.