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

Position initialization on brightest central object? #20

Closed
aagnello opened this issue Apr 17, 2014 · 2 comments
Closed

Position initialization on brightest central object? #20

aagnello opened this issue Apr 17, 2014 · 2 comments

Comments

@aagnello
Copy link
Collaborator

Some cutouts may be offset... so that choosing the central pixel of image 1 may not be a good starting point for all other images. First: check how centroid initislisation is currently done, and then maybe switch to a flux-weighted centroiding. Don't forget, tractor objects have positions in world coordinates...

@aagnello aagnello added this to the submit paper1 to journal and arXiv milestone Apr 17, 2014
@aagnello aagnello self-assigned this Apr 17, 2014
@aagnello
Copy link
Collaborator Author

PSEUDOcode for recentering. Not pythonic syntax all the way through,
e.g. in the SUM commands, which must be replaced with their python
counterparts. Should be refactored in separate module/class/method...
to be used in the three initialisations.
NB: At the moment the center coordinates are the same for
all cards. While ok (and more convenient than starting blindly at
NX/2, NY/2), different cards may be offcentered in different manners.
Task for future(!) refurbishing: allow for different centroids in
different cards, but with same gal-img displacements.
Here it is:

sci = images[0].data
magicrec = 20
magicwx = int(NX/2)
magicwy = int(NY/2)
#first initialise xc,yc to either x,y or xs,ys! then:
irec = 1
while (irec<magicrec):
tfl =
SUM[sci[ix,iy]_BOOLE[abs(ix-xc)<magicwx]_BOOLE[abs(iy-yc)<magicy],{ix,1,NX},{iy,1,NY}]
xrec =
SUM[ix_sci[ix,iy]_BOOLE[abs(ix-xc)<magicwx]_BOOLE[abs(iy-yc)<magicy],{ix,1,NX},{iy,1,NY}]/tfl
yrec =
SUM[iy_sci[ix,iy]_BOOLE[abs(ix-xc)<magicwx]_BOOLE[abs(iy-yc)<magicy],{ix,1,NX},{iy,1,NY}]/tfl
xc = int(xrec)
yc = int(yrec)
irec++

#possibly apply the small displacemnts to initialise pt.sources, then:
centerpos = wcs.pixelToPosition(xc,yc)

@drphilmarshall
Copy link
Collaborator

OK, flux-weighted centroids are computed in lenstractor.Deal (dm.py) and returned; the mean ra and dec are then used as the initial Nebula galaxy position.

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

No branches or pull requests

2 participants