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

DM-10931: Removed print Fix variable name bug and remove print statements in matchPessimisticB. and fixed distances_rad name. #73

Merged
merged 1 commit into from Jun 19, 2017

Conversation

morriscb
Copy link
Contributor

No description provided.

Copy link
Contributor

@r-owen r-owen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One requested doc update (to match a variable rename) and a suggestion to replace the deleted print function calls with log statements.

@@ -273,7 +273,7 @@ def match(self, source_array, n_check, n_match, n_agree,
# Initialize output struct.
output_match_struct = pipeBase.Struct(
match_ids=[],
distances=[],
distances_rad=[],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also update the numpy docs above to match: the output is distances_rad instead of distances

@@ -505,7 +503,6 @@ def _doMatch(self, refCat, sourceCat, wcs, refFluxField, numUsableSources,
dist_cut_arcsec = np.max(
(2 * wcs.pixelScale().asArcseconds(),
clipped_dist_arcsec, maxMatchDistArcSec))
print("Dist cut", dist_cut_arcsec, "arcsec")
Copy link
Contributor

@r-owen r-owen Jun 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you think any of these print statements may be of interest to somebody then I strongly suggest you make these log statements at some suitable verbosity. INFO is usually printed. TRACE is the next step in verbosity (not normally printed), then DEBUG is even more verbose. Here is an example showing TRACE. I provide the data as a separate argument, so the message is only formatted if it is to be printed, though that is a bit silly here because computation of max will likely be more expensive than the formatting:

self.log.trace("max distance = %s arcsec", distances_arcsec.max())

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These where more for me to check what was going on in the unittest when I was trying to update the code. The useful information about matching is already stored in the debug logger.

Updated docstring for match method.
@morriscb morriscb merged commit 6b27dd1 into master Jun 19, 2017
@ktlim ktlim deleted the tickets/DM-10931 branch August 25, 2018 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants