bugGNU Astronomy Utilities - Bugs: bug #59324, Erroneous values of rotation and...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #59324: Erroneous values of rotation and scaling for some quads

Submitter:  Sachin Kumar Singh <sks_15>
Submitted:  Fri 23 Oct 2020 11:26:10 AM UTC
   
 
Category:  Development Severity:  3 - Normal
Item Group:  Output not reasonable Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Jump to the original submission

Mon 23 Aug 2021 12:51:07 AM UTC, comment #6: 

This was solved in this commit.

Natáli Anzanello <ndanzanello>
Sun 25 Oct 2020 09:44:28 PM UTC, comment #5: 

Nice analysis! That does make it clear.

Can you add a check to identify when a situation like the D and D' of the figure happens? Based on the inputs, and apply a correction when necessary?

For example, we know that scaling can never be negative. But rotation can. You may be able to use this un-symmetry, for the fix ;-).

Mohammad Akhlaghi <makhlaghi>
Group administrator
Sun 25 Oct 2020 12:00:16 PM UTC, comment #4: 

task #15636 is already present for distortions. task #15798 is created for making quads from multiple catalogs.

For the results with reverse signs, I think I have an idea as to why they are opposite. As we are calculating roatations w.r.t origin, it might be that some vertices are matched in an opposite way than the rest of the vertices.
For ex, in the given figure, D and D' are matched in a counter-clockwise direction while the other 2 corresponding vertices are matched in clockwise directions.

Now scale depends on X and cos(theta). As cos theta is an even function, it won't change the sign and also the denominator of X is positive. Hence only numerator of X which has x, y, ra, and dec can change the sign which is what I think happens due to their corresponding positions.


Sachin Kumar Singh <sks_15>
Sat 24 Oct 2020 11:03:35 PM UTC, comment #3: 

Great! Thanks for the wonderful description in the comment Sachin ;-). The results also look very promising (except for the signs).

The fact that some scale factors have become negative is very strange. There must be a small mistake somewhere.

Infact, this observation pointed me to something interesting: the signs of the scaling factor and theta are the same: anywhere that the scaling is negative, theta is also negative.

I'd love to look closely into the code and try it, but since your mind is already fresh on it, I am sure you'll find it sooner ;-).

Other than the negative values, I don't see any major outliers and probably a sigma-clipped median can be used to find the over-all rotation and scaling.

Once these are found, the only other element that we need to construct the WCS is to choose a reference point and save its pixel coordinates (CRPIX1 and CRPIX2) and ra/dec coordinates (CRVAL1 and CRVAL2) coordinates. The only thing is that we want this point to have no distortion (for now: close to the center of the image).

The first round of the job will then be complete. But we still have some important problems to fix: 1) a robust way to build the same quads from multiple catalogs and 2) account for distortion. Can you define two tasks for these (if they aren't already)?

For the distortion, once we have the reference point, we move all the (x/y)s and (ra/dec)s to be centered around that. Then see how much their RA/Dec differs from a raw rotation/scaling.

Mohammad Akhlaghi <makhlaghi>
Group administrator
Sat 24 Oct 2020 05:17:12 PM UTC, comment #2: 

The calculation of theta and scale value is added and can be found in this commit.

The output is as shown below

        theta=-1.52537, scale=-1264.99
        theta=1.53104, scale=1252.12
        theta=-1.53929, scale=-1268.35
        ===============================
        theta=-1.52537, scale=-1264.99
        theta=1.53104, scale=1252.12
        theta=-1.54225, scale=-1267.78
        ===============================
        theta=-1.52537, scale=-1264.99
        theta=1.53104, scale=1252.12
        theta=-1.49836, scale=-1239.92
        ===============================
        theta=-1.52537, scale=-1264.99
        theta=1.53104, scale=1252.12
        theta=-1.54144, scale=-1267.4
        ===============================
        theta=-1.54927, scale=-1267.97
        theta=-1.54759, scale=-1267.98
        theta=-1.53598, scale=-1264.07
        ===============================
        theta=-1.53591, scale=-1266.92
        theta=-1.52105, scale=-1258.33
        theta=-1.53271, scale=-1265.06
        ===============================
        theta=-1.53591, scale=-1266.92
        theta=-1.52105, scale=-1258.33
        theta=-1.51485, scale=-1253.24
        ===============================
        theta=-1.53591, scale=-1266.92
        theta=-1.52105, scale=-1258.33
        theta=-1.55731, scale=-1269.17
        ===============================
        theta=-1.53591, scale=-1266.92
        theta=-1.52105, scale=-1258.33
        theta=-1.55451, scale=-1268.47
        ===============================
        theta=-1.53591, scale=-1266.92
        theta=-1.52105, scale=-1258.33
        theta=-1.5483, scale=-1267.51
        ===============================
        theta=-1.55175, scale=-1273.39
        theta=-1.55325, scale=-1269.28
        theta=-1.55473, scale=-1271.6
        ===============================
        theta=-1.55175, scale=-1273.39
        theta=-1.53732, scale=-1266.36
        theta=-1.55473, scale=-1271.6
        ===============================
        theta=-1.56394, scale=-1272.94
        theta=-1.52942, scale=-1262.56
        theta=1.5668, scale=1270.71


As seen, many quads have the correct and approximately equal values which can be used by averaging out. But some values are just the opposite sign from the rest of the values.

The three values are produced because we subtract the first coordinate of the quad from all the values and essentially bring it to origin, from where the calculations are easy. Then we compare each corresponding coordinate of query and reference and hence have three values.

Sachin Kumar Singh <sks_15>
Fri 23 Oct 2020 11:58:26 AM UTC, comment #1: 

Thanks a lot Sachin, its good progress :-).

Can you add a descriptive (and human-friendly!) comment on the logic of finding 'theta' and 's'? Something like this comment in the Warp program:

http://git.savannah.gnu.org/cgit/gnuastro.git/tree/bin/warp/ui.c#n494

Can you also show the output values?

If most of them are fine with only a few outliers, we can use sigma-clipping for example and reject them. Generally, in the last stages, the job becomes statistical, so its fine to have scatter and outliers ;-).

Mohammad Akhlaghi <makhlaghi>
Group administrator
Fri 23 Oct 2020 11:26:10 AM UTC, original submission:  

After finally matching the query-quads with the reference-quads and
calculating the value of fo rotation and scaling between them, most of the values for the quads are fine and approximate and can finally be used to make the CD matrix.

But some values are still erronous and have an opposite sign than other values for the same quad. See this commit for changes.

Sachin Kumar Singh <sks_15>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #50095:  Untitled@drawing.jpg added by sks_15 (22KiB - image/jpeg)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ndanzanello (Posted a comment)
  • -email is unavailable- added by makhlaghi (Posted a comment)
  • -email is unavailable- added by sks_15 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-08-23 ndanzanello StatusWorks For Me Fixed
        Open/ClosedOpen Closed
    2021-08-23 ndanzanello StatusIn Progress Works For Me
    2020-10-25 sks_15 Attached File- Added Untitled@drawing.jpg, #50095

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code