Fix vector directions when overlaid on image#2276
Fix vector directions when overlaid on image#2276Carifio24 wants to merge 1 commit intoglue-viz:mainfrom
Conversation
…ve axis orientations and adjust accordingly.
Codecov Report
@@ Coverage Diff @@
## main #2276 +/- ##
==========================================
- Coverage 88.07% 88.04% -0.03%
==========================================
Files 247 247
Lines 23279 23302 +23
==========================================
+ Hits 20502 20517 +15
- Misses 2777 2785 +8
Continue to review full report at Codecov.
|
astrofrog
left a comment
There was a problem hiding this comment.
I'm not sure if using CDELT is sufficient, as there might be cases where an image is rotated using CROTA2 or a CD matrix, so then I'm not sure if the logic here still holds.
I'm trying to wrap my head around the use case here - what kind of table columns are you using to define the vector? Are they pixel or world coordinates?
|
This PR definitely fell off of my radar. @astrofrog I had used the As far as defining the vectors, it looks like numerical components are what are allowed for the vector attributes of a scatter layer. |
When a scatter layer is overlaid on an image, vectors will have the wrong orientation if one (or both) of the axes have different pixel and world coordinate orientations. To fix this issue, this PR looks at the signs of the relevant entry of the cdelt coordinate increments. If they're opposite, it negates the corresponding vector components. The relation between x/y attributes and the wcs coordinate indices is the same one used here.
I would be curious to know if @astrofrog or @catherinezucker (or anyone who's knowledgeable about WCS) has any additional thoughts/suggestions.