Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1488
News FAQ
Search Home


next up previous contents index
Next: coordsys.setreferencelocation - Function Up: coordsys - Tool Previous: coordsys.setprojection - Function


coordsys.setreferencecode - Function



Package general
Module images
Tool coordsys


Set new reference code


Synopsis
setreferencecode(value, type, adjust)


Arguments

value in Reference code
    Allowed: String
type in Which coordinate type ?
    Allowed: String from "direction" or "spectral"
adjust in Adjust reference value ?
    Allowed: Bool
    Default: T


Returns
T or fail



Description

This function (short-hand name src) sets the reference code for the specified coordinate type. Examples of reference codes are B1950 and J2000 for direction coordinates, or LSRK and BARY for spectral coordinates.

You must specify type, selecting from 'direction', or 'spectral' (the first two letters will do). If the Coordinate System does not contain a coordinate of the type you specify, an exception is generated.

Specify the new code with argument value. To see the list of possible codes, use the function referencecode (see example).

If adjust is T, then the reference value is recomputed. This is invariably the correct thing to do. If adjust is F, then the reference code is simply overwritten; do this very carefully.



Example
- cs := coordsys(direction=T)
- list := cs.referencecode('dir', T)      # See possibilities
- list.normal[1:10]
J2000 JMEAN JTRUE APP B1950 BMEAN BTRUE GALACTIC HADEC AZEL 
-
- cs.referencecode('dir')
J2000
- cs.setreferencecode('B1950', 'dir', T)

In this example we first get the list of all possible reference codes for a direction coordinate (and print some of the normal ones). Then we set the actual reference code for the direction coordinate in our Coordinate System.



Example
- cs := coordsys(direction=T)
- list := cs.referencecode('dir', T)      # See possibilities
- list.normal[1:10]
J2000 JMEAN JTRUE APP B1950 BMEAN BTRUE GALACTIC HADEC AZEL 
-
- cs.referencecode('dir')
J2000
- cs.setreferencecode('B1950', 'dir', T)

In this example we first get the list of all possible reference codes for a direction coordinate (and print some of the normal ones). Then we set the actual reference code for the direction coordinate in our Coordinate System.



Example
- im := image('myimage.j2000')                        # Open image
- cs := im.coordsys()			              # Get Coordinate System
- cs.referencecode('dir', F)
J2000
- cs.setreferencecode('B1950', 'dir', T)              # Set new direction system
- im2 := im.regrid(outfile='myimage.b1950', csys=cs)  # Regrid and make new image

In this example we show how to regrid an image from J2000 to B1950. First we recover the Coordinate System into the Coordsys tool called cs. We then set a new direction reference code, making sure we recompute the reference value. Then the new Coordinate System is supplied in the regridding process (done with an Image tool).





next up previous contents index
Next: coordsys.setreferencelocation - Function Up: coordsys - Tool Previous: coordsys.setprojection - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-08-01