## GNU Astronomy Utilities

Next: , Previous: , Up: Arithmetic operators   [Contents][Index]

#### 6.2.2.3 Unit conversion operators

It often happens that you have data in one unit (for example magnitudes to measure the brightness of a galaxy), but would like to convert it into another (for example electron counts on your CCD). While the equations for the unit conversions can be easily found on the internet, the operators in this section are designed to simplify the process and let you do it easily.

counts-to-mag

Convert counts (usually CCD outputs) to magnitudes using the given zeropoint. The zero point is the first popped operand and the count image or value is the second popped operand.

For example assume you have measured the standard deviation of the noise in an image to be 0.1 counts, and the image’s zero point is 22.5 and you want to measure the per-pixel surface brightness limit of the dataset121. To apply this operator on an image, simply replace 0.1 with the image name, as described below.

$astarithmetic 0.1 22.5 counts-to-mag --quiet  Of course, you can also convert every pixel in an image (or table column in Table’s Column arithmetic) with this operator if you replace the second popped operand with an image/column name. For an example of applying this operator on an image, see the description of surface brightness in Brightness, Flux, Magnitude and Surface brightness, where we’ll convert an image’s pixel values to surface brightness. mag-to-counts Convert magnitudes to counts (usually CCD outputs) using the given zeropoint. The zero point is the first popped operand and the magnitude value is the second. For example if an object has a magnitude of 20, you can estimate the counts corresponding to it (when the image has a zeropoint of 24.8) with this command: Note that because the output is a single number, we are using --quiet to avoid printing extra information. $ astarithmetic 20 24.8 mag-to-counts --quiet

counts-to-jy

Convert counts (usually CCD outputs) to Janskys through an AB-magnitude based zeropoint. The top-popped operand is assumed to be the AB-magnitude zero point and the second-popped operand is assumed to be a dataset in units of counts (an image in Arithmetic, and a column in Table’s Column arithmetic). For the full equation and basic definitions, see Brightness, Flux, Magnitude and Surface brightness.

For example SDSS images are calibrated in units of nanomaggies, with a fixed zero point magnitude of 22.5. Therefore you can convert the units of SDSS image pixels to Janskys with the command below:

$astarithmetic sdss-image.fits 22.5 counts-to-jy  au-to-pc Convert Astronomical Units (AUs) to Parsecs (PCs). This operator takes a single argument which is interpreted to be the input AUs. The conversion is based on the definition of Parsecs: $$1 \rm{PC} = 1/tan(1^{\prime\prime}) \rm{AU}$$, where $$1^{\prime\prime}$$ is one arcseconds. In other words, $$1 (\rm{PC}) = 648000/\pi (\rm{AU})$$. For example, if we take Pluto’s average distance to the Sun to be 40 AUs, we can obtain its distance in Parsecs using this command: echo 40 | asttable -c'arith$1 au-to-pc'

pc-to-au

Convert Parsecs (PCs) to Astronomical Units (AUs). This operator takes a single argument which is interpreted to be the input PCs. For more on the conversion equation, see description of au-to-pc. For example, Proxima Centauri (the nearest star to the Solar system) is 1.3020 Parsecs from the Sun, we can calculate this distance in units of AUs with the command below:

echo 1.3020 | asttable -c'arith $1 pc-to-au'  ly-to-pc Convert Light-years (LY) to Parsecs (PCs). This operator takes a single argument which is interpreted to be the input LYs. The conversion is done from IAU’s definition of the light-year (9460730472580800 m $$\approx$$ 63241.077 AU = 0.306601 PC, for the conversion of AU to PC, see the description of au-to-pc). For example the distance of Andromeda galaxy to our galaxy is 2.5 million light-years, so its distance in kilo-Parsecs can be calculated with the command below (note that we want the output in kilo-parsecs, so we are dividing the output of this operator by 1000): echo 2.5e6 | asttable -c'arith$1 ly-to-pc 1000 /'

pc-to-ly

Convert Parsecs (PCs) to Light-years (LY). This operator takes a single argument which is interpreted to be the input PCs. For the conversion and an example of the inverse of this operator, see the description of ly-to-pc.

ly-to-au

Convert Light-years (LY) to Astronomical Units (AUs). This operator takes a single argument which is interpreted to be the input LYs. For the conversion and a similar example, see the description of ly-to-pc.

au-to-ly

Convert Astronomical Units (AUs) to Light-years (LY). This operator takes a single argument which is interpreted to be the input AUs. For the conversion and a similar example, see the description of ly-to-pc.

#### Footnotes

##### (121)

The per-pixel surface brightness limit is the magnitude of the noise standard deviation. For more on surface brightness see Brightness, Flux, Magnitude and Surface brightness. In the example command, because the output is a single number, we are using --quiet to avoid printing extra information.

Next: Statistical operators, Previous: Trigonometric and hyperbolic operators, Up: Arithmetic operators   [Contents][Index]