Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugs in hwp_sys default mueller parameters definition #348

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
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
30 changes: 16 additions & 14 deletions litebird_sim/hwp_sys/hwp_sys.py
Original file line number Diff line number Diff line change
Expand Up @@ -959,24 +959,25 @@ def set_parameters(
}

for attr, default_value in default_attrs.items():
if not hasattr(self, attr):
if not paramdict.get(attr):
setattr(self, attr, default_value)
self.beta = np.deg2rad(self.beta)

else: # mueller_or_jones == "mueller":
default_attrs = {
"mII": 0.0,
"mII": 1.0,
"mQI": 0.0,
"mUI": 0.0,
"mIQ": 0.0,
"mIU": 0.0,
"mQQ": 0.0,
"mUU": 0.0,
"mQQ": 1.0,
"mUU": -1.0,
"mUQ": 0.0,
"mQU": 0.0,
}

for attr, default_value in default_attrs.items():
if not hasattr(self, attr):
if not paramdict.get(attr):
setattr(self, attr, default_value)

if np.any(maps) is None:
Expand Down Expand Up @@ -1067,26 +1068,27 @@ def set_parameters(
"z2s": 0.0,
}

for attr, default_value in default_attrs.items():
if not hasattr(self, attr):
setattr(self, attr, default_value)
for attr, default_value in default_attrs.items():
if not paramdict.get(attr):
setattr(self, attr, default_value)
self.betas = np.deg2rad(self.betas)

else: # mueller_or_jones == "mueller":
default_attrs = {
"mIIs": 0.0,
"mIIs": 1.0,
"mQIs": 0.0,
"mUIs": 0.0,
"mIQs": 0.0,
"mIUs": 0.0,
"mQQs": 0.0,
"mUUs": 0.0,
"mQQs": 1.0,
"mUUs": -1.0,
"mUQs": 0.0,
"mQUs": 0.0,
}

for attr, default_value in default_attrs.items():
if not hasattr(self, attr):
setattr(self, attr, default_value)
for attr, default_value in default_attrs.items():
if not paramdict.get(attr):
setattr(self, attr, default_value)

# conversion from Jones to Mueller
if mueller_or_jones == "jones":
Expand Down
Loading