astrorama / SourceXtractorPlusPlus

SourceXtractor++, the next generation SExtractor
https://astrorama.github.io/SourceXtractorPlusPlus/
GNU Lesser General Public License v3.0
72 stars 9 forks source link

LDAC catalog crashes in SCAMP #468

Closed mkuemmel closed 2 years ago

mkuemmel commented 2 years ago

Looks like the LDAC format provided by SE++ is not okay and results in a SCAMP crash.

Comparing the LDAC_IMHAC header produced by Sourcextractor++ with that produced by SExtractor for the same image, I get the following:

LDAC_IMHEAD from sourcextractor++

XTENSION= 'BINTABLE' / binary table extension BITPIX = 8 / 8-bit bytes NAXIS = 2 / 2-dimensional binary table NAXIS1 = 80 / width of table in bytes NAXIS2 = 57 / number of rows in table PCOUNT = 0 / size of special data area GCOUNT = 1 / one data group (required keyword) TFIELDS = 1 / number of fields in each row TTYPE1 = 'Field Header Card' / label for field 1 TFORM1 = '80A ' / data format of field: ASCII Character EXTNAME = 'LDAC_IMHEAD' / name of this binary table extension TDESC1 = ' ' END

LDAC_IMHEAD from SExtractor

XTENSION= 'BINTABLE' / binary table extension BITPIX = 8 / 8-bit bytes NAXIS = 2 / 2-dimensional binary table NAXIS1 = 7920 / width of table in bytes NAXIS2 = 1 / number of rows in table PCOUNT = 0 / size of special data area GCOUNT = 1 / one data group (required keyword) TFIELDS = 1 / number of fields in each row TTYPE1 = 'Field Header Card' / label for field 1 TFORM1 = '7920A ' / data format of field: ASCII Character TDIM1 = '(80,99) ' EXTNAME = 'LDAC_IMHEAD' END

Differences are in NAXIS1, TFORM1 and TDIM1, but as I wrote I did not understand yet how to reproduce the correct format .... If it can help, I was trying with something like that (where sepcat is the output catalog from sourcextractor++)

ayllon commented 2 years ago

Good I started having a look before releasing Alexandria, because I will need to patch it.

ayllon commented 2 years ago

We've got a problem

***CCfits Warning: Column 10 is detected to be a vector column of strings.
      CCfits does not currently support reading and writing to vector string columns
ebertin commented 2 years ago

Actually the TDIM is only here for the big string to read comfortably. You may just save it as a one-dimensional string, I don't think that SCAMP cares.

mkuemmel commented 2 years ago

Mario provided a test dataset: https://drive.google.com/file/d/1xHROf9_IG-Y-Sx0H-_hIaNPqQ9pPsSkh/view?usp=sharing

The catalog created with with the fix/ldac_dim branch does not crash scamp, which is great!