diff --git a/romanisim/parameters.py b/romanisim/parameters.py index c492f52..d2d70e5 100644 --- a/romanisim/parameters.py +++ b/romanisim/parameters.py @@ -5,29 +5,155 @@ from astropy.time import Time from astropy import units as u -read_pattern = {1: [[1 + x for x in range(8)], - [9 + x for x in range(8)], - [17 + x for x in range(8)], - [25 + x for x in range(8)], - [33 + x for x in range(8)], - [41 + x for x in range(8)]], - 2: [[1 + x for x in range(5)], - [6 + x for x in range(8)], - [14], - [15 + x for x in range(9)], - [24 + x for x in range(25)]], - 3: [[1 + x for x in range(25)], +# read_pattern is updated to match PRD15 +# MA tables 1(DEFOCUS_MOD), 2(DEFOCUS_LRG), and 18(DIAGNOSTIC) are excluded +read_pattern = {3: [[2], [5], [10], [16], [17]], + 4: [[1], [2], [3, 4], [5, 6, 7, 8, 9], + [10 + x for x in range(8)], + [18 + x for x in range(8)], [26 + x for x in range(8)], - [34], - [35 + x for x in range(14)]], - 109: [[1], [2, 3], [5, 6, 7], [10, 11, 12, 13], - [15, 16, 17, 18, 19, 20], [21, 22, 23, 24, 25, 26], - [27, 28, 29, 30, 31, 32], [33, 34, 35, 36, 37, 38], - [39, 40, 41, 42, 43], [44]], - 110: [[1], [2, 3, 4], [5, 6, 7], [8, 9, 10], [11, 12, 13], - [14, 15, 16], [17, 18, 19], [20, 21, 22], [23, 24, 25], - [26, 27, 28], [29, 30, 31], [32, 33, 34], [35, 36, 37], - [38, 39, 40], [41, 42, 43], [44]], + [34 + x for x in range(8)], [42]], + 5: [[1], [2], [3, 4], [5, 6, 7, 8, 9, 10], + [11 + x for x in range(6)], + [17 + x for x in range(6)], + [23 + x for x in range(6)], + [29 + x for x in range(6)], + [35 + x for x in range(8)], + [43 + x for x in range(8)], + [51 + x for x in range(10)], [61]], + 6: [[1], [2], [3, 4], [5, 6, 7, 8, 9, 10], + [11 + x for x in range(6)], + [17 + x for x in range(6)], + [23 + x for x in range(7)], + [30 + x for x in range(8)], + [38 + x for x in range(8)], + [46 + x for x in range(8)], + [54 + x for x in range(8)], + [62 + x for x in range(10)], + [72 + x for x in range(10)], + [82 + x for x in range(10)], [92]], + 7: [[1], [2], [3, 4], + [5 + x for x in range(8)], + [13 + x for x in range(8)], + [21 + x for x in range(10)], + [31 + x for x in range(10)], + [41 + x for x in range(10)], + [51 + x for x in range(12)], + [63 + x for x in range(12)], + [75 + x for x in range(12)], + [87 + x for x in range(12)], + [99 + x for x in range(12)], + [111 + x for x in range(12)], [123]], + 8: [[1], [2], [3, 4], + [5 + x for x in range(8)], + [13 + x for x in range(8)], + [21 + x for x in range(10)], + [31 + x for x in range(12)], + [43 + x for x in range(16)], + [59 + x for x in range(16)], + [75 + x for x in range(16)], + [91 + x for x in range(16)], + [107 + x for x in range(16)], + [123 + x for x in range(16)], + [139 + x for x in range(16)], [155]], + 9: [[1], [2], [3, 4], [5 + x for x in range(8)], [13 + x for x in range(8)], + [21 + x for x in range(12)], + [33 + x for x in range(12)], + [45 + x for x in range(12)], + [57 + x for x in range(16)], + [73 + x for x in range(16)], + [89 + x for x in range(16)], + [105 + x for x in range(16)], + [121 + x for x in range(32)], + [153 + x for x in range(32)], [185]], + 10: [[1], [2], [3, 4], [5 + x for x in range(8)], + [13 + x for x in range(12)], + [25 + x for x in range(16)], + [41 + x for x in range(16)], + [57 + x for x in range(16)], + [73 + x for x in range(16)], + [89 + x for x in range(16)], + [105 + x for x in range(32)], + [137 + x for x in range(32)], + [169 + x for x in range(32)], + [201 + x for x in range(32)], [233]], + 11: [[1], [2], [3, 4], + [5 + x for x in range(16)], + [21 + x for x in range(16)], + [37 + x for x in range(16)], + [53 + x for x in range(32)], + [85 + x for x in range(32)], + [117 + x for x in range(32)], + [149 + x for x in range(32)], + [181 + x for x in range(32)], + [213 + x for x in range(32)], + [245 + x for x in range(32)], + [277 + x for x in range(32)], [309]], + 12: [[1, 2], [3, 4], [5, 6], [7, 8], + [9, 10, 11, 12], [13, 14, 15, 16], [17, 18, 19, 20], + [21, 22, 23, 24], [25, 26, 27, 28], [29, 30, 31, 32], + [33, 34, 35, 36], [37, 38, 39, 40], + [41 + x for x in range(8)], + [49 + x for x in range(8)], + [57 + x for x in range(8)], [65]], + 13: [[1, 2], [3, 4], [5, 6], [7, 8], + [9, 10, 11, 12], [13, 14, 15, 16, 17, 18], + [19, 20, 21, 22, 23, 24], + [25 + x for x in range(8)], + [33 + x for x in range(8)], + [41 + x for x in range(8)], + [49 + x for x in range(8)], + [57 + x for x in range(8)], + [65 + x for x in range(8)], + [73 + x for x in range(8)], + [81 + x for x in range(8)], [89]], + 14: [[1, 2], [3, 4], [5, 6], [7, 8], + [9, 10, 11, 12], + [13, 14, 15, 16, 17, 18], + [19 + x for x in range(8)], + [27 + x for x in range(8)], + [35 + x for x in range(8)], + [43 + x for x in range(8)], + [51 + x for x in range(8)], + [59 + x for x in range(8)], + [67 + x for x in range(12)], + [79 + x for x in range(16)], + [95 + x for x in range(16)], [111]], + 15: [[1, 2], [3, 4], [5, 6], [7, 8], + [9, 10, 11, 12], + [13 + x for x in range(14)], + [27 + x for x in range(8)], + [35 + x for x in range(12)], + [47 + x for x in range(12)], + [59 + x for x in range(12)], + [71 + x for x in range(16)], + [87 + x for x in range(16)], + [103 + x for x in range(16)], + [119 + x for x in range(16)], [135]], + 16: [[1, 2], [3, 4], [5, 6], [7, 8], + [9 + x for x in range(8)], + [17 + x for x in range(8)], + [25 + x for x in range(16)], + [41 + x for x in range(16)], + [57 + x for x in range(16)], + [73 + x for x in range(16)], + [89 + x for x in range(16)], + [105 + x for x in range(16)], + [121 + x for x in range(16)], + [137 + x for x in range(16)], + [153 + x for x in range(16)], [169]], + 17: [[1, 2], [3, 4], [5, 6], [7, 8], + [9, 10, 11, 12, 13, 14], + [15 + x for x in range(8)], + [23 + x for x in range(8)], + [31 + x for x in range(16)], + [47 + x for x in range(16)], + [63 + x for x in range(16)], + [79 + x for x in range(16)], + [95 + x for x in range(32)], + [127 + x for x in range(32)], + [159 + x for x in range(32)], + [191 + x for x in range(32)], [223]] } default_parameters_dictionary = { @@ -37,8 +163,9 @@ }, 'exposure': {'start_time': Time('2026-01-01T00:00:00'), 'type': 'WFI_IMAGE', - 'ma_table_number': 1, - 'read_pattern': read_pattern[1], + 'ma_table_number': 4, + 'read_pattern': read_pattern[4], + # Changing the default MA table to be 4 (C2A_IMG_HLWAS) as MA table 1 (DEFOCUS_MOD) is not supported }, 'pointing': {'target_ra': 270.0, 'target_dec': 66.0, diff --git a/romanisim/ris_make_utils.py b/romanisim/ris_make_utils.py index dc18dde..576c95c 100755 --- a/romanisim/ris_make_utils.py +++ b/romanisim/ris_make_utils.py @@ -46,7 +46,7 @@ def merge_nested_dicts(dict1, dict2): def set_metadata(meta=None, date=None, bandpass='F087', sca=7, - ma_table_number=1, truncate=None): + ma_table_number=4, truncate=None): """ Set / Update metadata parameters diff --git a/romanisim/tests/test_image.py b/romanisim/tests/test_image.py index eac0c11..a0c4e7e 100644 --- a/romanisim/tests/test_image.py +++ b/romanisim/tests/test_image.py @@ -637,7 +637,7 @@ def test_inject_source_into_image(): coord = SkyCoord(ra=270 * u.deg, dec=66 * u.deg) filt = 'F158' meta = util.default_image_meta(coord=coord, filter_name=filt, - detector='WFI07', ma_table=1) + detector='WFI07', ma_table=4) rng_seed = 42 rng = galsim.UniformDeviate(rng_seed) cat = catalog.make_dummy_table_catalog(coord, radius=0.1, bandpasses=[filt], diff --git a/romanisim/tests/test_l1.py b/romanisim/tests/test_l1.py index e9fa5f3..1c8c95d 100644 --- a/romanisim/tests/test_l1.py +++ b/romanisim/tests/test_l1.py @@ -238,7 +238,7 @@ def test_ipc(): def test_read_pattern_to_tij(): - tij = l1.read_pattern_to_tij(1) + tij = l1.read_pattern_to_tij(4) assert l1.validate_times(tij) for read_pattern in read_pattern_list: tij = l1.read_pattern_to_tij(read_pattern) diff --git a/romanisim/tests/test_util.py b/romanisim/tests/test_util.py index d85d25b..7cf495f 100644 --- a/romanisim/tests/test_util.py +++ b/romanisim/tests/test_util.py @@ -89,7 +89,7 @@ def test_add_more_metadata(): metadata = {'exposure': { 'start_time': Time('2026-01-01T00:00:00'), - 'ma_table_number': 1, + 'ma_table_number': 4, }, 'instrument': {