| ccget | images.imcoords | ccget |
ccget -- extract objects in a user specified field from a text file catalog
ccget input output lngcenter latcenter lngwidth latwidth
In all the above cases fields in [] are optional with the defaults as described. The epoch field for the fk5, galactic, and supergalactic coordinate systems is only used if the input coordinates are in the equatorial fk4, noefk4, or fk5 systems and proper motions are supplied. Since ccget does not currently support proper motions these fields are not required.
Ccget extracts objects in a user specified field from the input catalogs input and writes the extracted records to the output catalogs output .
The user field is specified by the parameters lngcenter , latcenter , lngwidth , and latwidth , where the field center is entered in the celestial coordinate system specified by fcsystem and the units are specified by fclngunits and fclatunits . If fcsystem is undefined it defaults to the value of the catalog coordinate system catsystem .
The input catalogs must be text files containing 2 or more columns separated by whitespace. By default these columns are assigned names of the form c1, c2, ..., cn. Legal columns names must have the form described in the following column names section. Users may assign their own names to the columns by setting the colaliases parameter. The input catalog columns lngcolumn and latcolumn must contain the ra / longitude and dec / latitude coordinates of the catalog objects respectively. The parameters catsystem , catlngunits , and catlatunits specify the coordinate system of the input catalog and its coordinate units respectively.
At task startup the user field center is transformed from the coordinate system defined by fcsystem to the catalog coordinate system catsystem and the ra / longitude and dec / latitude limits of the user field are computed. As each input catalog record is read, the catalog coordinates are decoded and tested against these limits. If the object is inside the user field then the column and column expressions specified by exprs are extracted from the input catalogs and written to the output catalogs.
If the output celestial coordinate system outsystem is different from catsystem , then the catalog coordinates are transformed and to the output coordinates system, and written to the output catalog in the units specified by olngunits and olatunits , with the formats specified by olngformat and olatformat . Existing columns are written to the output catalog in the same format they have in the input catalog. Column expressions are written using the formats specified by formats or the builtin defaults of %5b, %10d, %10g, or %s for boolean, integer, floating point, or string columns respectively.
By default column names are of the form c1, c2, ..., cN. However users can also define their own column names, which must have the following syntax
{a-zA-Z}[{a-zA-Z0-9._$}]*
where [] indicates optional, {} indicates a class, - indicates an ascii range of characters, and * indicates zero or more occurrences. In words a column name must begin with an alphabetic character and be followed by any combination of alphabetic, digit, or ., _, and $ characters. The ccget task imposes a 19 character limit on the columns names so it is best to keep them short.
Expressions must consist of operands and operators. The operands may be column names, numeric constants, functions, and quoted string constants. Values given as sexigesimal strings are automatically converted to decimal numbers. The operators are arithmetic, logical, and string.
The following operators are supported:
+ - * / arithmetic operators
** exponentiation
// string concatenation
! - boolean not, unary negation
< <= > >= order comparison (works for strings)
== != && || equals, not equals, and, or
?= string equals pattern
? : conditional expression
The following intrinsic functions are supported:
abs atan2 deg log min real sqrt
acos bool double log10 mod short str
asin cos exp long nint sin tan
atan cosh int max rad sinh tanh
A format specification has the form "%w.dCn", where w is the field width, d is the number of decimal places or the number of digits of precision, C is the format code, and n is radix character for format code "r" only. The w and d fields are optional. The format codes C are as follows:
b boolean (YES or NO)
c single character (c or '\c' or '\0nnn')
d decimal integer
e exponential format (D specifies the precision)
f fixed format (D specifies the number of decimal places)
g general format (D specifies the precision)
h hms format (hh:mm:ss.ss, D = no. decimal places)
m minutes, seconds (or hours, minutes) (mm:ss.ss)
o octal integer
rN convert integer in any radix N
s string (D field specifies max chars to print)
t advance To column given as field W
u unsigned decimal integer
w output the number of spaces given by field W
x hexadecimal integer
z complex format (r,r) (D = precision)
Conventions for w (field width) specification:
W = n right justify in field of N characters, blank fill
-n left justify in field of N characters, blank fill
0n zero fill at left (only if right justified)
absent, 0 use as much space as needed (D field sets precision)
Escape sequences (e.g. "\n" for newline):
\b backspace (not implemented)
\f formfeed
\n newline (crlf)
\r carriage return
\t tab
\" string delimiter character
\' character constant delimiter character
\\ backslash character
\nnn octal value of character
Examples
%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 / by 15 and format as nn:nn:nn.n
%15H / by 15 and right justify nn:nn:nn.n in field of 15 characters
%-15H / by 15 and left justify nn:nn:nn.n in field of 15 characters
%12.2H / by 15 and right justify nn:nn:nn.nn
%-12.2H / by 15 and left justify nn:nn:nn.nn
\n insert a newline
The nlandolt.dat catalog in noao$photcal/catalogs/ has the following format.
# Column Quantity
1 id
2 ra
3 dec
4 v
5 b-v
6 u-b
7 v-r
8 r-i
9 v-i
10 n
11 m
12 err(v)
13 err(b-v)
14 err(u-b)
15 err(v-r)
16 err(r-i)
17 err(v-i)
where the coordinates are in j2000, the errors are all mean errors of the mean, and n and m are the number of observations and number of independent nights of observations respectively.
The catalog references are
nlandolt.dat - Landolt, A.U. 1992, A.J. 104, 340
Example 1. Extract all Landolt standard stars within a 1 degree field surrounding the position ra = 3:55:00 dec = 0:00:00 (J2000).
cl> ccget nlandolt.dat output 03:55:00.0 0:00:00 1.0 1.0
Example 2. Repeat example 1 but output the coordinates in the b1950 celestial coordinate system.
cl> ccget nlandolt.dat output 03:55:00.0 0:00:00 1.0 1.0 \ outsystem=b1950
Example 3. Repeat example 1 but extract only the id, ra, dec, v, and b-v fields from the Landolt catalog. Note that since these columns are the first five in the catalog they can be specified as a range.
cl> ccget nlandolt.dat output 03:55:00.0 0:00:00 1.0 1.0 \ exprs="c[1-5]"
Example 4. Repeat example 1 but extract the id, ra, dec, b and b-r colors. Note that b and b-r are not columns in the input catalog but may be computed from them. Note also that formats should be specified to give the desired spacing, although defaults will be supplied.
cl> ccget nlandolt.dat output 03:55:00.0 0:00:00 1.0 1.0 \ exprs="c[1-3],c4+c5,c5+c7" formats="%7.3f,%7.3f