<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">I don’t recall where I pulled this syntax, but it works fine:<div><br></div><div><div> prihdr = fits.Header()</div></div><div><div> prihdu = fits.PrimaryHDU(header=prihdr)</div></div><div><br></div><div> #data is an astropy Table</div><div><div> table_hdu = fits.BinTableHDU.from_columns(np.array(data.filled()))</div><div><br></div><div><div> thdulist = fits.HDUList([prihdu, table_hdu])</div></div><div><div> thdulist.writeto(outfil,clobber=True)</div></div><div><br></div><div>X</div><div><br></div><div><br></div><div><div>On Dec 17, 2014, at 5:55 PM, David Kirkby <<a href="mailto:dkirkby@uci.edu">dkirkby@uci.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">Is it possible to create a table as an astropy.table.Table and then convert it to an astropy.fits.io.BinTableHDU suitable for adding to the astropy.io.fits.HDUList of a multi-extension file? <div><br></div><div>I guess that astropy.table.Table.write already implements this but I didn't see how to only generate a new HDU in memory with this API.</div><div><br></div><div>thanks,</div><div>David</div><div><br></div></div>
!DSPAM:826,54923412200161532812012!
_______________________________________________<br>AstroPy mailing list<br><a href="mailto:AstroPy@scipy.org">AstroPy@scipy.org</a><br>http://mail.scipy.org/mailman/listinfo/astropy<br><br><br>!DSPAM:826,54923412200161532812012!<br></blockquote></div><br><div apple-content-edited="true">
<div style="orphans: auto; text-align: start; text-indent: 0px; widows: auto; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="orphans: auto; text-align: start; text-indent: 0px; widows: auto; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="orphans: auto; text-align: start; text-indent: 0px; widows: auto; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="orphans: auto; text-align: start; text-indent: 0px; widows: auto; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span class="Apple-style-span" style="border-collapse: separate; orphans: 2; text-indent: 0px; widows: 2; border-spacing: 0px;"><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">----------------------------------------------<br>J. Xavier Prochaska<br>UCO/Lick Observatory</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">1156 High St.<br>UC Santa Cruz<br>Santa Cruz, CA 95064<br><br><a href="http://www.ucolick.org/~xavier/">http://www.ucolick.org/~xavier/</a><br>http://imps.ucolick.org/<br></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><a href="http://www.qpqsurvey.org/">http://www.qpqsurvey.org/</a></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><a href="http://k1dm3.ucolick.org/">http://k1dm3.ucolick.org/</a></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><a href="http://www.ucolick.org/~xavier/IDL/index.html">http://www.ucolick.org/~xavier/IDL/index.html</a></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><a href="https://github.com/profxj/xastropy">https://github.com/profxj/xastropy</a></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">831-459-2135 (Direct)<br>831-459-2991 (UCO/Lick Main)<br>831-459-5244 (Fax)<br><br></div></span></div></span></div></div></div></div>
</div>
<br></div></body></html>