-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2397 from cta-observatory/fix_pix_index
Use intmin for invalid pixel positions, allow empty arguments
- Loading branch information
Showing
3 changed files
with
25 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
``CameraGeometry.position_to_pix_index`` will now return the minimum integer value for invalid | ||
pixel coordinates instead of -1 due to the danger of using -1 as an index in python accessing | ||
the last element of a data array for invalid pixels. | ||
The function will now also no longer raise an error if the arguments are empty arrays and instead | ||
just return an empty index array. | ||
The function will also no longer log a warning in case of coordinates that do not match a camera pixel. | ||
The function is very low-level and if not finding a pixel at the tested position warrants a warning or | ||
is expected will depend on the calling code. |