Skip to content
Open
Show file tree
Hide file tree
Changes from 89 commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
ed4f82b
Create mueller_methods.py
mj-gomes May 12, 2025
86c3d42
Create jones_methods.py
mj-gomes May 12, 2025
d00a765
Create common.py
mj-gomes May 12, 2025
2480cf6
Update hwp_sys.py
mj-gomes May 12, 2025
36ff9f1
remove extract_deltas step
mj-gomes May 12, 2025
baaf3bd
complete model implementation, add test for jones
mj-gomes Jul 2, 2025
13de46c
Merge branch 'master' into hwp_systematics_jones_band
mj-gomes Jul 2, 2025
d02e572
notebooks/example_hwp_sys.ipynb
mj-gomes Jul 3, 2025
878d2a1
fix rotation equations, add attribute information, add jones to detec…
mj-gomes Jul 3, 2025
79f8a86
ruff
mj-gomes Jul 3, 2025
dcc023d
update docs
mj-gomes Jul 3, 2025
2f05d5d
add older version of hwp_sys
mj-gomes Jul 10, 2025
5e7cc8e
merge with new version of hwp_sys with jones
mj-gomes Jul 10, 2025
7dae799
fix conflict
mj-gomes Jul 10, 2025
c2c9360
fix notebook
mj-gomes Jul 10, 2025
fd9fc5e
use more general JonesToMueller method from Serena
mj-gomes Jul 21, 2025
6714e88
fix some small things
mj-gomes Jul 21, 2025
4383ba7
fix format that escaped
mj-gomes Jul 21, 2025
cfbed5b
finish band integration for jones
mj-gomes Jul 23, 2025
dd8404e
add band integration
mj-gomes Jul 29, 2025
0f9bc1c
start refactoring branch to new hwp handling
mj-gomes Oct 6, 2025
a5c9e43
merge master
mj-gomes Oct 6, 2025
f41850f
continue merging hwp_handling
mj-gomes Oct 6, 2025
267c6c4
resolving conflicts etc
mj-gomes Oct 8, 2025
9496c61
change observation and pointings verifications in hwp_harmonics.fill_…
mj-gomes Oct 8, 2025
d92c12a
complete and reformat parameter description and remove Unions in fill…
mj-gomes Oct 8, 2025
ae8f295
fix unsupported |
mj-gomes Oct 8, 2025
a534715
change test_hwp_sys to test_hwp_harmonics
mj-gomes Oct 8, 2025
83fb1e5
format
mj-gomes Oct 21, 2025
6baefc0
merge master
mj-gomes Oct 21, 2025
7f7d359
fix test_hwp_harmonics and remove no longer needed nside_out from par…
mj-gomes Oct 22, 2025
1c84b26
Add assertion to sim.set_hwp and complete description
mj-gomes Oct 22, 2025
b78fde1
fix ident errors
mj-gomes Oct 22, 2025
f1289f4
add TODO to generate a warning instead of an AssertionError in sim.se…
mj-gomes Oct 22, 2025
9512846
add test for Jones formalism in hwp_harmonics
mj-gomes Oct 22, 2025
24729de
Fix bug in observations.set_hwp()
mj-gomes Oct 22, 2025
55baa7b
add mueller_interpolation to hwp_harmonics.__init__()
mj-gomes Oct 23, 2025
84ed176
Update __init__.py
mj-gomes Oct 23, 2025
c89ef8a
update notebook hwp_harmonics
mj-gomes Oct 23, 2025
4fef2cb
update notebook hwp_harmonics
mj-gomes Oct 23, 2025
ff4d89e
update hwp_harmonics notebook
mj-gomes Oct 23, 2025
073d041
fix format
mj-gomes Oct 23, 2025
0b772ec
Merge branch 'master' into add_jones_to_hwp_harmonics
Jan 22, 2026
67f0d30
Fix error in jones calculus
mj-gomes Jan 23, 2026
02294b8
fix passing from deltas to jones and vice versa, change expected inpu…
Feb 16, 2026
c41567e
change indices of jones matrix elements for consistency
Feb 16, 2026
74932d5
make column names compatible with giampaolo's spreadsheets
Feb 16, 2026
8479dc6
add normalization to gain
Feb 16, 2026
70d87e9
add arguments to scan_map_in_obs and fill_tods for band integration
Feb 16, 2026
0f55c76
add typing List
mj-gomes Feb 16, 2026
61209b4
add List to typing import
mj-gomes Feb 16, 2026
c7fb169
fix jones matrix definition
mj-gomes Feb 16, 2026
ae0f7ea
fix typo .calc -> .calculus
mj-gomes Feb 16, 2026
7ccd2d8
change delimiter in csv reading
mj-gomes Feb 16, 2026
4517cc8
deg2rad phases
mj-gomes Feb 16, 2026
fc1b76c
change phases from complex to float
mj-gomes Feb 16, 2026
6bc6ca7
try fixing complex phase bug with startswith
mj-gomes Feb 16, 2026
4f0bb21
merge master
mj-gomes Feb 20, 2026
d4a1dfd
fix test
mj-gomes Feb 20, 2026
ca0a52c
remove unused files
mj-gomes Feb 20, 2026
c1cfa90
remove bandpass_template_module.py
mj-gomes Feb 20, 2026
4f78288
remove bandpass.ipynb
mj-gomes Feb 20, 2026
6f1ab40
fix typing errors
mj-gomes Feb 20, 2026
62d1328
fix error in hwp_harmonics.py
mj-gomes Feb 20, 2026
f858ac8
fix bug in tod definition in hwp_harmonics
mj-gomes Feb 20, 2026
194ce97
set csv file definition to HWP instantiation
mj-gomes Feb 23, 2026
2e5254d
fix bug in jones calculus
mj-gomes Feb 24, 2026
ba5954f
add notebooks
mj-gomes Feb 24, 2026
fefd056
remove old notebook
mj-gomes Feb 24, 2026
df43441
optimize band integration computation
mj-gomes Feb 24, 2026
a4fb024
update notebooks
mj-gomes Feb 24, 2026
040d623
update docs
mj-gomes Feb 24, 2026
51ca55f
add test for band integration
mj-gomes Feb 25, 2026
0587081
update notebooks
mj-gomes Feb 25, 2026
9ca4ffc
fix minor issue in hwp_harmonics and enable band integration to work …
mj-gomes Feb 25, 2026
706572f
ignore ty errors in band integration example notebook
mj-gomes Feb 25, 2026
c8c4a49
format
mj-gomes Feb 25, 2026
6b228af
Update CHANGELOG.md
mj-gomes Feb 25, 2026
e7099a7
fix factor 2 in bandwidth
mj-gomes Feb 25, 2026
82919ee
fix typo and reformat
mj-gomes Feb 25, 2026
8c752a1
Merge branch 'add_jones_to_hwp_harmonics' of https://github.com/liteb…
mj-gomes Feb 25, 2026
a783b6c
ignore ty in notebook
mj-gomes Feb 25, 2026
ce653d8
add temperature to intensity factor and bandpass profile in band inte…
mj-gomes Mar 9, 2026
e2ff8f9
temporarily set bandpass to default to None in hwp_harmonics
mj-gomes Mar 9, 2026
2b5fa4c
change location of definition of bandpass as None
mj-gomes Mar 9, 2026
2c34cbe
Fix a few mistakes in the HWP documentation
ziotom78 Mar 10, 2026
fc12394
remove return statement creating bug in multidetector case
mj-gomes Mar 16, 2026
55ebc0e
Merge branch 'master' into add_jones_to_hwp_harmonics
mj-gomes Mar 23, 2026
b3461bc
make code compatible with PR#502 changes on hwp_diff_emiss.py
mj-gomes Mar 23, 2026
e30eca9
Refactor lots of stuff
ziotom78 Mar 25, 2026
fbbaf3d
Fix a few type errors and add checks
ziotom78 Mar 26, 2026
bfa554b
[skip ci] change fill_tod to fill_tod_with_hwp_harmonics
mj-gomes Mar 27, 2026
6792aa1
[skip ci] remove obsolete mueller interpolation function
mj-gomes Mar 27, 2026
b9f2ae2
fix ty errors, remove default mueller phases
mj-gomes Mar 27, 2026
4089053
remove unused __init__ in hwp_harmonics folder, update notebook
mj-gomes Mar 27, 2026
d5e4448
update band integration notebook for new class HWPJonesParams
mj-gomes Mar 27, 2026
cfe7e9c
fix mpi test
mj-gomes Mar 27, 2026
06c61f3
add again __init__ file in hwp_harmonics to solve parent folder errors
mj-gomes Mar 27, 2026
6630246
change tod expected values for test_mpi_n4 after changing mueller ele…
mj-gomes Mar 27, 2026
f43e71e
Merge branch 'master' into add_jones_to_hwp_harmonics
mj-gomes Mar 27, 2026
5760fed
correct syntax in changelog
mj-gomes Mar 27, 2026
e968dd5
remove list from observation type and docstrings
mj-gomes Apr 2, 2026
f2fe3a7
Merge branch 'master' into add_jones_to_hwp_harmonics
mj-gomes Apr 2, 2026
fc5b907
Ghz to Hz conversion in band integration
mj-gomes Apr 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# HEAD

