Skip to content

Commit 08ee7fa

Browse files
committed
Fixed off-by-one in detid2xy
1 parent e730566 commit 08ee7fa

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
setup(
3737
name='swiftbat',
38-
version='0.1.2a1',
38+
version='0.1.2a3',
3939
packages=['swiftbat'],
4040
package_data={'':['catalog', 'recent_bcttb.fits.gz']},
4141
url='https://github.com/lanl/swiftbat_python/',

swiftbat/swinfo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,8 @@ def detid2xy(detids):
416416
# and blocks 8-15 are rotated 180 degrees
417417
bit15, bit14_11 = np.divmod(block, np.int16(8))
418418
# 8-15 0-7
419-
y = np.where(bit15, np.int16(85) - jblock, np.int16(88) + jblock)
420-
x = np.where(bit15, np.int16(34) - iblock, iblock) + np.int16(36) * bit14_11
419+
y = np.where(bit15, np.int16(85) - jblock - 1, np.int16(88) + jblock)
420+
x = np.where(bit15, np.int16(34) - iblock - 1, iblock) + np.int16(36) * bit14_11
421421
if scalar:
422422
x = np.int16(x)
423423
y = np.int16(y)

0 commit comments

Comments
 (0)