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

Error found for get_effective_psf function. #4

Open
DamonLee5 opened this issue Feb 9, 2024 · 1 comment
Open

Error found for get_effective_psf function. #4

DamonLee5 opened this issue Feb 9, 2024 · 1 comment

Comments

@DamonLee5
Copy link

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.5*src_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.5
max(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
Copy link
Author

DamonLee5 commented Feb 9, 2024

The issue is related to the below

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'])

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'])

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'])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant