ejeschke / ginga

The Ginga astronomical FITS file viewer
BSD 3-Clause "New" or "Revised" License
121 stars 77 forks source link

Working with skewed axes in Ginga #975

Closed obi-wan76 closed 2 years ago

obi-wan76 commented 2 years ago

Hi I am getting the following error when trying to build a Mosaic with Ginga. So, it seems that Ginga can only handle offset, scale, rotation, but not skew. Is this correct? Thank!

ValueError Skew detected: xrot=68.8412 yrot=68.6491 File "/anaconda3/lib/python3.8/site-packages/ginga-3.1.1-py3.8.egg/ginga/rv/Control.py", line 427, in error_wrap return method(*args, **kwargs)

File "/anaconda3/lib/python3.8/site-packages/ginga-3.1.1-py3.8.egg/ginga/rv/plugins/Mosaic.py", line 553, in mosaic self.prepare_mosaic(image, fov_deg, name=name)

File "/anaconda3/lib/python3.8/site-packages/ginga-3.1.1-py3.8.egg/ginga/rv/plugins/Mosaic.py", line 263, in prepare_mosaic (rot_deg, cdelt1, cdelt2) = wcs.get_rotation_and_scale(

File "/anaconda3/lib/python3.8/site-packages/ginga-3.1.1-py3.8.egg/ginga/util/wcs.py", line 310, in get_rotation_and_scale raise ValueError("Skew detected: xrot=%.4f yrot=%.4f" % (

ejeschke commented 2 years ago

@obi-wan76, with the current (fast) mosaicer that is correct. However, the amount of skew allowed can be adjusted, based on the skew_threshold value passed to get_rotation_and_scale().

Based on the error message shown above, the skew threshold should be greater than abs(xrot - yrot) or abs(68.8412 - 68.6491) == 0.1921

Can you copy the file .../ginga/examples/configs/plugin_Mosaic.cfg to your $HOME/.ginga folder. Edit the file and change the value of skew_limit to 0.2. Then try to build your mosaic again. Let me know how it goes!

ejeschke commented 2 years ago

Here is the file, if you are looking for it.

obi-wan76 commented 2 years ago

@ejeschke Thanks for your fast reply! I'll give it a try and let you know. Thanks again!

obi-wan76 commented 2 years ago

@ejeschke yes, it worked. Thanks for your help

ejeschke commented 2 years ago

Great, hope that's acceptable!