funcombine(7)
π NAME π
FunCombine β combining region and table filters, bestie π
(It's a section 7 page from the SAORD Documentation set, so it's lore, not a command you run. π¦)
β¨ SYNOPSIS β¨
Okay so this whole doc is about the conventions for combining region and table filters β and like, especially about the comma operator, which is the messy little diva of the whole situation. π
π DESCRIPTION π
πΈ Comma Conventions πΈ
So a filter specification is just a series of boolean expressions, separated by commas. Those expressions can be table filters, spatial region filters, or a mix of both. The problem? Common usage basically demands that the comma operator act differently in different situations. So even though it feels intuitive most of the time, commas are lowkey a source of confusion. π
Per long-standing usage in IRAF, when a comma separates two table filters, it means a boolean and. So:
foo.fits[pha==1,pi==2]
is equivalent to:
foo.fits[pha==1 && pi==2]
But when a comma separates two spatial region filters? Traditionally it's meant a boolean or. So:
foo.fits[circle(10,10,3),ellipse(20,20,8,5)]
is equivalent to:
foo.fits[circle(10,10,3) βͺβͺ ellipse(20,20,8,5)]
(except that in the former case, each region is given a unique id in programs such as funcnts π)
And you can mix them, obviously:
foo.fits[circle(10,10,3),pi=1:5]
or even:
foo.fits[pha==1&&circle(10,10,3),pi==2&&ellipse(20,20,8,5)]
In those cases it is not obvious whether the command should use or or and. So they just arbitrarily chose this rule, and honestly? iconic of them:
- if both expressions contain a region, the operator used is or.
- if one (or both) expression(s) does not contain a region, the operator used is and.
This rule handles the pure-region and pure-column-filter cases properly, and it unambiguously assigns the boolean and to all the mixed cases. So:
foo.fits[circle(10,10,3),pi=1:5]
and
foo.fits[pi=1:5,circle(10,10,3)]
both are equivalent to:
foo.fits[circle(10,10,3) && pi=1:5]
π«Ά NB: this arbitrary rule replaced the previous arbitrary rule (pre-funtools1.2.3), which said: - if the 2nd expression contains a region, the operator used is or. - if the 2nd expression does not contain a region, the operator used is and. In that scenario, the or operator was implied by:pha==4,circle 5 5 1while the and operator was implied by:circle 5 5 1,pha==4Experience showed that this non-commutative treatment of the comma operator was confusing and led to unexpected results. π
Also, real talk: the comma rule must be considered provisional β comments and complaints are welcome to help clarify the matter. And better still? They recommend you just avoid the comma operator in these cases in favor of an explicit boolean operator. Periodt. β¨
π SEE ALSO π
See funtools(7) for a list of Funtools help pages π¦
k that's the whole page, mwah π β this was version 1.4.5, dated April 14, 2011, brought to you by the SAORD Documentation gang, and yes it's still funcombine(7) at heart πβ¨
π¦ where this page comes from
- debian bookworm: libfuntools-dev 1.4.8-1 Β· GPL
- debian trixie: libfuntools-dev 1.4.8-1.1+b2 Β· GPL
- ubuntu jammy: libfuntools-dev 1.4.8-1 Β· GPL
- ubuntu noble: libfuntools-dev 1.4.8-1.1build2 Β· GPL
- ubuntu questing: libfuntools-dev 1.4.8-2
- ubuntu resolute: libfuntools-dev 1.4.8-2build1 Β· GPL
- ubuntu stonking: libfuntools-dev 1.4.8-2build1 Β· GPL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms