<div dir="ltr">Thanks Rob,<div><br></div><div>Probably right, but easy to verify since you already have a working solution. Also, for another check, the parity is in the wcs.fits file that one can download from the online <a href="http://astrometry.net">astrometry.net</a>.</div><div><br></div><div>I am concerned that ASTAP didn't solve my positive parity image (which as I mentioned was the exact-same-but-mirrored image it solved as negative parity), but I assume/hope that it is a user-issue (e.g. some command line flag or the like is off). I don't have Han's email, and don't know if he reads this mailing list. Could you please forward these questions to him?</div><div><br></div><div>Thanks,</div><div>Hy</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 6, 2021 at 7:30 PM Robert Lancaster <<a href="mailto:rlancaste@gmail.com">rlancaste@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">Sorry one correction to my last email.<div><br></div><div>I just checked the internal stellarsolver parity code, there is this comment:</div><div><br></div><div>
<pre style="margin-top:0px;margin-bottom:0px"><span style="font-style:italic;color:rgb(198,193,170)">//</span><span style="color:rgb(79,79,79)"> </span><span style="font-style:italic;color:rgb(198,193,170)">Note,</span><span style="color:rgb(79,79,79)"> </span><span style="font-style:italic;color:rgb(198,193,170)">negative</span><span style="color:rgb(79,79,79)"> </span><span style="font-style:italic;color:rgb(198,193,170)">determinant</span><span style="color:rgb(79,79,79)"> </span><span style="font-style:italic;color:rgb(198,193,170)">=</span><span style="color:rgb(79,79,79)"> </span><span style="font-style:italic;color:rgb(198,193,170)">positive</span><span style="color:rgb(79,79,79)"> </span><span style="font-style:italic;color:rgb(198,193,170)">parity.</span></pre><div><br></div><div>So that means if this </div><div><br></div><div><blockquote type="cite"><div style="overflow-wrap: break-word;"><div><span style="box-sizing:border-box;color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;white-space:pre-wrap">cd11</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;white-space:pre-wrap;background-color:rgb(255,255,255)"> </span><span style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;white-space:pre-wrap">*</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;white-space:pre-wrap;background-color:rgb(255,255,255)"> </span><span style="box-sizing:border-box;color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;white-space:pre-wrap">cd22</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;white-space:pre-wrap;background-color:rgb(255,255,255)"> </span><span style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;white-space:pre-wrap">-</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;white-space:pre-wrap;background-color:rgb(255,255,255)"> </span><span style="box-sizing:border-box;color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;white-space:pre-wrap">cd12</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;white-space:pre-wrap;background-color:rgb(255,255,255)"> </span><span style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;white-space:pre-wrap">*</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;white-space:pre-wrap;background-color:rgb(255,255,255)"> </span><span style="box-sizing:border-box;color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;white-space:pre-wrap">cd21</span></div></div></blockquote><br></div><div>Produces a negative number, that is a positive parity and vice versa.</div><div><br></div><div>Sorry for the mistake in this last email.</div><div><br><blockquote type="cite"><div>On Apr 6, 2021, at 10:27 PM, Robert Lancaster <<a href="mailto:rlancaste@gmail.com" target="_blank">rlancaste@gmail.com</a>> wrote:</div><br><div><div style="overflow-wrap: break-word;">Hi Hy,<div><br></div><div>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/" target="_blank">astrometry.net</a> wcs calculations and I think we may be able to calculate the parity from the INI file ASTAP produces.</div><div><br></div><div>If I am reading this correctly, we can do the following:</div><div><br></div><div><span style="box-sizing:border-box;color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;white-space:pre-wrap">cd11</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;white-space:pre-wrap;background-color:rgb(255,255,255)"> </span><span style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;white-space:pre-wrap">*</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;white-space:pre-wrap;background-color:rgb(255,255,255)"> </span><span style="box-sizing:border-box;color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;white-space:pre-wrap">cd22</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;white-space:pre-wrap;background-color:rgb(255,255,255)"> </span><span style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;white-space:pre-wrap">-</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;white-space:pre-wrap;background-color:rgb(255,255,255)"> </span><span style="box-sizing:border-box;color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;white-space:pre-wrap">cd12</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;white-space:pre-wrap;background-color:rgb(255,255,255)"> </span><span style="box-sizing:border-box;font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;white-space:pre-wrap">*</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;white-space:pre-wrap;background-color:rgb(255,255,255)"> </span><span style="box-sizing:border-box;color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,monospace;white-space:pre-wrap">cd21</span></div><div><br></div><div>And if that produces a positive number, it is positive parity, but if it is negative, it is negative parity.</div><div><br></div><div>Please let me know if this sounds correct. I can always add this to StellarSolver if it is correct.</div><div><br></div><div>Source:</div><div><a href="https://github.com/dstndstn/astrometry.net/blob/main/net/wcs.py" target="_blank">https://github.com/dstndstn/astrometry.net/blob/main/net/wcs.py</a></div><div><br></div><div>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><br></div><div>Rob</div><div><br><div><br><blockquote type="cite"><div>On Apr 6, 2021, at 9:33 PM, Hy Murveit <<a href="mailto:murveit@gmail.com" target="_blank">murveit@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><b>Background</b>: <div>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/" target="_blank">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><br></div><div><b>Solution:</b></div><div>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><br></div><div>However...</div><div><br></div><div>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><ul></ul><ul><li>Internal Solver returned (negative) parity</li><li>Local ASTAP <b>did not return any parity</b></li><li>Local Astrometry returned (negative) parity</li><li>Online Astrometry returned (negative) parity.</li></ul><div>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><ul><li>Internal Solver returned (positive) parity</li><li>Local ASTAP <b>failed to solve the image</b>.</li><li>Local Astrometry returned (<b>negative</b>) parity</li><li>Online Astrometry returned (positive) parity.</li></ul></div><div>The bold lines above indicate issues. Basically:</div><div><ul><li>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>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>Rob, Han, any suggestions/comments? Is there a configuration I'm missing?</div><div><br></div><div>Thanks,</div><div>Hy</div><div><br></div><div></div></div></div></div>
</div></blockquote></div><br></div></div></div></blockquote></div><br></div></div></blockquote></div>