ndaniyar/aphot

Issues with aphot

mm12604 opened this issue · 0 comments

Dear all

When I am running this code using the following command line:

python ~/.../.../morphology_classification/aphot.py --evt_files=13490.evt.fits --ra=28.172 --dec=-13.970 --z=0.833 --R500=811.7 --Nresamplings=0

I got the following error message:

Traceback (most recent call last):
File "/.../.../morphology_classification/aphot.py", line 48, in
p.path, p.evt_files.split(), p.exp_files.split(),p.reg_files.split()),p.inspect)
File "/.../.../morphology_classification/chandra.py", line 369, in process_multiple_obs
evt, expm = get_events_expmap(evt, exph, expm, regions, ths, R_bkgr_px, inspect1)
File "/.../.../morphology_classification/chandra.py", line 174, in get_events_expmap
offset = -radec2xy_winding(*xy2radec(0, 0, evt.header), h=exph) * bins
File "/.../.../morphology_classification/chandra.py", line 36, in radec2xy_winding
x, y = radec2xy(ra, dec, h)
File "/.../.../morphology_classification/chandra.py", line 28, in radec2xy
res = XY((ra-h['CRVAL1'])/h['CDELT1']cos(h['CRVAL2']/180pi) + h['CRPIX1'] - 0.5,
KeyError: 'CRVAL1'

and when I try to run the code with the following command line (adding exposure file):

python ~/.../.../morphology_classification/aphot.py --evt_files=13490.evt.fits --exp_files=13490.exp.fits --ra=28.172 --dec=-13.970 --z=0.833 --R500=811.7

I got the following message:

/.../.../morphology_classification/chandra.py:94: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
mask[yl:yr, xl:xr] &= ~ellipsemask(xc, yc, a, b, th)(y_ind[yl:yr,xl:xr], x_ind[yl:yr,xl:xr])
/.../.../morphology_classification/chandra.py:262: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
expm = expm[yl:yr, xl:xr]
/.../.../morphology_classification/chandra.py:263: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
tmp = ptsrc_mask[ylbins:yrbins, xlbins:xrbins].astype(int)
/.../.../morphology_classification/chandra.py:264: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
ptsrc_exp = sum(sum(tmp.reshape(yr-yl, bins, xr-xl, bins), 3), 1)
Traceback (most recent call last):
File "/.../.../morphology_classification/aphot.py", line 46, in
evt, expm = process_multiple_obs(p.ra, p.dec, int(1.5R500px), p.Eband, [xR500px for x in p.R_bkgr], p.path, p.evt_files.split(), p.exp_files.split(), p.reg_files.split(), p.inspect)
File "/.../.../morphology_classification/chandra.py", line 331, in process_multiple_obs
evt, expm = get_events_expmap(evt, exph, expm, regions, ths, R_bkgr_px, inspect)
File "/.../.../morphology_classification/chandra.py", line 264, in get_events_expmap
ptsrc_exp = sum(sum(tmp.reshape(yr-yl, bins, xr-xl, bins), 3), 1)

Is anyone able to help to fix these issues?

Best wishes