These are chat archives for astropy/astropy

23rd
May 2016
Adam Ginsburg
@keflavich
May 23 2016 14:47
anyone here know how to write units to bintablehdus?
Erik Tollerud
@eteq
May 23 2016 14:50
@MSeifert04 - oh, at the top vs the bottom might matter if this is a conf.py that imports something from another conf.py (e.g. the affiliated package template). A line like from astropy_helpers.sphinx.conf import * will overwrite a automodsumm_inherited_members defined at the top, because astropy_helpers/sphinx/conf.pyhas a automodsumm_inherited_members defined it it. But that’s not special to RTD, that’s just a standard Python import… But maybe it’s something weird about how/what version of the helpers RTD is using?
Erik Tollerud
@eteq
May 23 2016 14:56
@keflavich - You can manually add units to the header by adding TUNITn keywords (https://archive.stsci.edu/fits/fits_standard/node69.html#SECTION001232020000000000000)
but I don’t think anything in the machinery actually uses/reads that
Now that you bring it up it sure seems like something should be implemented in that direction, though
Oh, wait, this does work @keflavich:
t = table.Table.read(‘fitswithunits.fits')
the resulting table has the units assigned
And if you write it out again, it will keep the units
Simon Conseil
@saimn
May 23 2016 15:02
Was testing with the new table_to_hdu but it does not transfer the units correctly (from a Table to the BinTableHDU). The HDU's header does not have the TUNITn keywords.
I guess it is because it sets the .unit attribute on the columns after having created the BinTableHDU
Erik Tollerud
@eteq
May 23 2016 15:05
Huh… but the above does work, @saimn… does that follow a different code pathway, then?
(the above=t.write(’test.fits’) - the resulting fits file does have TUNITn keywords)
Simon Conseil
@saimn
May 23 2016 15:07
Ah yes, t.write is a different code, table_to_hdu was added recently and is useful if you need create a fits with multiple extensions
@eteq ^
Erik Tollerud
@eteq
May 23 2016 15:12
Oh, those should probably be unified then… since the next thing I was going to ask before you said that was “is there a way to make multiple extnsions in one file” ;)
So it is probable that the fits writer check and fix the header before writing the file
Yep, TUNIT1 appears after calling hdu.writeto :)
Michael Seifert
@MSeifert04
May 23 2016 16:02
@eteq I was at no point before the from astropy_helpers.sphinx.conf import * line. But I might have tried that - good to know I should avoid it. :smile:
Adam Ginsburg
@keflavich
May 23 2016 16:48
@eteq thanks; fits.Column(…, unit=unit) also works
…. no, I lied.
Michael Seifert
@MSeifert04
May 23 2016 16:52
oh, is GitHub down? No matter what I push nothing arrives at the fork...
Adam Ginsburg
@keflavich
May 23 2016 16:53
@mseifert04: I just pushed successfully....
status.github.com is good for this though
there are some issues now: https://status.github.com/messages
Michael Seifert
@MSeifert04
May 23 2016 16:54
oh, I checked this out and the last message was 2 hours ago
Adam Ginsburg
@keflavich
May 23 2016 16:54
hmm, I see one a minute ago: 18:53 CEST
Some users may experience a delay in pushes or other changes appearing on the site.
Michael Seifert
@MSeifert04
May 23 2016 16:55
yes, the one I saw when I asked was "16:47 UTCEverything operating normally. "
sorry :/
thank you!