<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Hy,<div class=""><br class=""></div><div class="">I didn’t get the parity from ASTAP because I didn’t believe it reported that information. It isn’t in the INI file. However, I just took a look at the <a href="http://astrometry.net" class="">astrometry.net</a> wcs calculations and I think we may be able to calculate the parity from the INI file ASTAP produces.</div><div class=""><br class=""></div><div class="">If I am reading this correctly, we can do the following:</div><div class=""><br class=""></div><div class=""><span class="pl-s1" style="box-sizing: border-box; caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; white-space: pre;">cd11</span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class=""> </span><span class="pl-c1" style="box-sizing: border-box; color: var(--color-prettylights-syntax-constant); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; white-space: pre;">*</span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class=""> </span><span class="pl-s1" style="box-sizing: border-box; caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; white-space: pre;">cd22</span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class=""> </span><span class="pl-c1" style="box-sizing: border-box; color: var(--color-prettylights-syntax-constant); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; white-space: pre;">-</span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class=""> </span><span class="pl-s1" style="box-sizing: border-box; caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; white-space: pre;">cd12</span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class=""> </span><span class="pl-c1" style="box-sizing: border-box; color: var(--color-prettylights-syntax-constant); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; white-space: pre;">*</span><span style="caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; white-space: pre; background-color: rgb(255, 255, 255);" class=""> </span><span class="pl-s1" style="box-sizing: border-box; caret-color: rgb(36, 41, 46); color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace; white-space: pre;">cd21</span></div><div class=""><br class=""></div><div class="">And if that produces a positive number, it is positive parity, but if it is negative, it is negative parity.</div><div class=""><br class=""></div><div class="">Please let me know if this sounds correct. I can always add this to StellarSolver if it is correct.</div><div class=""><br class=""></div><div class="">Source:</div><div class=""><a href="https://github.com/dstndstn/astrometry.net/blob/main/net/wcs.py" class="">https://github.com/dstndstn/astrometry.net/blob/main/net/wcs.py</a></div><div class=""><br class=""></div><div class="">As for the Local solver getting the parity wrong, the code I am using in StellarSolver to read the WCS file is the same code we were using to read the solution files before in KStars. I basically just moved it. It reads the “parity” key-value pair. I can check into this to see if something was missed. In fact, if you think the above calculation would work, I could just do that for the local solver as well.</div><div class=""><br class=""></div><div class="">Rob</div><div class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Apr 6, 2021, at 9:33 PM, Hy Murveit <<a href="mailto:murveit@gmail.com" class="">murveit@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><b class="">Background</b>: <div class="">Jasem and I have been working on an issue related to solving and polar alignment. It turns out that the KStars WCS code has been ignoring what <a href="http://astrometry.net/" class="">astrometry.net</a> calls "parity", and that causes methods like FITSData::wcsToPixel or pixelToWCS to give wrong answers for off-center pixels when the image has positive parity (which tends to happen e.g. for RASA telescopes (reflectors at prime focus). Most setups have negative parity, which is why we haven't seen tons of complaints before.<div class=""><br class=""></div><div class=""><b class="">Solution:</b></div><div class="">There's likely a very simple fix--negating the FITS header keyword CDELT1 when the parity is positive, but we need to know the parity of the solved image. StellarSolver's Solution struct contains a (QString) parity field.</div><div class=""><br class=""></div><div class="">However...</div><div class=""><br class=""></div><div class="">I just checked with a fits image of mine (which is negative parity) and tried the 4 possible StellarSolver solving options (both in KStars and StellarSolverTester) and all methods solved the image, and the parity field was filled as follows:<div class=""><ul class=""></ul><ul class=""><li class="">Internal Solver returned (negative) parity</li><li class="">Local ASTAP <b class="">did not return any parity</b></li><li class="">Local Astrometry returned (negative) parity</li><li class="">Online Astrometry returned (negative) parity.</li></ul><div class="">Then, I flipped that image (using FastRotation-->Horizontal Mirror in PixInsight, saving to a .fits). The image should now solve with the same coordinates but have positive parity. Running the same test I found:</div></div><div class=""><ul class=""><li class="">Internal Solver returned (positive) parity</li><li class="">Local ASTAP <b class="">failed to solve the image</b>.</li><li class="">Local Astrometry returned (<b class="">negative</b>) parity</li><li class="">Online Astrometry returned (positive) parity.</li></ul></div><div class="">The bold lines above indicate issues. Basically:</div><div class=""><ul class=""><li class="">Local ASTAP seems to fail on positive parity images (on an image it quickly solved with the other parity), and does not return parity for the negative parity images it does solve (all via StellarSolver--I didn't try ASTAP natively). Perhaps StellarSolver is setting some wrong command-line flag?</li><li class="">Local Astrometry did not return the right parity for positive parity images. Does it always return negative (all via StellarSolver--I didn't try it natively).</li></ul></div><div class="">Rob, Han, any suggestions/comments? Is there a configuration I'm missing?</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Hy</div><div class=""><br class=""></div><div class=""></div></div></div></div>
</div></blockquote></div><br class=""></div></body></html>