deepskies / deeplenstronomy

A pipeline for versatile strong lens sample simulations
MIT License
27 stars 7 forks source link

Fixed redshift value in Plane > 1 outputs N-1 images #126

Closed jsv1206 closed 1 year ago

jsv1206 commented 1 year ago

Fixing the redshift value in Plane_2 or Plane_3 outputs N-1 images for Dataset=N in config file. In this case, assert eval(f'dataset.{conf}_images').shape[0] == simulated_images fails in \test\test_expected_behaviors_configurations.py

Changing the redshift to a distribution passes the test

Except when 'return_planes':= True in make_dataset and number of Planes > 2 in config.yaml

jsv1206 commented 1 year ago

Also related to issue #57

jsv1206 commented 1 year ago

Adding one line of code in input_reader.py under 'Geometry' fixes this issue

for band in bands: for obj_num in range(1, config_dict['SIM_DICT']['PLANE_{0}-NUMBER_OF_OBJECTS'.format(plane_num)] + 1): output_dict[band]['PLANE_{0}-OBJECT_{1}-{2}'.format(plane_num, obj_num, k_param)] = v_param output_dict[band]['PLANE_{0}-{2}'.format(plane_num, obj_num, k_param)] = v_param