- Add complete HWP Jones formalism, including band integration. [#499](https://github.com/litebird/litebird_sim/pull/499)

- Update dependency on Ducc and Numba [#502](https://github.com/litebird/litebird_sim/pull/502)

- Add multi-frequency support to HealpixMap and SphericalHarmonics. New option for generation of multi-frequency maps in input_sky [#496](https://github.com/litebird/litebird_sim/pull/496)
Expand Down
88 changes: 80 additions & 8 deletions docs/source/hwp.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
Ideal Half Wave Plate
=====================
.. _hwp:

Half Wave Plate
===============

The rotation of the polarization angle induced by a HWP can be
included in the returned pointing information by passing an instance
of a descendant of the class :class:`.HWP` to the method
:meth:`.Simulation.set_hwp`. Here is an example::
of IdealHWP, a descendant of the class :class:`.HWP`, to the method
:meth:`.Simulation.set_hwp`. Here is an example for the simplest case, with an Ideal HWP:

.. testcode::

import litebird_sim as lbs

Expand Down Expand Up @@ -46,20 +50,88 @@ of a descendant of the class :class:`.HWP` to the method
sim.prepare_pointings()

pointing, hwp_angle = sim.observations[0].get_pointings()
print(f"{pointing.shape=}")
print(f"{hwp_angle.shape=}")

.. testoutput::

pointing.shape=(1, 100, 3)
hwp_angle.shape=(100,)


This example uses the :class:`.IdealHWP`, which represents an ideal
spinning HWP. The method :func:`.get_pointings` returns both pointing
and hwp angle on the fly. As shown before a similar syntax allow to
and hwp angle on the fly; the shape of ``pointing`` reveals that there
is one detector, 100 samples, and three angles (ϑ, φ, ψ).

As shown before a similar syntax allow to
precompute the pointing and the hwp angle::

sim.prepare_pointings()
sim.precompute_pointings()

sim.observations[0].pointing_matrix.shape
sim.observations[0].hwp_angle.shape
# Now you can access:
# - sim.observations[0].pointing_matrix
# - sim.observations[0].hwp_angle

This fills the fields `pointing_matrix` and `hwp_angle` for all the
observations in the current simulation.
observations in the current simulation.


Defining a non-ideal HWP
------------------------

Another descendant of the class :class:`.HWP` is the class :class:`.NonIdealHWP`, which allows to define a more realistic HWP object.
When defining a non ideal HWP, one can choose it to be described by Mueller or Jones formalism and if the desired representation should include the expansion of the matrix in harmonics of the HWP rotation frequency.
Here is an example::

import litebird_sim as lbs

sim = lbs.Simulation(
start_time=0,
duration_s=100.0,
random_seed=12345,
)

sim.set_scanning_strategy(
lbs.SpinningScanningStrategy(
spin_sun_angle_rad=0.785_398_163_397_448_3,
precession_rate_hz=8.664_850_513_998_931e-05,
spin_rate_hz=0.000_833_333_333_333_333_4,
start_time=sim.start_time,
),
delta_time_s=60,
)

sim.set_instrument(
instrument = lbs.InstrumentInfo(
boresight_rotangle_rad=0.0,
spin_boresight_angle_rad=0.872_664_625_997_164_8,
spin_rotangle_rad=3.141_592_653_589_793,
)
)

sim.set_hwp(
lbs.NonIdealHWP(
ang_speed_radpsec=4.084_070_449_666_731,
harmonic_expansion=True,
calculus=lbs.Calc.JONES,
)
)

det = lbs.DetectorInfo(
name="Boresight_detector",
sampling_rate_hz=1.0,
quat=[0.0, 0.0, 0.0, 1.0],
)
obs, = sim.create_observations(detectors=[det])

sim.prepare_pointings()

pointing, hwp_angle = sim.observations[0].get_pointings()

For knowing how to define the HWP when performing integration in band, please refer to the correspondent section of the `HWP Systematics docs page <https://litebird-sim.readthedocs.io/en/master/hwp_sys.html>`_.



API reference
Expand Down
Loading
Loading