taskGNU Astronomy Utilities - Tasks: task #14409, Polygon vertices from a DS9 region...

 
 

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

task #14409: Polygon vertices from a DS9 region file

Submitted by:  Mohammad Akhlaghi <makhlaghi>
Submitted on:  Thu 16 Mar 2017 10:50:31 PM UTC  
 
Should Start On: Thu 16 Mar 2017 03:00:00 PM UTCShould be Finished on: Thu 16 Mar 2017 03:00:00 PM UTC
Category: CropPriority: 5 - Normal
Item Group: EnhancementStatus: Postponed
Privacy: PublicPercent Complete: 0%
Assigned to: NoneOpen/Closed: Open
Effort: 0.00

Thu 16 Mar 2017 10:50:31 PM UTC, original submission:

Allow users to use a file for polygon vertices instead of having to type all the coordinates in by hand. Typing coordinates (especially for larger number of vertices) can be prone to errors and is frustrating.

However, in GUI tools like SAO DS9, we can easily define a polygon region on the image and save the vertices into a file with specific formats. So when the input is a file name (not a string of numbers), Crop can parse the output of DS9 directly and users don't have to deal with the actual numbers. This will greatly speed up the process and reduces chances of error.

Until then, a script like this can be used to read the DS9 region file (saved in the `ds9' format in `fk5', see P.S. below) and prepare it for Crop (new name for ImageCrop) as a shell variable):

This task was suggested by Guillaume Mahler.

---
P.S.

To define a region file in SAO DS9, you can take the following steps: Open the image with DS9 and activate its "Region" mode with "Edit --> click --> Region". Then define the region to be a polygon with "Region --> Shape --> Polygon". Click on the approximate center of the region you want and a small square will appear. By clicking on the vertices of the square you can shrink or expand it, clicking and dragging anywhere on the edges will enable you to define a new vertice.

After the region has been nicely defined, save it as a file with "Region --> Save" Regions. You can then select the name and address of the output file, keep the format as "REG" and press "OK". In the next window, keep format as "ds9" and "Coordinate System" as "fk5". A plain text file (let's call it `ds9.reg') is now created that you can feed into the script above.

Mohammad Akhlaghi <makhlaghi>
Project Administrator

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by makhlaghi (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup1