Skyctran – coordinate conversion using IRAF

Skyctran – coordinate conversion using IRAF

This article is a brief introduction to the images.imcoords.skyctran task in IRAF.

Introduction

Skyctran is part of the images.imcoords package in IRAF. It provides facilities for converting astronomical coordinates between several reference systems. It can handle equatorial coordinate systems such as, fk4, fk4 without the E term (noefk4), fk5 and ICRS, ecliptic coordinate system , galactic coordinate system and supergalactic coordinate system. It accepts, and can output, coordinates in various units such as, degrees, hours, radians and hms and dms strings. It can take input from text files, command line and even from images. Here we discuss the basic features of the package. Specifically, we do not consider input from images. These are documented in the IRAF help file for the task and can be invoked using help skyctran from within IRAF.

The following section describes the inmportant opitons for the task. The section Examples, provides a few examples.

Options for skyctran

The most important options for skyctran are discussed below. The quantities in “[ ]” are optional. They have default values which are discussed in the help for skyctran. In the options for coordinate systems, quantites in “<>” are to be replaced with appropriate values.

  • input
    This can be one or more file names, the string “STDIN”, for input from standard input, the string “imcursor”, for input from displayed images or the string “grid”, for a specified grid of coordinates.

    Note that, if input is a file name, then all comment lines, blank lines and lines which cannot be properly parsed, are passed to the output file without modification.

    In the case of input from “STDIN”, the program can be terminated by typing ‘q’ or by sending <EOF> signal.

  • output
    This can be one or more file names or the string “STDOUT”.
  • insystem and outsystem
    Input and output coordinate systems. All systems below assume default values in case of ambiguous input.

    • icrs [<equinox>] [<epoch>]
      International Celestial Reference System coordinates
      . Equinox can be Julian or Besselian. For example J2000.0 and B1980.0. Default value is J2000.0. Epochs can be Julian or Besselian. Default is to use the equinox.
    • equinox [<epoch>]
      FK5, equatorial mean place post-IAU 1976, if equinox is Julian (specified in with a prefix J) or FK4 (equatorial mean place pre-IAU 1976) if Besselian (specified with a prefix B). Epoch is the epoch of the observation, and can be Julian or Besselian, indicated with the prefix J or B, respectively. If not specified, epoch defaults to the equinox. Epoch is interpreted as Julian Date, if the value given has no prefix and is > 3000.0.
    • fk5 [<equinox>] [<epoch>]
      FK5 system. Julian or Besselian. The epoch can be Julian, Besselian or Julian Date.
    • fk4 [<equinox>] [<epoch>]
      Fk4 system. Julian or Besselian.
    • noefk4 [<equinox>] [<epoch>]
      FK4 system without the E-corrections applied. Julian or Besselian. The epoch can be Julian, Besselian or Julian Date.
    • apparent <epoch>
      Equatorial Geocentric Apparent Place post-IAU 1976 and epoch is the epoch of observation. The epoch can be Julian, Besselian or Julian Date.
    • ecliptic <epoch>
      Ecliptic coordinates.
    • galactic <epoch>
      IAU 1958 galactic coordinate system.
    • supergalactic <epoch>
      deVaucouleurs supergalactic coordinate system.
  • transform
    If the value is yes, then in the output destination, the input columns containing the ra/longitude and dec/latitude are replaced with the results. If the value is no, then two additional columns are created in the output file containing the results, along with the input columns.
  • lngcolumn and latcolumn
    Columns in the input file containing longitudes and latitudes, respectively. Default is 1 and 2, respectively.
  • plngcolumn and platcolumn
    Columns in the input file containing the proper motions in ra and dec in units of arcsec/year. Default is 3 and 4, respectively. These are used only for fk4, noefk4, fk5 and icrs.
  • pxcolumn and rvcolumn
    Columns in the input file containing the parallax and radial velocity, in arcsec/year and km/sec respectively. These are used only if proper motions are provided. Default values are 5 and 6, respectively.
  • ilngunits and ilatunits
    Units of the input ra/longitude and dec/latitude.

    Valid units are “hours”, “degrees”, “radians”. Default is “hours” and “degrees” for equatorial coordinate systems and “degrees” and “degrees” for others.

  • olngunits and olatunits
    Units of the output ra/longitude and dec/latitude.
  • ilngformat and ilatformat
    See description for olngformat and olatformat.
  • olngformat and olatformat
    Formats of the input and output coordinates are specified by providing a string of the format “%w.dCn”, where w is the total width, number of characters, of the field, d is the number of decimal places, C is a format code, described below and n is used if C is “r”.

    Values of C for some common formats used to represent ra and dec coordinates are given below.

    s
    a string, with ‘d’, in the format specification, denoting the number of characters.

    f
    a ‘fixed’ format decimal number, with ‘d’ in the format specification, giving the precision.

    e
    a decimal number in exponential format, with ‘d’ in the format specification giving the precision.

    g
    a general format number, with value of ‘d’, in the format specification, giving precision.

    h
    hh:mm:ss.ss format, with the value of ‘d’, in the format specification, giving the number of decimal places in the seconds part.

    The following are examples taken directly from the IRAF help for the images.imcoords.*skyctran* task.

    %s
    format a string using as much space as required

    %-10s
    left justify a string in a field of 10 characters

    %-10.10s
    left justify and truncate a string in a field of 10 characters

    %10s
    right justify a string in a field of 10 characters

    %10.10s
    right justify and truncate a string in a field of 10 characters

    %7.3f
    print a real number right justified in floating point format

    %-7.3f
    same as above but left justified

    %15.7e
    print a real number right justified in exponential format

    %-15.7e
    same as above but left justified

    %12.5g
    print a real number right justified in general format

    %-12.5g
    same as above but left justified

    %h
    format as nn:nn:nn.n

    %15h
    right justify nn:nn:nn.n in field of 15 characters

    %-15h
    left justify nn:nn:nn.n in a field of 15 characters

    %12.2h
    right justify nn:nn:nn.nn

    %-12.2h
    left justify nn:nn:nn.nn

    %H
    divide by 15 and format as nn:nn:nn.n

    %15H
    divide by 15 and right justify nn:nn:nn.n in field of 15 characters

    %-15H
    divide by 15 and left justify nn:nn:nn.n in field of 15 characters

    %12.2H
    divide by 15 and right justify nn:nn:nn.nn

    %-12.2H
    divide by 15 and left justify nn:nn:nn.nn

  • verbose
    Generate verbose output indicating actions performed, if value is yes.

