[Dachs-support] unknown data type 'L' in FITS booster
Markus Demleitner
msdemlei at ari.uni-heidelberg.de
Fri Nov 18 10:41:30 CET 2016
Hi Carlos,
On Thu, Nov 17, 2016 at 10:25:56AM -0200, carlosadean at linea.gov.br wrote:
> > Index: gavo/grammars/directgrammar.py
> > ===================================================================
> > --- gavo/grammars/directgrammar.py (revision 5394)
> > +++ gavo/grammars/directgrammar.py (working copy)
> > @@ -546,6 +546,7 @@
> > "J": ("TLONG", "long"),
> > "K": ("TLONGLONG", "long long"),
> > "E": ("TFLOAT", "float"),
> > + "L": ("TLOGICAL", "short"),
> > "D": ("TDOUBLE", "double")}
> > makers = {
> > "bigint": "MAKE_BIGINT",
> >
> >
> > Would you try it? If it doesn't do the trick, could you send me a
> > little sample of this file (one row, or perhaps two, one with true,
> > one with false, will do)?
>
> After applying the patch I could create the booster file, however
> in the database the column 'L' is empty.
Yeah, that's because you set, in the RD, the corresponding column to
boolean, and the FITS booster doesn't know how to create code to fill
boolean DB columns.
I won't teach it, either, since booleans will be trouble with ADQL
and normally don't save space either (unless there's a bunch of them
or an array of booleans, which you'd have to handle manually).
Instead, simply declare the respective column (snx3) as a short
(bytea should work, too, but I'd say only bother if there's an even
number of consecutive booleans).
Even then, the above patch has a problem, since it turns out that
cfitsio dumps booleans in chars, so you'll get 257 instead of 1 into
your table column (and possibly worse).
So, I revert the above statement and correct myself to:
Index: grammars/directgrammar.py
===================================================================
--- grammars/directgrammar.py (revision 5404)
+++ grammars/directgrammar.py (revision 5405)
@@ -546,6 +546,7 @@
"J": ("TLONG", "long"),
"K": ("TLONGLONG", "long long"),
"E": ("TFLOAT", "float"),
+ "L": ("TLOGICAL", "unsigned char"),
"D": ("TDOUBLE", "double")}
makers = {
"bigint": "MAKE_BIGINT",
(that's 5404:5405 in svn).
Summing up: If you
(a) fix the patched source and
(b) declare snx3 as short
things should just work.
-- Markus
More information about the Dachs-support
mailing list