Here are some examples for defining new columns;
the expressions below could appear as the <expr>
in a
tpipe
addcol
or sortexpr
command).
(first + second) * 0.5
sqrt(variance)
radiansToDegrees(DEC_radians) degreesToRadians(RA_degrees)
parseInt($12) parseDouble(ident)
toString(index)
toShort(obs_type) toDouble(range)or
(short) obs_type (double) range
hmsToDegrees(RA1950) dmsToDegrees(decDeg,decMin,decSec)
degreesToDms($3) degreesToHms(RA,2)
min(1000, max(value, 0))
jmag == 9999 ? NULL : jmag
NULL_jmag ? 9999 : jmag
psfCounts[2]
"MLT".indexOf(spType.charAt(0)) * 10 + parseDouble(substring(spType,1)) + 10Note this uses a couple of Java String instance methods (Section 10.9.2) which are not explicitly documented in this section.
tpipe
select
command)
RA > 100 && RA < 120 && Dec > 75 && Dec < 85
$2*$2 + $3*$3 < 1 skyDistanceDegrees(ra0,dec0,hmsToDegrees(RA),dmsToDegrees(DEC))<15./3600.
index <= 100(though you could use
tpipe cmd='head 100'
instead)index % 10 == 0(though you could use
tpipe cmd='every 10'
instead)equals(SECTOR, "ZZ9 Plural Z Alpha") equalsIgnoreCase(SECTOR, "zz9 plural z alpha") startsWith(SECTOR, "ZZ") contains(ph_qual, "U")
matches(SECTOR, "[XYZ] Alpha")
! NULL_ellipticity