GPLOT recipes: Plotting profiles in GPLOT (I)

(profile from 3d-set))



The plot shows a panel with three profiles that are exactly the same but are extracted from a set in three different ways.

GPLOT macro:

Each part of the macro shows a different way how to combine commands inset and profile to select profile data from GIPSY sets. The bottom axes in the plots are labeled with physical coordinates. Whatever the dimension of the input set is, there will be always at most one profile axis. This axis is plotted with a command that accepts the same parameters as axis but is called profaxis. So after using profile, you plot this axis at the bottom of the plot with command profaxis bp. This is not the only, but always the easiest way because command profile not only explores the image data, but also determines which set axis is a profile axis. If it cannot find such an axis (e.g. profile taken with an angle <> 0 with respect to all axes in a subset), it will label the profile axis with index numbers 0 .. n-1, where n is the number of sample points in the profile.
The difference between the three ways of input is the structure of the subsets that are defined. This affects the way that you can use the profint keyword to integrate in the direction of the subset axes. Note that using commands profile and profint without parameters, result in a keyword prompt which will show you how to enter parameters (depending on how the set was specified). DATA IS ONLY READ AFTER COMMAND profdata. An interactive way of generating profiles can be started with command pplot.
! Example of profile extracted from the 3-dim set 'n3198h'
! The set has axes RA,Dec,Freq
!
! =============== First plot =================
colour foreground            ! Set colour to foreground colour
font roman                   ! Roman font
symbol 21                    ! Small circle to mark profile points
location 30 180              ! Start position upper plot
charheight 4.0               ! Set character height to 4 mm
inset n3198h freq            ! Select Freq. axis as profile axis
profile 0 0                  ! Select profile in freq at RA 0, Dec 0
profdata                     ! Store extracted data in xcolumn, ycolumn
xrange xcolumn               ! Range of x values set to min/max of coordinate data
yrange ycolumn               ! Range of y values set to min/max of image data 
xmargin 2                    ! Space in mm between data and axes
ymargin 2
xsize 120                    ! Horizontal size in mm
ysize 50
profaxis bp                  ! Draw the profile axis at the bottom
axtitle                      ! Default title
axis lw                      ! Left axis shows labels with image values
axtitle W.U.                 ! Title for this axis
axis t 
axis r
points                       ! Mark profile points
colour green                 
connect                      ! Connect the points
!
!=============== Second plot =================
!
colour foreground
location 30 110
inset n3198h RA 0 Dec 0
profile 2 116                ! Select profile from freq 2 to 116
profdata
xrange xcolumn
yrange ycolumn
xmargin 2
ymargin 2
xsize 120
ysize 50
profaxis bp                  ! draw the profile axis at the bottom
axtitle
axis lw
axtitle W.U.
axis t
axis r
points
colour cyan
connect
!
!================ Third plot =================
!
colour foreground
location 30 40
inset n3198h 
profile 0 0 2 0 0 116         ! Select profile from freq 2 to 116 at 
                              ! RA=0, Dec=0
profdata
xrange xcolumn
yrange ycolumn
xmargin 2
ymargin 2
xsize 120
ysize 50
profaxis bp                   ! draw the profile axis at the bottom
axtitle
axis lw
axtitle W.U.
axis t
axis r
points
colour yellow
connect
!=============== Annotations ==================
mmeter                        ! Switch to mm mode
charheight 4
font italic                   ! Italic font
colour foreground
move 35 225
text inset n3198h freq
move 35 225-5
text profile 0 0
move 35 225-10
text (profile in Freq at RA 0, Dec 0)
move 35 225-15
text Integration possible in RA and Dec
move 35 155
text inset n3198h RA 0 Dec 0
move 35 155-5
text profile 2 116
move 35 155-10
text (profile from Freq 2 to Freq 116) 
move 35 155-15
text Integration possible in Freq.
move 35 85
text inset n3198h
move 35 85-5
text profile 0 0 2 0 0 116 
move 35 85-10
text (profile from RA,Dec,Freq = 0 0 2 
move 35 85-15
text @@@@@@@@@to   RA,Dec,Freq = 0 0 116)        ! '@' == Leading space
move 35 85-20
text Integration possible in RA, Dec and Freq.
world

GIPSY