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

Add star mag to set new magnitude for stars in default sky sim mode. #19

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions bin.src/img_closed_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
args.rot_cam,
args.boresight_deg,
args.mjd,
args.star_mag,
args.output,
args.sky_file,
args.clobber,
Expand Down
6 changes: 6 additions & 0 deletions doc/versionHistory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
Version History
##################

-------------
0.8.0
-------------

* Add star_mag to img_closed_loop to specify default star magnitude.

-------------
0.7.0
-------------
Expand Down
12 changes: 11 additions & 1 deletion python/lsst/ts/imsim/closed_loop_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,7 @@ def run_img(
rot_cam_in_deg: float,
boresight: list[float],
mjd: float,
star_mag: float,
base_output_dir: str,
path_sky_file: str,
do_erase_dir_content: bool,
Expand Down Expand Up @@ -1047,6 +1048,8 @@ def run_img(
Boresight [ra, dec] in degree.
mjd : float
MJD of the observation.
star_mag : float
Magnitude of stars if using default sky file.
base_output_dir : str
Base output directory.
path_sky_file : str
Expand Down Expand Up @@ -1104,7 +1107,7 @@ def run_img(

# Configure the components
self.config_sky_sim(
inst_name, obs_metadata, path_sky_file=path_sky_file, star_mag=15
inst_name, obs_metadata, path_sky_file=path_sky_file, star_mag=star_mag
)
self.config_ofc_calc(inst_name)
self.imsim_cmpt = ImsimCmpt()
Expand Down Expand Up @@ -1392,6 +1395,13 @@ def set_img_parser(parser: ArgumentParser) -> ArgumentParser:
"--mjd", type=float, default=59580, help="Starting MJD of observation."
)

parser.add_argument(
"--star_mag",
type=float,
default=15.0,
help="Magnitude of stars if using default sky_file. The default is 15.",
)

parser.add_argument(
"--turn_off_sky_background",
action="store_true",
Expand Down
1 change: 1 addition & 0 deletions tests/test_closed_loop_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ def test_set_img_parser(self):
self.assertEqual(args.raw_seeing, 0.5)
self.assertFalse(args.turn_off_sky_background)
self.assertFalse(args.turn_off_atmosphere)
self.assertEqual(args.star_mag, 15.0)

def test_get_sensor_name_list_of_field_lsst_wfs(self):
sensor_name_list = self.closed_loop_task.get_sensor_name_list_of_fields("lsst")
Expand Down
Loading