Skip to content

Commit 5b71787

Browse files
author
David Turner
committed
Fixing issue #1353 unveiled another related issue - in the case where there are no supplied regions but there are custom regions the WCS required for checking if a coordinate is contained within a region won't be read out. EVEN THOUGH I REQUIRE CUSTOM REGIONS TO BE IN RA-DEC SYSTEM THE REGIONS MODULE STILL WANTS A WCS (or did when I wrote this code) - really need to get around that its super annoying.
1 parent def32a9 commit 5b71787

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

xga/sources/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# This code is a part of X-ray: Generate and Analyse (XGA), a module designed for the XMM Cluster Survey (XCS).
2-
# Last modified by David J Turner (turne540@msu.edu) 06/06/2025, 10:55. Copyright (c) The Contributors
2+
# Last modified by David J Turner (turne540@msu.edu) 06/06/2025, 11:09. Copyright (c) The Contributors
33

44
import os
55
import pickle
@@ -1509,7 +1509,7 @@ def dist_from_source(reg):
15091509
# WCS transform from ANY of the images to convert pixels to degrees
15101510

15111511
for obs_id in reg_paths:
1512-
if reg_paths[obs_id] is not None:
1512+
if reg_paths[obs_id] is not None or len(custom_regs) != 0:
15131513
# With the newer versions of regions we're now using, there is an explicit check for width and height
15141514
# of regions being positive (definitely a good idea) - finding such a region in a file will trigger
15151515
# a ValueError, and I'd like to catch it and add more context

0 commit comments

Comments
 (0)