Examples

We use the following data for M13 and M16 obtained from NASA NED , to illustrate the usage of skyctran. All numbers, except those in hms and dms formats are in degrees. B1950 is in FK4 system for the equinox and Besselian epoch 1950.0 and J2000.0 is in FK5 for the equinox and Julian epoch of 2000.0.

Coordinate for M31 from NASA NED:

Equatorial (B1950.0)  10.0003647  40.9952154 00h40m00.087s +40d59m42.78s
Equatorial (J2000.0)  10.6846833  41.2690361 00h42m44.324s +41d16m08.53s
Ecliptic   (B1950.0)  27.1544022  33.3454328
Ecliptic   (J2000.0)  27.8492856  33.3488686
Galactic             121.1743154 -21.5729619
SuperGalactic        336.1933166  12.5521931

Coordinates for M16 from NASA NED:

Equatorial (B1950.0)   273.99167   -13.82833   18h15m58.0s    -13d49m42s
Equatorial (J2000.0)   274.70073   -13.80723   18h18m48.2s    -13d48m26s
Ecliptic   (B1950.0)   273.93050     9.56300
Ecliptic   (J2000.0)   274.62898     9.55656
Galactic                16.95382     0.79258
SuperGalactic          189.10976    59.15645

Lets convert the B1950.0 FK4 equatorial system into FK5 equatorial system for the equinox and epoch of Julian 2000.0.

Start IRAF command line:

$ ecl
 setting terminal type to xgterm...

  NOAO/IRAFNET PC-IRAF Revision 2.14.1 Mon Sep 15 10:12:05 MST 2008
  This is the RELEASED version of IRAF V2.14 supporting PC systems.

Welcome to IRAF.  To list the available commands, type ? or ??.  To get
detailed information about a command, type `help <command>'.  To run  a
command  or  load  a  package,  type  its name.   Type  `bye' to exit a
package, or `logout' to get out  of the CL.    Type `news' to find  out
what is new in the version of the system you are using.

Visit http://iraf.net if you have questions or to report problems.

The following commands or packages are currently defined:

    apropos     images.     noao.       proto.      system.
    dataio.     language.   obsolete.   softools.   tables.
    dbms.       lists.      plot.       stsdas.     utilities.

Load the images.imcoords package:

ecl> images
      imcoords.   imfit.      immatch.    tv.
      imfilter.   imgeom.     imutil.

images> imcoords
      ccfind      ccsetwcs    ccxymatch   mkcwwcs     wcsctran
      ccget       ccstd       imcctran    *skyctran*    wcsedit
      ccmap       cctran      mkcwcs      starfind    wcsreset

Start the skyctran task. We specify “STDIN” as the input source, “STDOUT” as the output destination, fk4 system with B1950.0 equinox and B1950.0 epoch, as the input coordinates and fk5 system with J2000.0 equinox and J2000.0 epoch, as the output coordinates.

imcoords> *skyctran*
The input coordinate files(s) (STDIN):
The output coordinate file(s) (STDOUT):
The input coordinate system (fk4): fk4 B1950.0 B1950.0
The output coordinate system (fk5): fk5 J2000.0 J2000.0

# Insystem: fk4 B1950.0 B1950.0  Coordinates: equatorial FK4
#     Equinox: B1950.000 Epoch: B1950.00000000 MJD: 33281.92346
# Outsystem: fk5 J2000.0 J2000.0  Coordinates: equatorial FK5
#     Equinox: J2000.000 Epoch: J2000.00000000 MJD: 51544.50000

# Input file: STDIN  Output file: STDOUT

We check the input units, using “:iunits” and set both ra/longitude and dec/latitude to degrees. We do the same for output units, using “:ounits”.

:iunits

# Units: hours degrees

:iunits degrees degrees
:ounits

# Units: hours degrees

:ounits degrees degrees

We check the output format and see that it is set to give hms and dms strings. We want to get the output in decimal degrees and not as hms and dms. So we set them accordingly.

:oformat

# Formats: %12.2h %12.2h

:oformat %12.7g %12.7g

Now we enter the ra and dec for fk4 (B1950.0) and the output we get displays the input coordinates, followed by the converted coordinates. The result agrees with the information from NED.

10.0003647 40.9952154
10.0003647 40.9952154     10.68469     41.26904

Now lets convert the FK5 coordinates to galactic coordinates, for the same equinox and epoch.

:isystem fk5 J2000.0 J2000.0
:osystem

# Outsystem: fk5 J2000.0 J2000.0  Coordinates: equatorial FK5
#     Equinox: J2000.000 Epoch: J2000.00000000 MJD: 51544.50000

:osystem galactic J2000.0
10.68469 41.26904
10.68469 41.26904     121.1743    -21.57302

Lets try converting the fk4 B1950.0 system into supergalactic system in J2000.0.

:isystem fk4 B1950.0 B1950.0
:osystem supergalactic J2000.0
:osystem

# Outsystem:  supergalactic J2000.0  Coordinates: supergalactic
#     MJD: 51544.50000 Epoch: J2000.00000000 B2000.00127751

10.0003647 40.9952154
10.0003647 40.9952154     336.1933     12.55218

Lets convert the fk4 B1950.0 coordinates to FK5 J2000.0 coordinates, but we want the output RA in hms format and output DEC in dms format.

:isystem

# Insystem:  fk4 B1950.0 B1950.0  Coordinates: equatorial FK4
#     Equinox: B1950.000 Epoch: B1950.00000000 MJD: 33281.92346

:osystem fk5 J2000.0 J2000.0
:osystem

