taskGNU Astronomy Utilities - Tasks: task #15762, Optional contour functionality to...


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

task #15762: Optional contour functionality to EPS/PDF output

Submitter:  Mohammad Akhlaghi <makhlaghi>
Submitted:  Tue 25 Aug 2020 02:50:43 PM UTC
Should Start On:  Mon 24 Aug 2020 11:00:00 PM UTC Should be Finished on:  Mon 24 Aug 2020 11:00:00 PM UTC
Category:  ConvertType Priority:  5 - Normal
Item Group:  Enhancement Status:  None
Privacy:  Public Percent Complete:  0%
Assigned to:  None Open/Closed:  Open
Effort:  0.00

Tue 25 Aug 2020 02:53:21 PM UTC, comment #1: 

The same size criteria can be removed if both images have WCS (we can internally convert the pixel positions from one image to another).

Mohammad Akhlaghi <makhlaghi>
Project Administrator
Tue 25 Aug 2020 02:50:43 PM UTC, original submission:  

When dealing with various science cases, contours are an important visualization tool that are useful in many context.

To generate PDF outputs, ConvertType uses PostScript (which is then compiled into PDF). And in PostScript, it is very easy to draw lines, for example see this tutorial (also in the full PostScript reference).

The points/pixel along each contour line are also very easy to derive (a simple erosion on a given threshold will find the pixels of the edges: those that have been eroded)!

So if we just convert the pixel coordinates into the PostScript coordinates, we can easily draw contours over the PDF output of ConvertType. The user can either specify the number of contours in the full range of the input, or give specific values. The interface would be something like this (also possible on a multi-color-channel image):

# Draw five contours over the image A.
astconvertt A.fits --contourfile=A.fits --contournumber=5

# Put 3 contours at levels X, Y and Z, defined over the 'G.fits'
# image, but drawn over an RGB/color image.
astconvertt R.fits G.fits B.fits --contourfile=G.fits --contourlevels=X,Y,Z

The contours can also be drawn from a different image, for example the command below can generate contours from

# Define contours on B.fits, but draw them on A.fits
astconvertt A.fits --contourfile=B.fits --contourlevels=X,Y,Z

The only limitation is that all three images have to have the same height/width.

This task was suggested after a discussion with Peter MacGregor, thanks Pete ;-).

Mohammad Akhlaghi <makhlaghi>
Project Administrator


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

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


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

    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.




    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-08-25 makhlaghi Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.9