Skip to content

Commit

Permalink
ask duration_yr
Browse files Browse the repository at this point in the history
  • Loading branch information
yusuke-takase committed Nov 15, 2024
1 parent 8778a64 commit b14a0d0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions litebird_sim/plot_fp.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def gen_detsinfo_text(self, det1, det2):
"""
return info_text

def generate_text_file(self, filename, selected_detector_list, duration_yr=1.0):
def generate_dets_list_file(self, filename, selected_detector_list, duration_yr=1.0):
"""Generate a text file with the selected detector list.
The NET on detector is scaled by the`scaling_factor`:
:math:`\sqrt{\frac{duration_yr}{3} \times \frac{N_{\rm dets}^{\rm e2e}}{N_{\rm dets}^{\rm ch}}}`
Expand Down Expand Up @@ -264,6 +264,8 @@ def main(self):
print("[green]Do you want to make a detector list file? (y/n) [/green]")
ans = self.ask_yes_or_no()
if ans == "y":
print("[green]Input mission duration to define a scaling factor for NET (unit: yr):[/green]")
duration_yr = float(input())
print("[green]Specify the directory to save:[/green]")
self.base_path = input()
if self.base_path == "":
Expand Down Expand Up @@ -329,7 +331,7 @@ def main(self):
filename = "detectors_"+self.telescope+"_"+self.channel+"_T+B.txt"
self.selected_detector_list = sorted(
self.selected_detector_list, key=lambda detector: detector.name)
self.generate_text_file(filename, self.selected_detector_list)
self.generate_dets_list_file(filename, self.selected_detector_list, duration_yr)


if __name__ == "__main__":
Expand Down

0 comments on commit b14a0d0

Please sign in to comment.