Issue with PS rendering (with 0.9.2)
See original GitHub issueI’m having trouble with version 0.9.2 : when I try the following kwargs
kwargs_model = {..., 'point_source_model_list': ['LENSED_POSITION'], 'fixed_magnification_list': [False]}
#kwargs_params = {..., 'point_source_model': [[{'ra_image': array([-0.9, 0.6, 0.9, -0.7]), 'dec_image': array([-0.9, -0.9, 0.7, 0.9])}], [{'ra_image': array([0.1, 0.1, 0.1, 0.1]), 'dec_image': array([0.1, 0.1, 0.1, 0.1])}], [{}], [{'ra_image': array([-10., -10., -10., -10.]), 'dec_image': array([-10., -10., -10., -10.])}], [{'ra_image': array([10., 10., 10., 10.]), 'dec_image': array([10., 10., 10., 10.])}]]', ...}
kwargs_results = {..., 'kwargs_ps': [{'point_amp': array([266.79773197, 280.07506424, 273.46808759, 265.219639 ]), 'ra_image': array([-0.9204886 , 0.64522794, 0.85173559, -0.70591383]), 'dec_image': array([-0.83137116, -0.78471491, 0.76415318, 0.82666677])}], 'kwargs_special': {'delta_x_image': array([-0.0010609 , 0.00510851, -0.00247576, 0.00350916]), 'delta_y_image': array([ 0.00097327, -0.00090853, 0.00016772, -0.00074446]), 'D_dt': 5361.082157276348}, ...}
I obtain the following error in ImSim/Numerics/point_source_rendering :
lenstronomy/ImSim/Numerics/point_source_rendering.py", line 35, in _displace_astrometry delta_x_new[0:len(delta_x)] = delta_x ValueError: could not broadcast input array from shape (4) into shape (1)
I went back to previously called methods, and I found that the method PointSource.linear_response_set()
returns the ra_pos
variable as
ra_pos = [[-0.9204885979919323], [0.6452279400704862], [0.8517355905217909], [-0.7059138349159952]]
i.e. separating each individual point source from the same model in lists containing one coordinate. Is it the expected behaviour ? By looking to the point_source_rendering()
and _displace_astrometry()
methods, it seems not…
What is strange though is that with version 0.9.0 I didn’t have this issue (with the exact same input kwargs), despite having not spotted any obvious changes between 0.9.0 and 0.9.2 (except this new _displace_astrometry()
method, but I suspect the error is causing prior to this method).
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:8
@aymgal Should be fixed with the latest commit. The definition of delta_x_image are the offset relative to the ‘real’ image positions ra_image. Let me know if you still experience issues or please close the issue. Thanks
The linear_response_set() splits the point sources in the sets of independent amplitudes, so this function is doing what it is supposed to do. The problem is that the updated astrometric displacement is not compatible with this anymore. Working on it and post here when I found a fix for this. Thanks