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

Updating the MA tables in parameters.py and setting the default MAtable to 4 in ris_make_utils.py #177

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
175 changes: 151 additions & 24 deletions romanisim/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion romanisim/ris_make_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions romanisim/tests/test_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ def test_reference_file_crds_match(level):
metadata = copy.deepcopy(parameters.default_parameters_dictionary)
metadata['instrument']['detector'] = 'WFI07'
metadata['instrument']['optical_element'] = 'F158'
metadata['exposure']['ma_table_number'] = 1
metadata['exposure']['ma_table_number'] = 4

twcs = wcs.get_wcs(metadata, usecrds=True)
rd_sca = twcs.toWorld(galsim.PositionD(
Expand Down Expand Up @@ -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],
Expand Down
2 changes: 1 addition & 1 deletion romanisim/tests/test_l1.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion romanisim/tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
{
Expand Down
4 changes: 2 additions & 2 deletions romanisim/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ def sum_times(x):
return total_exptimes


def default_image_meta(time=None, ma_table=1, filter_name='F087',
def default_image_meta(time=None, ma_table=4, filter_name='F087',
detector='WFI01', coord=None):
"""Return some simple default metadata for input to image.simulate

Expand Down Expand Up @@ -449,7 +449,7 @@ def default_image_meta(time=None, ma_table=1, filter_name='F087',
meta = {
'exposure': {
'start_time': time,
'ma_table_number': 1,
'ma_table_number': 4,
},
'instrument': {
'optical_element': filter_name,
Expand Down
Loading