Skip to content

Bug fixes, enhancements in 'write', rot axis selection - #29

Closed
mcara wants to merge 2 commits into
astropy:masterfrom
mcara:fixes-write-rot2
Closed

mcara wants to merge 2 commits into
astropy:masterfrom
mcara:fixes-write-rot2

Conversation

@mcara

@mcara mcara commented Apr 9, 2014

Copy link
Copy Markdown
Contributor
  1. 'pyregion.write' crashes when saving regions without comments [bug fix];
  2. 'pyregion.write' converts exclude ("-") DS9 regions to regular ("+") region when saving region files [bug fix];
  3. 'pyregion.write' cannot save region files that contain regions with mixed Coordinate Systems (e.g., image, sky, etc.) [enhancement];
  4. 'pyregion' computes the image rotation angle using as the angle between North and X-axis instead of typically adopted convention of using Y-axis (at least for HST images) for image orientation computations. This produces regions that are rotated compared to the regions produced by DS9 when image axes are non-orthogonal. This was fixed by introducing additional parameter 'rot_wrt_axis' (can be 1 or 2) to let users select what axis should be used for computing image rotations (-> rotations of regions). For example, by setting rot_wrt_axis=2 pyregion now will use 'rot2' (angle between Y-axis and North) instead of 'rot1' (in wcs_converter.py) in computing region rotations. [enhancement]
  5. Fixed a bug in 'get_mask' function where a header was passed to 'as_region_filter' as 'origin' argument [bug fix].

1. 'pyregion.write' crashes when saving regions without comments [bug
fix];

2. 'pyregion.write' converts exclude ("-") DS9 regions to regular ("+")
region when saving region files [bug fix];

3. 'pyregion.write' cannot save region files that contain regions with
mixed CS [enhancement];

4. 'pyregion' computes the rotation angle using X-axis instead of
adopted convention of using Y-axis (at least for HST images). This
produces regions that are rotated compared to the regions produced by
DS9. This was fixed by introducing additional parameter 'rot_wrt_axis'
(can be 1 or 2) to let users select what axis should be used for
computing rotations of regions. For example, by setting rot_wrt_axis=2
pyregion now will use 'rot2' (angle between Y-axis and North) instead
of 'rot1' (in wcs_converter.py) in computing region rotations.
[enhancement]

5. Fixed a bug in 'get_mask' function where a header was passed to
'as_region_filter' as 'origin' [bug fix].
@mcara mcara changed the title Bug fixes and enhancements in 'write',rot_wrt_axis Bug fixes, enhance in 'write',rot axis selection Apr 9, 2014
@mcara mcara changed the title Bug fixes, enhance in 'write',rot axis selection Bug fixes, enhancements in 'write', rot axis selection Apr 9, 2014
@mcara

mcara commented Apr 9, 2014

Copy link
Copy Markdown
Contributor Author

Maybe, for point # 4 above, the axis with regard to which the angle to the North is measured can be hardcoded to be axis 2 (Y-axis) as, I think most use angle between Y-axis and North to compute image orientation. For images with orthogonal axes either axis will lead to identical results. However, for images with skewed axes (e.g., HST ACS/WFC) Y-axis should be used.

@leejjoon

Copy link
Copy Markdown
Contributor

I apologize for my long silence.

The changes seems all good. Thank you very much.
On the other hand, can you split this PR into 3 separate ones? e.g., one for pyregion.write, another for rot_wrt_axis, and yet another for get_mask.

@mcara

mcara commented May 16, 2014

Copy link
Copy Markdown
Contributor Author

Thank you very much for considering my proposed modifications!

I will try to split this PR into 3PRs this weekend or earlier next week.

@mcara

mcara commented May 20, 2014

Copy link
Copy Markdown
Contributor Author

Cc: @leejjoon

As requested, I have split this PR into three separate PRs dealing with each issue independently: #32, #33, #34.

@mcara

mcara commented Aug 25, 2014

Copy link
Copy Markdown
Contributor Author

All the proposed changes have been merged through separate PRs: #32, #33, and #34. I am closing this PR.

@mcara mcara closed this Aug 25, 2014
@mcara mcara mentioned this pull request Aug 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants