ndaniyar / aphot Goto Github PK
View Code? Open in Web Editor NEWPhoton Asymmetry
Photon Asymmetry
Dear all,
while running Aphot in /examples/SPT-CLJ0352-5647 with the command line
python ../../aphot.py --evt_files=13490.evt.fits --exp_files=13490.exp.fits --reg_files=13490.psf.reg --ra=28.172 --dec=-13.970 --z=0.833 --R500=811.7
I got the following errors that I'm not able to solve:
Traceback (most recent call last):
File "../../aphot.py", line 49, in
p.inspect)
File "/Users/rcassano/Work/PROGRAMS/aphot-master/chandra.py", line 333, in process_multiple_obs
evt, expm = get_events_expmap(evt, exph, expm, regions, ths, R_bkgr_px, inspect)
File "/Users/rcassano/Work/PROGRAMS/aphot-master/chandra.py", line 187, in get_events_expmap
mask_regions(ptsrc_mask, regions, offset)
File "/Users/rcassano/Work/PROGRAMS/aphot-master/chandra.py", line 97, in mask_regions
mask[yl:yr, xl:xr] &= ~ellipsemask(xc, yc, a, b, th)(y_ind[yl:yr,xl:xr], x_ind[yl:yr,xl:xr])
TypeError: slice indices must be integers or None or have an index method
Is anybody able to solve this problem?
The only change I made to the code is to substitute in the module chandra.py the command line
import pyfits
with
from astropy.io import fits as pyfits
because I got errors with pyfits
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.