-
-
Notifications
You must be signed in to change notification settings - Fork 134
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
Add an implementation of daophot GROUP functionality #369
Conversation
def _find_group(star, starlist, crit_separation): | ||
""" | ||
Find those stars in `starlist` which are at a distance of | ||
`crit_separation` from `star`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be double back ticks as sphinx tries to linkify the singe ones and will fail with these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh, never mind this wont fail the test but only because it's a private function (thus left out of the docs).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
less than crite_separation ...
__all__ = ['DAOGroup'] | ||
|
||
|
||
class GroupStarsBase(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to add it to the public classes to __all__
to get rid of the sphinx warnings. (It is the base group for DAOGroup, thus the docs generation for the DAOGroup API tries to make a link to it, but since it's not public cannot find it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bsipocz Thanks Brigitta, I'll do that =)
@@ -52,6 +52,8 @@ User Documentation | |||
|
|||
photutils/background.rst | |||
photutils/detection.rst | |||
photutils/grouping.rst | |||
photutils/grouping_files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you don't need to list the directory here
@mirca - matplotlib has a sphinx directive for plotting, and other parts of the documentation are using it. Remind me please if there is a reason for using png files for the plots rather than plotting them on the fly? |
@bsipocz I realized that I could just convert an IPython notebook to rst. Would you prefer that I use the plot directive instead? |
Yes please, it will be more consistent with the rest of the package and also avoid storing image files in the repo (though we will have to do that anyway once we set up pytest-mpl testing). |
Failures seems to be unrelated. |
There was an issue with the |
Classic problem in python: While array indices start at 0, when people talk to each other you would say "group 1, group 2, ...". |
@mirca - This needs rebasing. |
@eteq @bsipocz @hamogu @larrybradley Please, consider merging this if you are happy :) |
@mirca - It seems that you've pushed the last commit to the wrong branch ;) |
@bsipocz I actually forgot to commit the changes in the main file, haha, thanks! xD |
|
||
|
||
@six.add_metaclass(abc.ABCMeta) | ||
class GroupStarsBase(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class and the group_stars
method needs to have a docstring that lays out explicitly what the interface is (i.e., what must starlist
be, and what must the method return). That way a user can implement their own grouping method if they don't like one of the options here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, and it should be very clear whether or not __call__
needs to be implemented. I see below that DAOGroup
uses __call__
instead of group_stars
.
My suggestion would be for this class (GroupStarsBase
) to implement just this:
def __call__(self, starlist):
return self.group_stars(starlist)
And then have the subclasses only implement group_stars
. That way the "function"-like capability that @hamogu suggested is preserved, but subclasses have to use the group_stars
method name, which is much more readable.
EDIT: (I see this is already what's in DAOGroup
, but I'm just suggesting the __call__
method be moved to GroupStarsBase
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eteq I think I addressed your points. Did I get them right?
@mirca - OK, I reviewed this and it looks great. I left a few comments above, only one of which is really significant (about making the interface in |
@bsipocz Do you think long URL is a fair enough reason to break pep8? ;) |
Sure, there are plenty of examples for that ;) |
Hi all,
this PR is part of a work in progress in order to implement a procedure for doing point spread function photometry in crowded fields.
A possible block-diagram of such procedure is shown here:
crit_separation
.photutils
asdaofind
.cc @eteq @hamogu @bsipocz