diff --git a/python/desc/imsim/imSim.py b/python/desc/imsim/imSim.py index 8cf72a18..f84b3d94 100644 --- a/python/desc/imsim/imSim.py +++ b/python/desc/imsim/imSim.py @@ -183,7 +183,7 @@ def sources_from_list(object_lines, obs_md, phot_params, file_name): rotation_angle = np.zeros(num_objects, dtype=float) fits_image_file = dict() - unique_id = np.zeros(num_objects, dtype=int) + unique_id = [None]*num_objects object_type = np.zeros(num_objects, dtype=int) i_obj = -1 @@ -192,7 +192,7 @@ def sources_from_list(object_lines, obs_md, phot_params, file_name): if params[0] != 'object': continue i_obj += 1 - unique_id[i_obj] = int(params[1]) + unique_id[i_obj] = params[1] ra_phosim[i_obj] = float(params[2]) dec_phosim[i_obj] = float(params[3]) mag_norm[i_obj] = float(params[4]) diff --git a/tests/test_instcat_parser.py b/tests/test_instcat_parser.py index df6b797d..d00873d4 100644 --- a/tests/test_instcat_parser.py +++ b/tests/test_instcat_parser.py @@ -151,11 +151,11 @@ def test_object_extraction_stars(self): phot_params, self.phosim_file) - id_arr = np.zeros(len(gs_object_arr), dtype=int) + id_arr = [None]*len(gs_object_arr) for i_obj in range(len(gs_object_arr)): id_arr[i_obj] = gs_object_arr[i_obj].uniqueId - truth_dtype = np.dtype([('uniqueId', int), ('x_pupil', float), ('y_pupil', float), + truth_dtype = np.dtype([('uniqueId', str, 200), ('x_pupil', float), ('y_pupil', float), ('sedFilename', str, 200), ('magNorm', float), ('raJ2000', float), ('decJ2000', float), ('pmRA', float), ('pmDec', float), @@ -253,11 +253,11 @@ def test_object_extraction_galaxies(self): phot_params, galaxy_phosim_file) - id_arr = np.zeros(len(gs_object_arr), dtype=int) + id_arr = [None]*len(gs_object_arr) for i_obj in range(len(gs_object_arr)): id_arr[i_obj] = gs_object_arr[i_obj].uniqueId - truth_dtype = np.dtype([('uniqueId', int), ('x_pupil', float), ('y_pupil', float), + truth_dtype = np.dtype([('uniqueId', str, 200), ('x_pupil', float), ('y_pupil', float), ('sedFilename', str, 200), ('magNorm', float), ('raJ2000', float), ('decJ2000', float), ('redshift', float), ('gamma1', float), @@ -424,9 +424,10 @@ def test_validate_phosim_object_list(self): message = wa[desired_warning_dex].message.args[0] # these are the objects that should be omitted - bad_unique_ids = set([34307989098524, 811883374597, + bad_unique_ids = set([str(x) for x in + [34307989098524, 811883374597, 811883374596, 956090392580, - 34307989098523, 34304522113056]) + 34307989098523, 34304522113056]]) self.assertIn('Omitted 6 suspicious objects', message) self.assertIn('4 had galactic_Av', message) diff --git a/tests/tiny_instcat.txt b/tests/tiny_instcat.txt index fc9c6553..fd7be54f 100644 --- a/tests/tiny_instcat.txt +++ b/tests/tiny_instcat.txt @@ -18,7 +18,7 @@ seed 161899 seeing 0.7613760 sunalt -59.1098785 vistime 33.0000000 -object 1046817878020 31.2400746 -10.09365 29.3370237 starSED/phoSimMLT/lte033-4.5-1.0a+0.4.BT-Settl.spec.gz 0 0 0 0 0 0 point none CCM 0.0635117705 3.1 +object MS_567_8 31.2400746 -10.09365 29.3370237 starSED/phoSimMLT/lte033-4.5-1.0a+0.4.BT-Settl.spec.gz 0 0 0 0 0 0 point none CCM 0.0635117705 3.1 object 811883456516 31.2338048 -10.0578789 26.9267056 starSED/phoSimMLT/lte027-2.0-0.0a+0.0.BT-Settl.spec.gz 0 0 0 0 0 0 point none CCM 0.0630700848 3.1 object 1046816368644 31.2371416 -10.0554117 28.7153047 starSED/phoSimMLT/lte027-2.0-0.0a+0.0.BT-Settl.spec.gz 0 0 0 0 0 0 point none CCM 0.0630379733 3.1 object 1046816356356 31.2305508 -10.0620637 26.7932237 starSED/phoSimMLT/lte033-4.5-1.0a+0.4.BT-Settl.spec.gz 0 0 0 0 0 0 point none CCM 0.0631214889 3.1