# Outsystem:  fk5 J2000.0 J2000.0  Coordinates: equatorial FK5
#     Equinox: J2000.000 Epoch: J2000.00000000 MJD: 51544.50000

:ounits

# Units: hours degrees

10.0003647 40.9952154
10.0003647 40.9952154 0:42:44.3253 41:16:08.549

What if we do not want to change the coordinate system, but merely convert degrees into hms and dms formats?

:isystem

# Insystem:  fk4 B1950.0 B1950.0  Coordinates: equatorial FK4
#     Equinox: B1950.000 Epoch: B1950.00000000 MJD: 33281.92346

:osystem fk4 B1950.0 B1950.0
:oformat

# Formats: %12.4h %12.4h

:ounits

# Units: hours degrees

:iunits

# Units: degrees degrees

10.0003647 40.9952154
10.0003647 40.9952154 0:40:00.0875 40:59:42.775

What about degrees to radians?

:ounits radians radians
:oformat

# Formats: %12.4h %12.4h

:oformat %12.4g %12.4g
:isystem

# Insystem:  fk4 B1950.0 B1950.0  Coordinates: equatorial FK4
#     Equinox: B1950.000 Epoch: B1950.00000000 MJD: 33281.92346

10.0003647 40.9952154
10.0003647 40.9952154       0.1745       0.7155

Lets say, we have the target epoch in Julian Date and not as year. We can either convert the Julian Date into years and use that as input, or we can directly use the Julian Date as input. Julian Date 2451545.0 corresponds to J2000.0. Note that setting epoch is useful only when we have to consider proper motion of objects.

:osystem

# Outsystem:  fk4 B1950.0 B1950.0  Coordinates: equatorial FK4
#     Equinox: B1950.000 Epoch: B1950.00000000 MJD: 33281.92346

:osystem fk5 J2000.0 24515450.0
:ounits

# Units: radians radians

:ounits hours degrees
:oformat %12.4h %12.4h
10.0003647 40.9952154
10.0003647 40.9952154 0:42:44.3253 41:16:08.549

Input coordinate can be provided in a text file. The following lists the contents of a file, which has RA and DEC along with the name of the object. Note that the coordinates are given in columns 2 and 3 and not 1 and 2.

Contents of the file coordinates.txt.

# Object        ra(1950)   Dec(1950)
m31  00:40:00.087 +40:59:42.78
m16 18:15:58.0    -13:49:42

We will first ask skyctran to send output to “STDOUT”. Note that we have set the input x/ra/longit column, lngcolu, to 2 and the input y/dec/latit column, latcolu, to 3, since these are the columns in the text file that contain the appropriate quantities.

imcoords> epar *skyctran*
                                                               ESC-? for HELP
                                   I R A F
                    Image Reduction and Analysis Facility
PACKAGE = imcoords
   TASK = *skyctran*

input   =      coordinates.txt  The input coordinate files(s)
output  =               STDOUT  The output coordinate file(s)
insystem=  fk4 B1950.0 B1950.0  The input coordinate system
outsyste=  fk5 J2000.0 J2000.0  The output coordinate system
(transfo=                   no) Transform the input coordinate file ?
(lngcolu=                    2) The input file column containing the x/ra/longit
(latcolu=                    3) The input file column containing the y/dec/latit
(plngcol=                INDEF) The input file column containing the x/ra/longit
(platcol=                INDEF) The input file column containing the y/dec/latit
(pxcolum=                INDEF) The input file column contain the parallax
(rvcolum=                INDEF) The input file column contain the radial velocit
(ilngmin=                INDEF) The input grid x/ra/longitude minimum
(ilngmax=                INDEF) The input grid x/ra/longitude maximum
(ilatmin=                INDEF) The input grid y/dec/latitude minimum
(ilatmax=                INDEF) The input grid y/dec/latitude maximum
(nilng  =                   10) Number of grid points in x/ra/longitude
(nilat  =                   10) Number of grid points in y/dec/latitude
More
imcoords> *skyctran*
The input coordinate files(s) (coordinates.txt):
The output coordinate file(s) (STDOUT):
The input coordinate system (fk4 B1950.0 B1950.0):
The output coordinate system (fk5 J2000.0 J2000.0):

