funcolumnlookup(3)
π« funcolumnlookup(3) β the SAORD Documentation glow-up π«
okay bestie, sit down, hydrate, because we're talking about FunColumnLookup from the funtools fam β it's the little function that spills the tea on any column you point at. like, name, type, mode, offset, sizeβ¦ the whole β¨dossierβ¨. no cap.
πΈ NAME πΈ
FunColumnLookup β lookup a Funtools column π
π¦ SYNOPSIS π¦
#include <funtools.h>
int FunColumnLookup(Fun fun, char *s, int which,
char **name, int *type, int *mode,
int *offset, int *n, int *width)
β¨ DESCRIPTION β¨
so the FunColumnLookup() routine is literally the group chat gossip of column info β you hand it a column (by name or by index) and it hands you back everything: the name, the type, the mode, the offset, how many elements, how wide. obsessed. π«Ά
first arg is the Fun handle for this whole set of columns. second arg is the name of the column you're looking up. and here's the plot twist: if the name argument is NULL, then the argument right after it is the zero-based index into the column array of the column you want info about. so it's giving "either/or" energy, iykyk.
next up is a pointer to a char *, which is where the name of the column gets dropped. and then the args after that are all addresses of int values, and here's what lands in each one:
- type β the data type of the column, and the menu is:
A: ASCII charactersB: unsigned 8-bit charI: signed 16-bit intU: unsigned 16-bit int (not standard FITS, bestie, just so you know)J: signed 32-bit intV: unsigned 32-bit int (not standard FITS either, don't come for me)E: 32-bit floatD: 64-bit float
- mode β the bit flag status of the column, and the flags are:
COL_ACTIVEβ1β is the column activated?COL_IBUFβ2β is the column in the raw input data?COL_PTRβ4β is the column a pointer to an array?COL_READβ010β is read mode selected?COL_WRITEβ020β is write mode selected?COL_REPLACEMEβ040β is this column being replaced by user data?
- offset β the byte offset in the struct π
- n β the number of elements (i.e. the size of the vector) in this column
- width β the size in bytes of this column π
so if the named column actually exists, the routine returns a positive integer and we're thriving. otherwise it returns zero. (and that positive integer? it's the index+1 into the column array of where this column was located. cute, right?)
now β if you pass NULL as the return address for one (or more) of these values, then no data comes back for that thing. you just skip it, no drama. for example:
if( !FunColumnLookup(fun, "phas", 0, NULL NULL, NULL, NULL, &npha, NULL) )
gerror(stderr, "can't find phas column\n");
this one only brings back info about the size of the phas vector. minimalist queen. π
π SEE ALSO π
peep funtools(7) for the full list of Funtools help pages β it's the master doc, fr fr.
and that's the whole vibe π this was version 1.4.5, dated April 14, 2011, brought to you by the SAORD Documentation girlies. stay hydrated, stay curious, and go look up some columns, bestie ππ¦β¨
π¦ 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