These are chat archives for astropy/astropy

17th
Feb 2016
Adam Ginsburg
@keflavich
Feb 17 2016 14:47
anyone know how to concatenate fits.BinTableHDUs?
Erik Tollerud
@eteq
Feb 17 2016 16:11
@keflavich - by “concatenate” you mean add separate HDUs in the same file? Or squish multiple HDUs into one HDU?
Erik Tollerud
@eteq
Feb 17 2016 16:16
The former is probably best done by creating a new HDUList (and primary HDU) and then just add in the additional HDUs
While for the latter the path of least-resistance might be to convert them to astropy tables, concatenate, and then shove them back into a BinTableHDU
Adam Ginsburg
@keflavich
Feb 17 2016 16:35
@eteq thanks, it turns out I could do this with recordarrays
umm… kind of.
Erik Tollerud
@eteq
Feb 17 2016 16:36
The catch there is that if the types don’t exactly match (e.g., string dtypes aren’t exactly the same length), it’s really hard to get them to match
Adam Ginsburg
@keflavich
Feb 17 2016 16:36
true
I'm in a situation where they exactly match
so it's OK
Erik Tollerud
@eteq
Feb 17 2016 16:37
ah, ok, cool, then yeah that’s easier than switching to Table and back again
Adam Ginsburg
@keflavich
Feb 17 2016 16:37
I was just confused for a while about BinTableHDU vs BinTableHDU.data, where the latter is the actual recordarray and behaves as you expect
Erik Tollerud
@eteq
Feb 17 2016 16:43
gotcha