Different lenghs of theta parameter from sep.extract. #119
-
|
Hello guys, What I have noticed, is that the length of these parameters varies a lot. I have a testing set of 1000 galaxies, and half of them returned an error that position 2 does not exist. Without any error. While sextractor was able to extract THETA_IMAGE from all of them. The lines that are being executed: Is there is a way to debug why SEP can't return theta[2] with some images? Couple of problematic images: https://drive.google.com/file/d/1T3u6ZygScPHSCyUp2TLHJtsVklOH4J-0/view?usp=sharing |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
|
If When you say that the length of the parameters varies a lot, do you mean |
Beta Was this translation helpful? Give feedback.
-
Almost. They're off by 1. From the docs for
|
Beta Was this translation helpful? Give feedback.
-
I see. So the problem is that ideally mask = (objs["x"] > xmin) & (objs["x"] < xmax) & (objs["y"] > ymin) & (objs["y"] < ymax)
objects_in_box = objs[mask]
object_of_interest = objects_in_box[0] # hopefully exactly one galaxy is in the (xmin, xmax), (ymin,ymax) box |
Beta Was this translation helpful? Give feedback.
I see. So the problem is that ideally
sep.extractwould return exactly one object (len(objs) == 1). However, you may have other detections in the image due to noise, or other galaxies you wish to ignore. If you know where on the image the object of interest is, I'd recommend selecting it from the array of objects based on position, like