Skip to content

Commit

Permalink
Fixed error for reading from parameter file
Browse files Browse the repository at this point in the history
  • Loading branch information
sgiardie committed Dec 30, 2021
1 parent 41a6538 commit 77d4e9d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions litebird_sim/hwp_sys/hwp_sys.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,19 +85,19 @@ def set_parameters(

# This part sets from parameter file
if (self.sim.parameter_file is not None) and (
"hwp_sys" in self.sim.parameters.keys()
"hwp_sys" in self.sim.parameter_file.keys()
):
paramdict = self.sim.parameters["hwp_sys"]
paramdict = self.sim.parameter_file["hwp_sys"]

if "nside" in paramdict.keys():
self.nside = paramdict["nside"]
if "general" in self.sim.parameters.keys():
if "nside" in self.sim.parameters["general"].keys():
if self.sim.parameters["general"]["nside"] != self.nside:
if "general" in self.sim.parameter_file.keys():
if "nside" in self.sim.parameter_file["general"].keys():
if self.sim.parameter_file["general"]["nside"] != self.nside:
print(
"Warning!! nside from general "
"(=%i) and hwp_sys (=%i) do not match. Using hwp_sys"
% (self.sim.parameters["general"]["nside"], self.nside)
% (self.sim.parameter_file["general"]["nside"], self.nside)
)

if "integrate_in_band" in paramdict.keys():
Expand Down

1 comment on commit 77d4e9d

@sgiardie
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See issue #148

Please sign in to comment.