LLNL / pysaber

Python package for a systems approach to blur estimation and reduction
MIT License
4 stars 3 forks source link

Error found for get_effective_psf function. #4

Open DamonLee5 opened 5 months ago

DamonLee5 commented 5 months ago

eff_psf= get_effective_psf(pix_wid, src_params,det_params,60000,30000)


TypeError Traceback (most recent call last) Cell In[6], line 1 ----> 1 eff_psf= get_effective_psf(pix_wid, src_params,det_params,60000,30000)

File /p/gpfs1/li93/anaconda/envs/xspec/lib/python3.9/site-packages/pysaber/mainsr.py:385, in get_effective_psf(pix_wid, src_pars, det_pars, sod, odd) 383 #if max_wid == None: 384 max_wid = 0.5src_pars['cutoff_FWHM_multiplier']max(src_pars['source_FWHM_x_axis'],src_pars['source_FWHM_y_axis'])odd/sod --> 385 src_mod = SourceBlur(pix_wid,max_wid,sod,odd,src_pars['cutoff_FWHM_multiplier'],param_x=get_scale(src_pars['source_FWHM_x_axis']),param_y=get_scale(src_pars['source_FWHM_y_axis']),param_type='scale',norm_pow=src_pars['norm_power']) 386 max_wid = 0.5max(det_pars['cutoff_FWHM_1_multiplier']det_pars['detector_FWHM_1'],det_pars['cutoff_FWHM_2_multiplier']det_pars['detector_FWHM_2']) 387 det_mod = DetectorBlur(pix_wid,max_wid,det_pars['cutoff_FWHM_1_multiplier'],det_pars['cutoff_FWHM_2_multiplier'],param_1=get_scale(det_pars['detector_FWHM_1']),param_2=get_scale(det_pars['detector_FWHM_2']),weight_1=det_pars['detector_weight_1'],param_type='scale',norm_pow=det_pars['norm_power'])

TypeError: get_scale() missing 1 required positional argument: 'norm'

DamonLee5 commented 5 months ago

The issue is related to the below https://github.com/LLNL/pysaber/blob/664c922058f490eb41c2cc32a0967c6434bc672f/pysaber/mainsr.py#L385 https://github.com/LLNL/pysaber/blob/664c922058f490eb41c2cc32a0967c6434bc672f/pysaber/mainsr.py#L387 which shows that the required positional argument: 'norm' is missing.

Solution: Update all get_scale() to include norm_power get_scale(src_pars['source_FWHM_x_axis'], src_pars['norm_power']) get_scale(src_pars['source_FWHM_y_axis'], src_pars['norm_power']) get_scale(det_pars['detector_FWHM_1'], det_pars['norm_power']) get_scale(det_pars['detector_FWHM_2'], det_pars['norm_power'])