# Insystem: fk4 B1950.0 B1950.0  Coordinates: equatorial FK4
#     Equinox: B1950.000 Epoch: B1950.00000000 MJD: 33281.92346
# Outsystem: fk5 J2000.0 J2000.0  Coordinates: equatorial FK5
#     Equinox: J2000.000 Epoch: J2000.00000000 MJD: 51544.50000

# Input file: coordinates.txt  Output file: STDOUT

# Object        ra(1950)   Dec(1950)
m31 0:42:44.325 41:16:08.55
m16 18:18:48.171 -13:48:26.03

We now ask skyctran to output the result into a text file and by setting tranform parameter to “no”, we ask it to not modify the input columns, but to add two new columns in the output file, along with the rest of the contents in the input file.

imcoords> epar *skyctran*

                                     I R A F
                    Image Reduction and Analysis Facility
PACKAGE = imcoords
   TASK = *skyctran*

input   =      coordinates.txt  The input coordinate files(s)
output  =    coordinates_1.txt  The output coordinate file(s)
insystem=  fk4 B1950.0 B1950.0  The input coordinate system
outsyste=  fk5 J2000.0 J2000.0  The output coordinate system
(transfo=                   no) Transform the input coordinate file ?
(lngcolu=                    2) The input file column containing the x/ra/longit
(latcolu=                    3) The input file column containing the y/dec/latit
(plngcol=                INDEF) The input file column containing the x/ra/longit
(platcol=                INDEF) The input file column containing the y/dec/latit
(pxcolum=                INDEF) The input file column contain the parallax
(rvcolum=                INDEF) The input file column contain the radial velocit
(ilngmin=                INDEF) The input grid x/ra/longitude minimum
(ilngmax=                INDEF) The input grid x/ra/longitude maximum
(ilatmin=                INDEF) The input grid y/dec/latitude minimum
(ilatmax=                INDEF) The input grid y/dec/latitude maximum
(nilng  =                   10) Number of grid points in x/ra/longitude
(nilat  =                   10) Number of grid points in y/dec/latitude
More

imcoords> *skyctran*
The input coordinate files(s) (coordinates.txt):
The output coordinate file(s) (coordinates_1.txt):
The input coordinate system (fk4 B1950.0 B1950.0):
The output coordinate system (fk5 J2000.0 J2000.0):

Insystem: fk4 B1950.0 B1950.0  Coordinates: equatorial FK4
    Equinox: B1950.000 Epoch: B1950.00000000 MJD: 33281.92346
Outsystem: fk5 J2000.0 J2000.0  Coordinates: equatorial FK5
    Equinox: J2000.000 Epoch: J2000.00000000 MJD: 51544.50000

Input file: coordinates.txt  Output file: coordinates_1.txt

The following are the contents of the output file, coordinates_1.txt.

# Insystem: fk4 B1950.0 B1950.0  Coordinates: equatorial FK4
#     Equinox: B1950.000 Epoch: B1950.00000000 MJD: 33281.92346
# Outsystem: fk5 J2000.0 J2000.0  Coordinates: equatorial FK5
#     Equinox: J2000.000 Epoch: J2000.00000000 MJD: 51544.50000

# Input file: coordinates.txt  Output file: coordinates_1.txt

# Object        ra(1950)   Dec(1950)
m31  00:40:00.087 +40:59:42.78   0:42:44.325  41:16:08.55
m16 18:15:58.0    -13:49:42  18:18:48.171 -13:48:26.03

Conclusion

skyctran is an easy to use task in IRAF, for coordinate conversions. It can take input in various formats, sky systems, and units and generate ouput in several format, sky systems and units. It can take input from standard input, files and images and write output to standard output and to files. We can choose which columns in the input to be used as the input values, and can have the output contain all the contents of the input file, along with the results. It can be used not only for coordinate conversions, but also for simple change of units and conversion of hms/dms strings to floating point numbers, in radians, degrees or hours.

Advertisements
This entry was posted in Astronomy and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s