Skip to content
Snippets Groups Projects
Commit 173bc96f authored by Philipp Arras's avatar Philipp Arras
Browse files

Restructuring

parent 8606545d
No related branches found
No related tags found
1 merge request!37Draft: Observation: introduce __hash__
...@@ -47,6 +47,7 @@ test_resolvelib: ...@@ -47,6 +47,7 @@ test_resolvelib:
stage: testing stage: testing
script: script:
- cd resolvelib && pytest-3 -q test - cd resolvelib && pytest-3 -q test
- python3 demos/bench.py quick
test_resolve_mpi: test_resolve_mpi:
stage: testing stage: testing
... ...
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
# Copyright(C) 2021-2022 Max-Planck-Society, Philipp Arras # Copyright(C) 2021-2022 Max-Planck-Society, Philipp Arras
# Author: Philipp Arras # Author: Philipp Arras
import sys
import resolve as rve import resolve as rve
import nifty8 as ift import nifty8 as ift
import resolvelib import resolvelib
...@@ -21,9 +23,13 @@ import numpy as np ...@@ -21,9 +23,13 @@ import numpy as np
from time import time from time import time
if len(sys.argv) == 2 and sys.argv[1] == "quick":
npix = 10
else:
npix = 4000
pdom = rve.PolarizationSpace(["I", "Q", "U", "V"]) pdom = rve.PolarizationSpace(["I", "Q", "U", "V"])
sdom = ift.RGSpace([4000, 4000]) sdom = ift.RGSpace([npix, npix])
dom = rve.default_sky_domain(pdom=pdom, sdom=sdom) dom = rve.default_sky_domain(pdom=pdom, sdom=sdom)
dom = {kk: dom[1:] for kk in pdom.labels} dom = {kk: dom[1:] for kk in pdom.labels}
tgt = rve.default_sky_domain(pdom=pdom, sdom=sdom) tgt = rve.default_sky_domain(pdom=pdom, sdom=sdom)
... ...
......
from .cpp2py import * from .cpp2py import PolarizationMatrixExponential
from .polarization_matrix_exponential import PolarizationMatrixExponential
from . import _cpp
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
# Copyright(C) 2021-2022 Max-Planck-Society, Philipp Arras # Copyright(C) 2021-2022 Max-Planck-Society, Philipp Arras
# Author: Philipp Arras, Jakob Roth # Author: Philipp Arras, Jakob Roth
import numpy as np
import nifty8 as ift import nifty8 as ift
...@@ -46,3 +45,10 @@ class Pybind11Jacobian(ift.LinearOperator): ...@@ -46,3 +45,10 @@ class Pybind11Jacobian(ift.LinearOperator):
self._check_input(x, mode) self._check_input(x, mode)
res = (self._times if mode == self.TIMES else self._adj_times)(x.val) res = (self._times if mode == self.TIMES else self._adj_times)(x.val)
return ift.makeField(self._tgt(mode), res) return ift.makeField(self._tgt(mode), res)
def PolarizationMatrixExponential(domain, nthreads=1):
from . import _cpp
domain = ift.MultiDomain.make(domain)
return Pybind11Operator(domain, domain, _cpp.PolarizationMatrixExponential(nthreads))
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright(C) 2022 Max-Planck-Society, Philipp Arras
# Author: Philipp Arras
import numpy as np
import nifty8 as ift
from . import Pybind11Operator
def PolarizationMatrixExponential(domain, nthreads=1):
from . import _cpp
domain = ift.MultiDomain.make(domain)
return Pybind11Operator(domain, domain, _cpp.PolarizationMatrixExponential(nthreads))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment