{"action":"created","issue":{"url":"https://api.github.com/repos/astropy/astropy/issues/7386","repository_url":"https://api.github.com/repos/astropy/astropy","labels_url":"https://api.github.com/repos/astropy/astropy/issues/7386/labels{/name}","comments_url":"https://api.github.com/repos/astropy/astropy/issues/7386/comments","events_url":"https://api.github.com/repos/astropy/astropy/issues/7386/events","html_url":"https://github.com/astropy/astropy/issues/7386","id":315351973,"number":7386,"title":"Accessing a FITS table with a zero-width column generates \"ValueError: Inconsistent data column lengths: set([0, 27645])\"","user":{"login":"alexanjo","id":12121100,"avatar_url":"https://avatars0.githubusercontent.com/u/12121100?v=4","gravatar_id":"","url":"https://api.github.com/users/alexanjo","html_url":"https://github.com/alexanjo","followers_url":"https://api.github.com/users/alexanjo/followers","following_url":"https://api.github.com/users/alexanjo/following{/other_user}","gists_url":"https://api.github.com/users/alexanjo/gists{/gist_id}","starred_url":"https://api.github.com/users/alexanjo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexanjo/subscriptions","organizations_url":"https://api.github.com/users/alexanjo/orgs","repos_url":"https://api.github.com/users/alexanjo/repos","events_url":"https://api.github.com/users/alexanjo/events{/privacy}","received_events_url":"https://api.github.com/users/alexanjo/received_events","type":"User","site_admin":false},"labels":[{"id":68702422,"url":"https://api.github.com/repos/astropy/astropy/labels/Affects-release","name":"Affects-release","color":"0052cc","default":false},{"id":16191481,"url":"https://api.github.com/repos/astropy/astropy/labels/Bug","name":"Bug","color":"d93f0b","default":false},{"id":113316336,"url":"https://api.github.com/repos/astropy/astropy/labels/Effort-medium","name":"Effort-medium","color":"fef2c0","default":false},{"id":113315637,"url":"https://api.github.com/repos/astropy/astropy/labels/Package-expert","name":"Package-expert","color":"bfe5bf","default":false},{"id":3496818,"url":"https://api.github.com/repos/astropy/astropy/labels/io.fits","name":"io.fits","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-18T06:51:01Z","updated_at":"2018-04-18T14:44:41Z","closed_at":null,"author_association":"NONE","body":"Using the great astropy package to access data stored in a FITS-IDI file with tables containing zero-width columns, generates\r\n\r\nValueError: Inconsistent data column lengths: set([0, 27645])\"\r\n\r\nAfter the clever folks at the Astronomical Python mailing list ‎(astropy@python.org) isolated the problem to zero-width columns in FITS tables, they asked me to post it here as an issue.   \r\n\r\nBelow is the email thread (latest to earliest) from astropy@python.org which includes the original issue, steps to produce it, and a work-around.  Sorry for the long thread, but it highlights how the problem was solved by several helpful people.\r\n\r\nIt is hoped future astropy can manage zero-width columns in FITS tables without generating errors...\r\n\r\nThank you, kindly, Jordan\r\n\r\n---------\r\n\r\nAccessing a FITS table generates \"ValueError: Inconsistent data column lengths: set([0, 27645])\"\r\nAstroPy on behalf of Jordan Alexander \r\n[Reply] [Reply All] [Forward]\r\n \r\n18 April 2018 11:47\r\nTom's suggested work-around saves the day, thank you folks!\r\n\r\nAfter Derek pointed out my mistake :)\r\n\r\n<issuing>\r\n\r\nhdulist.info()\r\ndat = hdulist[8].data\r\ndat.dtype.names\r\nnames = [name for name in dat.dtype.names if name != 'GATEID']\r\ncols = [dat[name] for name in names]\r\ntbl = Table(cols, names=names)\r\nprint names\r\ntbl\r\n\r\n<gives>\r\n\r\nFilename: WS001H.0.bin0000.source0000.FITS\r\nNo.    Name      Ver    Type      Cards   Dimensions   Format\r\n  0  PRIMARY       1 GroupsHDU       51   ()      0 Groups  0 Parameters\r\n  1  ARRAY_GEOMETRY    1 BinTableHDU     53   2R x 7C   ['8A', '3D', '3E', '0D', '1J', '1J', '3E']  \r\n  2  SOURCE        1 BinTableHDU     89   3R x 26C   [1J, 16A, 1J, 4A, 1J, 8E, 8E, 8E, 8E, 8E, 8D, 1D, 1D, 8A, 1D, 1D, 8D, 8A, 8A, 8D, 1D, 1D, 1E, 1D, 1D, 1D]  \r\n  3  ANTENNA       1 BinTableHDU     52   18R x 13C   [1D, 1E, 8A, 1J, 1J, 1J, 1J, 1A, 8E, 8E, 1A, 8E, 8E]  \r\n  4  FREQUENCY     1 BinTableHDU     35   1R x 6C   [1J, 8D, 8E, 8E, 8J, 8J]  \r\n  5  INTERFEROMETER_MODEL    1 BinTableHDU     83   946R x 20C   [1D, 1E, 1J, 1J, 1J, 1J, 1E, 8E, 48D, 6D, 48D, 6D, 1E, 1E, 48D, 6D, 48D, 6D, 1E, 1E]  \r\n  6  CALC          1 BinTableHDU     75   5R x 11C   [1D, 1D, 1D, 1D, 1A, 2D, 1A, 1D, 1D, 1D, 1D]  \r\n  7  MODEL_COMPS    1 BinTableHDU     86   946R x 21C   [1D, 1J, 1J, 1J, 1J, 1D, 1D, 1D, 1D, 1D, 1D, 8E, 8E, 1E, 1E, 1D, 1D, 8E, 8E, 1E, 1E]  \r\n  8  UV_DATA       1 BinTableHDU     93   27645R x 13C   ['1E', '1E', '1E', '1D', '1D', '1J', '1J', '1J', '1J', '1E', '32E', '0J', '4096E']  \r\n  9  PHASE-CAL     1 BinTableHDU     61   2406R x 17C   [1D, 1E, 1J, 1J, 1J, 1J, 1D, 32E, 16D, 16E, 16E, 16E, 32E, 16D, 16E, 16E, 16E]  \r\n 10  GAIN_CURVE    1 BinTableHDU     62   0R x 19C   [1J, 1J, 1J, 8J, 8J, 8J, 8J, 8E, 48E, 48E, 8E, 8J, 8J, 8J, 8J, 8E, 48E, 48E, 8E]  \r\n\r\n('UU---SIN', 'VV---SIN', 'WW---SIN', 'DATE', 'TIME', 'BASELINE', 'FILTER', 'SOURCE', 'FREQID', 'INTTIM', 'WEIGHT', 'GATEID', 'FLUX')\r\n\r\n['UU---SIN', 'VV---SIN', 'WW---SIN', 'DATE', 'TIME', 'BASELINE', 'FILTER', 'SOURCE', 'FREQID', 'INTTIM', 'WEIGHT', 'FLUX']\r\n\r\n<Table length=27645>\r\nUU---SIN        VV---SIN        WW---SIN        DATE    TIME    BASELINE        FILTER  SOURCE  FREQID  INTTIM  WEIGHT [32]     FLUX [4096]\r\nfloat32 float32 float32 float64 float64 int32   int32   int32   int32   float32 float32 float32\r\n-3.5595775e-07  4.8471287e-07   -1.3040803e-07  2458150.5       0.46869212962962964     258     0       1       1       4.0     0.498897 .. 0.498897    -0.00053550233 .. 0.0001868349\r\n0.0     0.0     0.0     2458150.5       0.46869212962962964     257     0       1       1       4.0     0.498897 .. 0.498897    0.12680201 .. -0.00014993937\r\n0.0     0.0     0.0     2458150.5       0.46869212962962964     514     0       1       1       4.0     0.498898 .. 0.498898    0.13645686 .. -4.7759924e-05\r\n-3.559708e-07   4.8473083e-07   -1.3030568e-07  2458150.5       0.4687384259259259      258     0       1       1       4.0     1.0 .. 1.0      0.00012936759 .. 0.00020031894\r\n0.0     0.0     0.0     2458150.5       0.4687384259259259      257     0       1       1       4.0     1.0 .. 1.0      0.25439927 .. -0.00019075086\r\n0.0     0.0     0.0     2458150.5       0.4687384259259259      514     0       1       1       4.0     1.0 .. 1.0      0.27794644 .. -0.000108667715\r\n-3.5598381e-07  4.8474874e-07   -1.302033e-07   2458150.5       0.4687847222222222      258     0       1       1       4.0     1.0 .. 1.0      -7.832311e-05 .. 0.00019760148\r\n0.0     0.0     0.0     2458150.5       0.4687847222222222      257     0       1       1       4.0     1.0 .. 1.0      0.25515017 .. 3.8746617e-05\r\n0.0     0.0     0.0     2458150.5       0.4687847222222222      514     0       1       1       4.0     1.0 .. 1.0      0.27692768 .. -8.5447784e-05\r\n-3.559968e-07   4.847667e-07    -1.3010094e-07  2458150.5       0.4688310185185185      258     0       1       1       4.0     1.0 .. 1.0      0.00023608183 .. 0.00012750328\r\n...     ...     ...     ...     ...     ...     ...     ...     ...     ...     ...     ...\r\n0.0     0.0     0.0     2458150.5       0.9504282407407407      257     0       3       1       4.0     1.0 .. 1.0      0.25559133 .. 9.5562056e-05\r\n0.0     0.0     0.0     2458150.5       0.9504282407407407      514     0       3       1       4.0     1.0 .. 1.0      0.27768683 .. 9.952805e-05\r\n-1.2753328e-07  5.2233025e-07   -2.9934213e-07  2458150.5       0.950474537037037       258     0       3       1       4.0     1.0 .. 1.0      0.0016913593 .. 5.9099006e-05\r\n0.0     0.0     0.0     2458150.5       0.950474537037037       257     0       3       1       4.0     1.0 .. 1.0      0.25483266 .. -1.5832578e-05\r\n0.0     0.0     0.0     2458150.5       0.950474537037037       514     0       3       1       4.0     1.0 .. 1.0      0.27675447 .. 6.571587e-05\r\n-1.2743546e-07  5.223637e-07    -2.9932542e-07  2458150.5       0.9505208333333334      258     0       3       1       4.0     1.0 .. 1.0      0.00025846672 .. -0.0002902149\r\n0.0     0.0     0.0     2458150.5       0.9505208333333334      257     0       3       1       4.0     1.0 .. 1.0      0.255608 .. -0.0001676612\r\n0.0     0.0     0.0     2458150.5       0.9505208333333334      514     0       3       1       4.0     1.0 .. 1.0      0.27796867 .. 0.00022455976\r\n-1.2733761e-07  5.223971e-07    -2.993087e-07   2458150.5       0.9505671296296296      258     0       3       1       4.0     1.0 .. 1.0      -0.00098487 .. 8.03614e-05\r\n0.0     0.0     0.0     2458150.5       0.9505671296296296      257     0       3       1       4.0     1.0 .. 1.0      0.25570583 .. -5.7318623e-05\r\n\r\nJordan Alexander\r\n[Reply All]\r\nSent Items\r\n18 April 2018 11:46\r\nTom's suggested work-around saves the day, thank you folks!\r\n\r\nAfter Derek pointed out my mistake :)\r\n\r\n<issuing>\r\n\r\nhdulist.info()\r\ndat = hdulist[8].data\r\ndat.dtype.names\r\nnames = [name for name in dat.dtype.names if name != 'GATEID']\r\ncols = [dat[name] for name in names]\r\ntbl = Table(cols, names=names)\r\nprint names\r\ntbl\r\n\r\n<gives>\r\n\r\nFilename: WS001H.0.bin0000.source0000.FITS\r\nNo.    Name      Ver    Type      Cards   Dimensions   Format\r\n  0  PRIMARY       1 GroupsHDU       51   ()      0 Groups  0 Parameters\r\n  1  ARRAY_GEOMETRY    1 BinTableHDU     53   2R x 7C   ['8A', '3D', '3E', '0D', '1J', '1J', '3E']  \r\n  2  SOURCE        1 BinTableHDU     89   3R x 26C   [1J, 16A, 1J, 4A, 1J, 8E, 8E, 8E, 8E, 8E, 8D, 1D, 1D, 8A, 1D, 1D, 8D, 8A, 8A, 8D, 1D, 1D, 1E, 1D, 1D, 1D]  \r\n  3  ANTENNA       1 BinTableHDU     52   18R x 13C   [1D, 1E, 8A, 1J, 1J, 1J, 1J, 1A, 8E, 8E, 1A, 8E, 8E]  \r\n  4  FREQUENCY     1 BinTableHDU     35   1R x 6C   [1J, 8D, 8E, 8E, 8J, 8J]  \r\n  5  INTERFEROMETER_MODEL    1 BinTableHDU     83   946R x 20C   [1D, 1E, 1J, 1J, 1J, 1J, 1E, 8E, 48D, 6D, 48D, 6D, 1E, 1E, 48D, 6D, 48D, 6D, 1E, 1E]  \r\n  6  CALC          1 BinTableHDU     75   5R x 11C   [1D, 1D, 1D, 1D, 1A, 2D, 1A, 1D, 1D, 1D, 1D]  \r\n  7  MODEL_COMPS    1 BinTableHDU     86   946R x 21C   [1D, 1J, 1J, 1J, 1J, 1D, 1D, 1D, 1D, 1D, 1D, 8E, 8E, 1E, 1E, 1D, 1D, 8E, 8E, 1E, 1E]  \r\n  8  UV_DATA       1 BinTableHDU     93   27645R x 13C   ['1E', '1E', '1E', '1D', '1D', '1J', '1J', '1J', '1J', '1E', '32E', '0J', '4096E']  \r\n  9  PHASE-CAL     1 BinTableHDU     61   2406R x 17C   [1D, 1E, 1J, 1J, 1J, 1J, 1D, 32E, 16D, 16E, 16E, 16E, 32E, 16D, 16E, 16E, 16E]  \r\n 10  GAIN_CURVE    1 BinTableHDU     62   0R x 19C   [1J, 1J, 1J, 8J, 8J, 8J, 8J, 8E, 48E, 48E, 8E, 8J, 8J, 8J, 8J, 8E, 48E, 48E, 8E]  \r\n\r\n('UU---SIN', 'VV---SIN', 'WW---SIN', 'DATE', 'TIME', 'BASELINE', 'FILTER', 'SOURCE', 'FREQID', 'INTTIM', 'WEIGHT', 'GATEID', 'FLUX')\r\n\r\n['UU---SIN', 'VV---SIN', 'WW---SIN', 'DATE', 'TIME', 'BASELINE', 'FILTER', 'SOURCE', 'FREQID', 'INTTIM', 'WEIGHT', 'FLUX']\r\n\r\n<Table length=27645>\r\nUU---SIN        VV---SIN        WW---SIN        DATE    TIME    BASELINE        FILTER  SOURCE  FREQID  INTTIM  WEIGHT [32]     FLUX [4096]\r\nfloat32 float32 float32 float64 float64 int32   int32   int32   int32   float32 float32 float32\r\n-3.5595775e-07  4.8471287e-07   -1.3040803e-07  2458150.5       0.46869212962962964     258     0       1       1       4.0     0.498897 .. 0.498897    -0.00053550233 .. 0.0001868349\r\n0.0     0.0     0.0     2458150.5       0.46869212962962964     257     0       1       1       4.0     0.498897 .. 0.498897    0.12680201 .. -0.00014993937\r\n0.0     0.0     0.0     2458150.5       0.46869212962962964     514     0       1       1       4.0     0.498898 .. 0.498898    0.13645686 .. -4.7759924e-05\r\n-3.559708e-07   4.8473083e-07   -1.3030568e-07  2458150.5       0.4687384259259259      258     0       1       1       4.0     1.0 .. 1.0      0.00012936759 .. 0.00020031894\r\n0.0     0.0     0.0     2458150.5       0.4687384259259259      257     0       1       1       4.0     1.0 .. 1.0      0.25439927 .. -0.00019075086\r\n0.0     0.0     0.0     2458150.5       0.4687384259259259      514     0       1       1       4.0     1.0 .. 1.0      0.27794644 .. -0.000108667715\r\n-3.5598381e-07  4.8474874e-07   -1.302033e-07   2458150.5       0.4687847222222222      258     0       1       1       4.0     1.0 .. 1.0      -7.832311e-05 .. 0.00019760148\r\n0.0     0.0     0.0     2458150.5       0.4687847222222222      257     0       1       1       4.0     1.0 .. 1.0      0.25515017 .. 3.8746617e-05\r\n0.0     0.0     0.0     2458150.5       0.4687847222222222      514     0       1       1       4.0     1.0 .. 1.0      0.27692768 .. -8.5447784e-05\r\n-3.559968e-07   4.847667e-07    -1.3010094e-07  2458150.5       0.4688310185185185      258     0       1       1       4.0     1.0 .. 1.0      0.00023608183 .. 0.00012750328\r\n...     ...     ...     ...     ...     ...     ...     ...     ...     ...     ...     ...\r\n0.0     0.0     0.0     2458150.5       0.9504282407407407      257     0       3       1       4.0     1.0 .. 1.0      0.25559133 .. 9.5562056e-05\r\n0.0     0.0     0.0     2458150.5       0.9504282407407407      514     0       3       1       4.0     1.0 .. 1.0      0.27768683 .. 9.952805e-05\r\n-1.2753328e-07  5.2233025e-07   -2.9934213e-07  2458150.5       0.950474537037037       258     0       3       1       4.0     1.0 .. 1.0      0.0016913593 .. 5.9099006e-05\r\n0.0     0.0     0.0     2458150.5       0.950474537037037       257     0       3       1       4.0     1.0 .. 1.0      0.25483266 .. -1.5832578e-05\r\n0.0     0.0     0.0     2458150.5       0.950474537037037       514     0       3       1       4.0     1.0 .. 1.0      0.27675447 .. 6.571587e-05\r\n-1.2743546e-07  5.223637e-07    -2.9932542e-07  2458150.5       0.9505208333333334      258     0       3       1       4.0     1.0 .. 1.0      0.00025846672 .. -0.0002902149\r\n0.0     0.0     0.0     2458150.5       0.9505208333333334      257     0       3       1       4.0     1.0 .. 1.0      0.255608 .. -0.0001676612\r\n0.0     0.0     0.0     2458150.5       0.9505208333333334      514     0       3       1       4.0     1.0 .. 1.0      0.27796867 .. 0.00022455976\r\n-1.2733761e-07  5.223971e-07    -2.993087e-07   2458150.5       0.9505671296296296      258     0       3       1       4.0     1.0 .. 1.0      -0.00098487 .. 8.03614e-05\r\n0.0     0.0     0.0     2458150.5       0.9505671296296296      257     0       3       1       4.0     1.0 .. 1.0      0.25570583 .. -5.7318623e-05\r\n\r\nAstroPy  on behalf of Derek Homeier \r\n[Reply All]\r\n \r\n18 April 2018 11:19\r\nOn 18 Apr 2018, at 12:59 am, Jordan Alexander wrote:\r\n> \r\n> Your \"tested\" work-around, Tom:\r\n> \r\n> hdulist.info()\r\n> dat = hdulist[8].data\r\n> names = [name for name in dat.dtype.names if name != 'col_with_0J']\r\n> cols = [dat[name] for name in names]\r\n> tbl = Table(cols, names=names)\r\n\r\n‘col_with_0J’ was meant to be the actual column name of the 0-width column (#12).\r\n\r\nnames = [name for name in dat.dtype.names if dat[name].shape[-1] > 0]\r\n\r\nshould automatically filter the 0-shaped columns out.\r\n\r\nCheers,\r\n                                        Derek\r\n\r\n_______________________________________________\r\nAstroPy mailing list\r\nAstroPy@python.org\r\nhttps://mail.python.org/mailman/listinfo/astropy\r\nAstroPy on behalf of Jordan Alexander \r\n[Reply All]\r\nInbox, Sent Items\r\n18 April 2018 11:00\r\nYour \"tested\" work-around, Tom:\r\n\r\nhdulist.info()\r\ndat = hdulist[8].data\r\nnames = [name for name in dat.dtype.names if name != 'col_with_0J']\r\ncols = [dat[name] for name in names]\r\ntbl = Table(cols, names=names)\r\n\r\n<generates>\r\n\r\nFilename: WS001H.0.bin0000.source0000.FITS\r\nNo.    Name      Ver    Type      Cards   Dimensions   Format\r\n  0  PRIMARY       1 GroupsHDU       51   ()      0 Groups  0 Parameters\r\n  1  ARRAY_GEOMETRY    1 BinTableHDU     53   2R x 7C   ['8A', '3D', '3E', '0D', '1J', '1J', '3E']   \r\n  2  SOURCE        1 BinTableHDU     89   3R x 26C   [1J, 16A, 1J, 4A, 1J, 8E, 8E, 8E, 8E, 8E, 8D, 1D, 1D, 8A, 1D, 1D, 8D, 8A, 8A, 8D, 1D, 1D, 1E, 1D, 1D, 1D]   \r\n  3  ANTENNA       1 BinTableHDU     52   18R x 13C   [1D, 1E, 8A, 1J, 1J, 1J, 1J, 1A, 8E, 8E, 1A, 8E, 8E]   \r\n  4  FREQUENCY     1 BinTableHDU     35   1R x 6C   [1J, 8D, 8E, 8E, 8J, 8J]   \r\n  5  INTERFEROMETER_MODEL    1 BinTableHDU     83   946R x 20C   [1D, 1E, 1J, 1J, 1J, 1J, 1E, 8E, 48D, 6D, 48D, 6D, 1E, 1E, 48D, 6D, 48D, 6D, 1E, 1E]   \r\n  6  CALC          1 BinTableHDU     75   5R x 11C   [1D, 1D, 1D, 1D, 1A, 2D, 1A, 1D, 1D, 1D, 1D]   \r\n  7  MODEL_COMPS    1 BinTableHDU     86   946R x 21C   [1D, 1J, 1J, 1J, 1J, 1D, 1D, 1D, 1D, 1D, 1D, 8E, 8E, 1E, 1E, 1D, 1D, 8E, 8E, 1E, 1E]   \r\n  8  UV_DATA       1 BinTableHDU     93   27645R x 13C   [1E, 1E, 1E, 1D, 1D, 1J, 1J, 1J, 1J, 1E, 32E, 0J, 4096E]   \r\n  9  PHASE-CAL     1 BinTableHDU     61   2406R x 17C   [1D, 1E, 1J, 1J, 1J, 1J, 1D, 32E, 16D, 16E, 16E, 16E, 32E, 16D, 16E, 16E, 16E]   \r\n 10  GAIN_CURVE    1 BinTableHDU     62   0R x 19C   [1J, 1J, 1J, 8J, 8J, 8J, 8J, 8E, 48E, 48E, 8E, 8J, 8J, 8J, 8J, 8E, 48E, 48E, 8E]   \r\n\r\n---------------------------------------------------------------------------\r\nValueError                                Traceback (most recent call last)\r\n<ipython-input-100-08709251a86a> in <module>()\r\n      9 cols = [dat[name] for name in names]\r\n     10 \r\n---> 11 tbl = Table(cols, names=names)\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in __init__(self, data, masked, names, dtype, meta, copy, rows, copy_indices, **kwargs)\r\n    411         init_func(data, names, dtype, n_cols, copy)\r\n    412 \r\n--> 413         # Whatever happens above, the masked property should be set to a boolean\r\n    414         if type(self.masked) is not bool:\r\n    415             raise TypeError(\"masked property has not been set to True or False\")\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _init_from_list(self, data, names, dtype, n_cols, copy)\r\n    684         self._init_from_cols(cols)\r\n    685 \r\n--> 686     def _init_from_ndarray(self, data, names, dtype, n_cols, copy):\r\n    687         \"\"\"Initialize table from an ndarray structured array\"\"\"\r\n    688 \r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _init_from_cols(self, cols)\r\n    749                              .format(lengths))\r\n    750 \r\n--> 751         # Set the table masking\r\n    752         self._set_masked_from_cols(cols)\r\n    753 \r\n\r\nValueError: Inconsistent data column lengths: set([0, 27645])\r\n\r\nAstroPy on behalf of Jordan Alexander \r\n[Reply All]\r\n \r\n18 April 2018 10:55\r\n>Could you make one more test and check what happens if you try\r\n>tbl = Table(np.array(hdulist[1].data)) ?\r\n\r\nHere's what happens, Derek:\r\n\r\nhdulist.info()\r\nTable(np.array(hdulist[1].data))\r\n\r\n<generates>\r\n\r\nFilename: WS001H.0.bin0000.source0000.FITS\r\nNo.    Name      Ver    Type      Cards   Dimensions   Format\r\n  0  PRIMARY       1 GroupsHDU       51   ()      0 Groups  0 Parameters\r\n  1  ARRAY_GEOMETRY    1 BinTableHDU     53   2R x 7C   ['8A', '3D', '3E', '0D', '1J', '1J', '3E']  \r\n  2  SOURCE        1 BinTableHDU     89   3R x 26C   [1J, 16A, 1J, 4A, 1J, 8E, 8E, 8E, 8E, 8E, 8D, 1D, 1D, 8A, 1D, 1D, 8D, 8A, 8A, 8D, 1D, 1D, 1E, 1D, 1D, 1D]  \r\n  3  ANTENNA       1 BinTableHDU     52   18R x 13C   [1D, 1E, 8A, 1J, 1J, 1J, 1J, 1A, 8E, 8E, 1A, 8E, 8E]  \r\n  4  FREQUENCY     1 BinTableHDU     35   1R x 6C   [1J, 8D, 8E, 8E, 8J, 8J]  \r\n  5  INTERFEROMETER_MODEL    1 BinTableHDU     83   946R x 20C   [1D, 1E, 1J, 1J, 1J, 1J, 1E, 8E, 48D, 6D, 48D, 6D, 1E, 1E, 48D, 6D, 48D, 6D, 1E, 1E]  \r\n  6  CALC          1 BinTableHDU     75   5R x 11C   [1D, 1D, 1D, 1D, 1A, 2D, 1A, 1D, 1D, 1D, 1D]  \r\n  7  MODEL_COMPS    1 BinTableHDU     86   946R x 21C   [1D, 1J, 1J, 1J, 1J, 1D, 1D, 1D, 1D, 1D, 1D, 8E, 8E, 1E, 1E, 1D, 1D, 8E, 8E, 1E, 1E]  \r\n  8  UV_DATA       1 BinTableHDU     93   27645R x 13C   [1E, 1E, 1E, 1D, 1D, 1J, 1J, 1J, 1J, 1E, 32E, 0J, 4096E]  \r\n  9  PHASE-CAL     1 BinTableHDU     61   2406R x 17C   [1D, 1E, 1J, 1J, 1J, 1J, 1D, 32E, 16D, 16E, 16E, 16E, 32E, 16D, 16E, 16E, 16E]  \r\n 10  GAIN_CURVE    1 BinTableHDU     62   0R x 19C   [1J, 1J, 1J, 8J, 8J, 8J, 8J, 8E, 48E, 48E, 8E, 8J, 8J, 8J, 8J, 8E, 48E, 48E, 8E]  \r\n\r\n---------------------------------------------------------------------------\r\nIndexError                                Traceback (most recent call last)\r\n/usr/local/lib/python2.7/dist-packages/IPython/core/formatters.pyc in __call__(self, obj)\r\n    697                 type_pprinters=self.type_printers,\r\n    698                 deferred_pprinters=self.deferred_printers)\r\n--> 699             printer.pretty(obj)\r\n    700             printer.flush()\r\n    701             return stream.getvalue()\r\n\r\n/usr/local/lib/python2.7/dist-packages/IPython/lib/pretty.pyc in pretty(self, obj)\r\n    401                         if cls is not object \\\r\n    402                                 and callable(cls.__dict__.get('__repr__')):\r\n--> 403                             return _repr_pprint(obj, self, cycle)\r\n    404\r\n    405             return _default_pprint(obj, self, cycle)\r\n\r\n/usr/local/lib/python2.7/dist-packages/IPython/lib/pretty.pyc in _repr_pprint(obj, p, cycle)\r\n    701     \"\"\"A pprint that just redirects to the normal repr function.\"\"\"\r\n    702     # Find newlines and replace them with p.break_()\r\n--> 703     output = repr(obj)\r\n    704     for idx,output_line in enumerate(output.splitlines()):\r\n    705         if idx:\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in __repr__(self)\r\n    873         return self._base_repr_(html=False, max_width=None)\r\n    874\r\n--> 875     def __unicode__(self):\r\n    876         return '\\n'.join(self.pformat())\r\n    877     if not six.PY2:\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _base_repr_(self, html, descr_vals, max_width, tableid, show_dtype, max_lines, tableclass)\r\n    860             max_lines=max_lines, tableclass=tableclass)\r\n    861\r\n--> 862         out = descr + '\\n'.join(data_lines)\r\n    863         if six.PY2 and isinstance(out, six.text_type):\r\n    864             out = out.encode('utf-8')\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/pprint.pyc in _pformat_table(self, table, max_lines, max_width, show_name, show_unit, show_dtype, html, tableid, tableclass, align)\r\n    539\r\n    540         if not cols:\r\n--> 541             return ['<No columns>'], {'show_length': False}\r\n    542\r\n    543         # Use the values for the last column since they are all the same\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/pprint.pyc in _pformat_col(self, col, max_lines, show_name, show_unit, show_dtype, show_length, html, align)\r\n    252\r\n    253         if html:\r\n--> 254             from ..utils.xml.writer import xml_escape\r\n    255             n_header = outs['n_header']\r\n    256             for i, col_str in enumerate(col_strs):\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/pprint.pyc in _pformat_col_iter(self, col, max_lines, show_name, show_unit, outs, show_dtype, show_length)\r\n    450                 yield col_str\r\n    451\r\n--> 452         outs['show_length'] = show_length\r\n    453         outs['n_header'] = n_header\r\n    454         outs['i_centers'] = i_centers\r\n\r\nastropy/table/_column_mixins.pyx in astropy.table._column_mixins._ColumnGetitemShim.__getitem__()\r\n\r\nastropy/table/_column_mixins.pyx in astropy.table._column_mixins.base_getitem()\r\n\r\nastropy/table/_column_mixins.pyx in astropy.table._column_mixins.column_getitem()\r\n\r\nIndexError: index 0 is out of bounds for axis 1 with size 0\r\n\r\n---------------------------------------------------------------------------\r\nIndexError                                Traceback (most recent call last)\r\n/usr/local/lib/python2.7/dist-packages/IPython/core/formatters.pyc in __call__(self, obj)\r\n    336             method = get_real_method(obj, self.print_method)\r\n    337             if method is not None:\r\n--> 338                 return method()\r\n    339             return None\r\n    340         else:\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _repr_html_(self)\r\n    870                                 tableclass=conf.default_notebook_table_class)\r\n    871\r\n--> 872     def __repr__(self):\r\n    873         return self._base_repr_(html=False, max_width=None)\r\n    874\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _base_repr_(self, html, descr_vals, max_width, tableid, show_dtype, max_lines, tableclass)\r\n    860             max_lines=max_lines, tableclass=tableclass)\r\n    861\r\n--> 862         out = descr + '\\n'.join(data_lines)\r\n    863         if six.PY2 and isinstance(out, six.text_type):\r\n    864             out = out.encode('utf-8')\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/pprint.pyc in _pformat_table(self, table, max_lines, max_width, show_name, show_unit, show_dtype, html, tableid, tableclass, align)\r\n    539\r\n    540         if not cols:\r\n--> 541             return ['<No columns>'], {'show_length': False}\r\n    542\r\n    543         # Use the values for the last column since they are all the same\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/pprint.pyc in _pformat_col(self, col, max_lines, show_name, show_unit, show_dtype, show_length, html, align)\r\n    252\r\n    253         if html:\r\n--> 254             from ..utils.xml.writer import xml_escape\r\n    255             n_header = outs['n_header']\r\n    256             for i, col_str in enumerate(col_strs):\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/pprint.pyc in _pformat_col_iter(self, col, max_lines, show_name, show_unit, outs, show_dtype, show_length)\r\n    450                 yield col_str\r\n    451\r\n--> 452         outs['show_length'] = show_length\r\n    453         outs['n_header'] = n_header\r\n    454         outs['i_centers'] = i_centers\r\n\r\nastropy/table/_column_mixins.pyx in astropy.table._column_mixins._ColumnGetitemShim.__getitem__()\r\n\r\nastropy/table/_column_mixins.pyx in astropy.table._column_mixins.base_getitem()\r\n\r\nastropy/table/_column_mixins.pyx in astropy.table._column_mixins.column_getitem()\r\n\r\nIndexError: index 0 is out of bounds for axis 1 with size 0\r\n\r\nJordan Alexander\r\n[Reply] [Reply All] [Forward]\r\nActions\r\nTo:\r\n Astronomical Python mailing list ‎[astropy@python.org]‎ \r\nSent Items\r\n18 April 2018 10:52\r\n>Could you make one more test and check what happens if you try\r\n>tbl = Table(np.array(hdulist[1].data)) ?\r\n\r\nHere's what happens, Derek:\r\n\r\nhdulist.info()\r\nTable(np.array(hdulist[1].data))\r\n\r\n<generates>\r\n\r\nFilename: WS001H.0.bin0000.source0000.FITS\r\nNo.    Name      Ver    Type      Cards   Dimensions   Format\r\n  0  PRIMARY       1 GroupsHDU       51   ()      0 Groups  0 Parameters\r\n  1  ARRAY_GEOMETRY    1 BinTableHDU     53   2R x 7C   ['8A', '3D', '3E', '0D', '1J', '1J', '3E']  \r\n  2  SOURCE        1 BinTableHDU     89   3R x 26C   [1J, 16A, 1J, 4A, 1J, 8E, 8E, 8E, 8E, 8E, 8D, 1D, 1D, 8A, 1D, 1D, 8D, 8A, 8A, 8D, 1D, 1D, 1E, 1D, 1D, 1D]  \r\n  3  ANTENNA       1 BinTableHDU     52   18R x 13C   [1D, 1E, 8A, 1J, 1J, 1J, 1J, 1A, 8E, 8E, 1A, 8E, 8E]  \r\n  4  FREQUENCY     1 BinTableHDU     35   1R x 6C   [1J, 8D, 8E, 8E, 8J, 8J]  \r\n  5  INTERFEROMETER_MODEL    1 BinTableHDU     83   946R x 20C   [1D, 1E, 1J, 1J, 1J, 1J, 1E, 8E, 48D, 6D, 48D, 6D, 1E, 1E, 48D, 6D, 48D, 6D, 1E, 1E]  \r\n  6  CALC          1 BinTableHDU     75   5R x 11C   [1D, 1D, 1D, 1D, 1A, 2D, 1A, 1D, 1D, 1D, 1D]  \r\n  7  MODEL_COMPS    1 BinTableHDU     86   946R x 21C   [1D, 1J, 1J, 1J, 1J, 1D, 1D, 1D, 1D, 1D, 1D, 8E, 8E, 1E, 1E, 1D, 1D, 8E, 8E, 1E, 1E]  \r\n  8  UV_DATA       1 BinTableHDU     93   27645R x 13C   [1E, 1E, 1E, 1D, 1D, 1J, 1J, 1J, 1J, 1E, 32E, 0J, 4096E]  \r\n  9  PHASE-CAL     1 BinTableHDU     61   2406R x 17C   [1D, 1E, 1J, 1J, 1J, 1J, 1D, 32E, 16D, 16E, 16E, 16E, 32E, 16D, 16E, 16E, 16E]  \r\n 10  GAIN_CURVE    1 BinTableHDU     62   0R x 19C   [1J, 1J, 1J, 8J, 8J, 8J, 8J, 8E, 48E, 48E, 8E, 8J, 8J, 8J, 8J, 8E, 48E, 48E, 8E]  \r\n\r\n---------------------------------------------------------------------------\r\nIndexError                                Traceback (most recent call last)\r\n/usr/local/lib/python2.7/dist-packages/IPython/core/formatters.pyc in __call__(self, obj)\r\n    697                 type_pprinters=self.type_printers,\r\n    698                 deferred_pprinters=self.deferred_printers)\r\n--> 699             printer.pretty(obj)\r\n    700             printer.flush()\r\n    701             return stream.getvalue()\r\n\r\n/usr/local/lib/python2.7/dist-packages/IPython/lib/pretty.pyc in pretty(self, obj)\r\n    401                         if cls is not object \\\r\n    402                                 and callable(cls.__dict__.get('__repr__')):\r\n--> 403                             return _repr_pprint(obj, self, cycle)\r\n    404\r\n    405             return _default_pprint(obj, self, cycle)\r\n\r\n/usr/local/lib/python2.7/dist-packages/IPython/lib/pretty.pyc in _repr_pprint(obj, p, cycle)\r\n    701     \"\"\"A pprint that just redirects to the normal repr function.\"\"\"\r\n    702     # Find newlines and replace them with p.break_()\r\n--> 703     output = repr(obj)\r\n    704     for idx,output_line in enumerate(output.splitlines()):\r\n    705         if idx:\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in __repr__(self)\r\n    873         return self._base_repr_(html=False, max_width=None)\r\n    874\r\n--> 875     def __unicode__(self):\r\n    876         return '\\n'.join(self.pformat())\r\n    877     if not six.PY2:\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _base_repr_(self, html, descr_vals, max_width, tableid, show_dtype, max_lines, tableclass)\r\n    860             max_lines=max_lines, tableclass=tableclass)\r\n    861\r\n--> 862         out = descr + '\\n'.join(data_lines)\r\n    863         if six.PY2 and isinstance(out, six.text_type):\r\n    864             out = out.encode('utf-8')\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/pprint.pyc in _pformat_table(self, table, max_lines, max_width, show_name, show_unit, show_dtype, html, tableid, tableclass, align)\r\n    539\r\n    540         if not cols:\r\n--> 541             return ['<No columns>'], {'show_length': False}\r\n    542\r\n    543         # Use the values for the last column since they are all the same\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/pprint.pyc in _pformat_col(self, col, max_lines, show_name, show_unit, show_dtype, show_length, html, align)\r\n    252\r\n    253         if html:\r\n--> 254             from ..utils.xml.writer import xml_escape\r\n    255             n_header = outs['n_header']\r\n    256             for i, col_str in enumerate(col_strs):\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/pprint.pyc in _pformat_col_iter(self, col, max_lines, show_name, show_unit, outs, show_dtype, show_length)\r\n    450                 yield col_str\r\n    451\r\n--> 452         outs['show_length'] = show_length\r\n    453         outs['n_header'] = n_header\r\n    454         outs['i_centers'] = i_centers\r\n\r\nastropy/table/_column_mixins.pyx in astropy.table._column_mixins._ColumnGetitemShim.__getitem__()\r\n\r\nastropy/table/_column_mixins.pyx in astropy.table._column_mixins.base_getitem()\r\n\r\nastropy/table/_column_mixins.pyx in astropy.table._column_mixins.column_getitem()\r\n\r\nIndexError: index 0 is out of bounds for axis 1 with size 0\r\n\r\n---------------------------------------------------------------------------\r\nIndexError                                Traceback (most recent call last)\r\n/usr/local/lib/python2.7/dist-packages/IPython/core/formatters.pyc in __call__(self, obj)\r\n    336             method = get_real_method(obj, self.print_method)\r\n    337             if method is not None:\r\n--> 338                 return method()\r\n    339             return None\r\n    340         else:\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _repr_html_(self)\r\n    870                                 tableclass=conf.default_notebook_table_class)\r\n    871\r\n--> 872     def __repr__(self):\r\n    873         return self._base_repr_(html=False, max_width=None)\r\n    874\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _base_repr_(self, html, descr_vals, max_width, tableid, show_dtype, max_lines, tableclass)\r\n    860             max_lines=max_lines, tableclass=tableclass)\r\n    861\r\n--> 862         out = descr + '\\n'.join(data_lines)\r\n    863         if six.PY2 and isinstance(out, six.text_type):\r\n    864             out = out.encode('utf-8')\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/pprint.pyc in _pformat_table(self, table, max_lines, max_width, show_name, show_unit, show_dtype, html, tableid, tableclass, align)\r\n    539\r\n    540         if not cols:\r\n--> 541             return ['<No columns>'], {'show_length': False}\r\n    542\r\n    543         # Use the values for the last column since they are all the same\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/pprint.pyc in _pformat_col(self, col, max_lines, show_name, show_unit, show_dtype, show_length, html, align)\r\n    252\r\n    253         if html:\r\n--> 254             from ..utils.xml.writer import xml_escape\r\n    255             n_header = outs['n_header']\r\n    256             for i, col_str in enumerate(col_strs):\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/pprint.pyc in _pformat_col_iter(self, col, max_lines, show_name, show_unit, outs, show_dtype, show_length)\r\n    450                 yield col_str\r\n    451\r\n--> 452         outs['show_length'] = show_length\r\n    453         outs['n_header'] = n_header\r\n    454         outs['i_centers'] = i_centers\r\n\r\nastropy/table/_column_mixins.pyx in astropy.table._column_mixins._ColumnGetitemShim.__getitem__()\r\n\r\nastropy/table/_column_mixins.pyx in astropy.table._column_mixins.base_getitem()\r\n\r\nastropy/table/_column_mixins.pyx in astropy.table._column_mixins.column_getitem()\r\n\r\nIndexError: index 0 is out of bounds for axis 1 with size 0\r\n\r\nAstroPy  on behalf of Derek Homeier \r\n[Reply All]\r\n \r\n18 April 2018 09:54\r\nOn 17 Apr 2018, at 9:58 pm, Jordan Alexander  wrote:\r\n> \r\n>> Can you read hdulist[1].data (which has a zero width column as well)?\r\n> \r\n> fails in the same way, as you predicted, given the zero width column.\r\n> \r\n> As suggested, I will file this issue with https://github.com/astropy/astropy/issues. \r\n> \r\n> The FITS file in question with tables containing zero-width columns that generates this issue is ~0.5Gbytes, so will try to find a smaller-sized example file....\r\n> \r\n> Will follow-up with your untested work-around, Tom...\r\n\r\nThanks for the follow-up, Jordan!\r\n\r\nCould you make one more test and check what happens if you try\r\n\r\ntbl = Table(np.array(hdulist[1].data)) ?\r\n\r\n- hdulist[1].data is a FITS_rec, which is basically a container for a numpy record array,\r\nbut I am wondering if casting it to a regular (structured) ndarray will let it proceed as far\r\nas creating the table, as it did in my tests.\r\n\r\nFor the example file, you might try\r\n\r\nhdulist[:2].writeto(‘ValueError.fits’)\r\n\r\nwhich should create a file from just the 0th and 1st HDU, sufficient to demonstrate the issue\r\n(unless it already fails along the way on the 0-dim column…).\r\n\r\nBest,\r\n                                        Derek\r\n\r\n_______________________________________________\r\nAstroPy mailing list\r\nAstroPy@python.org\r\nhttps://mail.python.org/mailman/listinfo/astropy\r\n\r\nAstroPy on behalf of Jordan Alexander \r\n[Reply All]\r\n \r\n18 April 2018 07:59\r\n> On 17 April 2018 at 13:52, Derek Homeier  wrote:\r\n>Jordan, then I’d also suggest to file an issue on https://github.com/astropy/astropy/issues\r\n>if you could provide an example file. I guess reading the HDU directly into a Table as\r\n\r\n>dat = Table.read('WS001H.0.bin0000.source0000.FITS’, hdu=8)\r\n\r\n>fails in the same way?\r\n\r\n>Cheers,\r\n>                                       Derek\r\n\r\nThanks for responding, Derek, Daniel, and Tom.\r\n\r\nYes, it fails in the same way, as shown below.\r\n\r\nAlso,\r\n\r\n> Can you read hdulist[1].data (which has a zero width column as well)?\r\n\r\nfails in the same way, as you predicted, given the zero width column.\r\n\r\nAs suggested, I will file this issue with https://github.com/astropy/astropy/issues. \r\n\r\nThe FITS file in question with tables containing zero-width columns that generates this issue is ~0.5Gbytes, so will try to find a smaller-sized example file....\r\n\r\nWill follow-up with your untested work-around, Tom...\r\n\r\n---------\r\n\r\nTable.read(\"WS001H.0.bin0000.source0000.FITS\", hdu=8)\r\n\r\n<generates>\r\n\r\nValueError                                Traceback (most recent call last)\r\n<ipython-input-92-aecce75bbb33> in <module>()\r\n      3 #Table(hdulist[1].data)\r\n      4 #Table(hdulist[8].data)\r\n----> 5 Table.read(\"WS001H.0.bin0000.source0000.FITS\", hdu=8)\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in read(cls, *args, **kwargs)\r\n   2519         out = io_registry.read(cls, *args, **kwargs)\r\n   2520         # For some readers (e.g., ascii.ecsv), the returned `out` class is not\r\n-> 2521         # guaranteed to be the same as the desired output `cls`.  If so,\r\n   2522         # try coercing to desired class without copying (io.registry.read\r\n   2523         # would normally do a copy).  The normal case here is swapping\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/io/registry.pyc in read(cls, *args, **kwargs)\r\n    529\r\n    530         reader = get_reader(format, cls)\r\n--> 531         data = reader(*args, **kwargs)\r\n    532\r\n    533         if not isinstance(data, cls):\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/io/fits/connect.pyc in read_table_fits(input, hdu)\r\n    134\r\n    135         try:\r\n--> 136             return read_table_fits(hdulist, hdu=hdu)\r\n    137         finally:\r\n    138             hdulist.close()\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/io/fits/connect.pyc in read_table_fits(input, hdu)\r\n    146\r\n    147     # Convert to an astropy.table.Table object\r\n--> 148     t = Table(table.data, masked=masked)\r\n    149\r\n    150     # Copy over null values if needed\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in __init__(self, data, masked, names, dtype, meta, copy, rows, copy_indices, **kwargs)\r\n    411         init_func(data, names, dtype, n_cols, copy)\r\n    412\r\n--> 413         # Whatever happens above, the masked property should be set to a boolean\r\n    414         if type(self.masked) is not bool:\r\n    415             raise TypeError(\"masked property has not been set to True or False\")\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _init_from_ndarray(self, data, names, dtype, n_cols, copy)\r\n    700             self._init_from_list(cols, names, dtype, n_cols, copy)\r\n    701         else:\r\n--> 702             dtype = [(name, col.dtype, col.shape[1:]) for name, col in zip(names, cols)]\r\n    703             newdata = data.view(dtype).ravel()\r\n    704             columns = self.TableColumns()\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _init_from_list(self, data, names, dtype, n_cols, copy)\r\n    684         self._init_from_cols(cols)\r\n    685\r\n--> 686     def _init_from_ndarray(self, data, names, dtype, n_cols, copy):\r\n    687         \"\"\"Initialize table from an ndarray structured array\"\"\"\r\n    688\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _init_from_cols(self, cols)\r\n    749                              .format(lengths))\r\n    750\r\n--> 751         # Set the table masking\r\n    752         self._set_masked_from_cols(cols)\r\n    753\r\n\r\nValueError: Inconsistent data column lengths: set([0, 27645])\r\n\r\n_______________________________________________\r\nAstroPy mailing list\r\nAstroPy@python.org\r\nhttps://mail.python.org/mailman/listinfo/astropy\r\nJordan Alexander\r\n[Reply All]\r\nSent Items\r\n18 April 2018 07:58\r\n> On 17 April 2018 at 13:52, Derek Homeier wrote:\r\n>Jordan, then I’d also suggest to file an issue on https://github.com/astropy/astropy/issues\r\n>if you could provide an example file. I guess reading the HDU directly into a Table as\r\n\r\n>dat = Table.read('WS001H.0.bin0000.source0000.FITS’, hdu=8)\r\n\r\n>fails in the same way?\r\n\r\n>Cheers,\r\n>                                       Derek\r\n\r\nThanks for responding, Derek, Daniel, and Tom.\r\n\r\nYes, it fails in the same way, as shown below.\r\n\r\nAlso,\r\n\r\n> Can you read hdulist[1].data (which has a zero width column as well)?\r\n\r\nfails in the same way, as you predicted, given the zero width column.\r\n\r\nAs suggested, I will file this issue with https://github.com/astropy/astropy/issues. \r\n\r\nThe FITS file in question with tables containing zero-width columns that generates this issue is ~0.5Gbytes, so will try to find a smaller-sized example file....\r\n\r\nWill follow-up with your untested work-around, Tom...\r\n\r\n---------\r\n\r\nTable.read(\"WS001H.0.bin0000.source0000.FITS\", hdu=8)\r\n\r\n<generates>\r\n\r\nValueError                                Traceback (most recent call last)\r\n<ipython-input-92-aecce75bbb33> in <module>()\r\n      3 #Table(hdulist[1].data)\r\n      4 #Table(hdulist[8].data)\r\n----> 5 Table.read(\"WS001H.0.bin0000.source0000.FITS\", hdu=8)\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in read(cls, *args, **kwargs)\r\n   2519         out = io_registry.read(cls, *args, **kwargs)\r\n   2520         # For some readers (e.g., ascii.ecsv), the returned `out` class is not\r\n-> 2521         # guaranteed to be the same as the desired output `cls`.  If so,\r\n   2522         # try coercing to desired class without copying (io.registry.read\r\n   2523         # would normally do a copy).  The normal case here is swapping\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/io/registry.pyc in read(cls, *args, **kwargs)\r\n    529\r\n    530         reader = get_reader(format, cls)\r\n--> 531         data = reader(*args, **kwargs)\r\n    532\r\n    533         if not isinstance(data, cls):\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/io/fits/connect.pyc in read_table_fits(input, hdu)\r\n    134\r\n    135         try:\r\n--> 136             return read_table_fits(hdulist, hdu=hdu)\r\n    137         finally:\r\n    138             hdulist.close()\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/io/fits/connect.pyc in read_table_fits(input, hdu)\r\n    146\r\n    147     # Convert to an astropy.table.Table object\r\n--> 148     t = Table(table.data, masked=masked)\r\n    149\r\n    150     # Copy over null values if needed\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in __init__(self, data, masked, names, dtype, meta, copy, rows, copy_indices, **kwargs)\r\n    411         init_func(data, names, dtype, n_cols, copy)\r\n    412\r\n--> 413         # Whatever happens above, the masked property should be set to a boolean\r\n    414         if type(self.masked) is not bool:\r\n    415             raise TypeError(\"masked property has not been set to True or False\")\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _init_from_ndarray(self, data, names, dtype, n_cols, copy)\r\n    700             self._init_from_list(cols, names, dtype, n_cols, copy)\r\n    701         else:\r\n--> 702             dtype = [(name, col.dtype, col.shape[1:]) for name, col in zip(names, cols)]\r\n    703             newdata = data.view(dtype).ravel()\r\n    704             columns = self.TableColumns()\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _init_from_list(self, data, names, dtype, n_cols, copy)\r\n    684         self._init_from_cols(cols)\r\n    685\r\n--> 686     def _init_from_ndarray(self, data, names, dtype, n_cols, copy):\r\n    687         \"\"\"Initialize table from an ndarray structured array\"\"\"\r\n    688\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _init_from_cols(self, cols)\r\n    749                              .format(lengths))\r\n    750\r\n--> 751         # Set the table masking\r\n    752         self._set_masked_from_cols(cols)\r\n    753\r\n\r\nValueError: Inconsistent data column lengths: set([0, 27645])\r\n\r\n\r\nAstroPy [astropy-bounces+] on behalf of Derek Homeier\r\n[Reply All]\r\n \r\n18 April 2018 01:49\r\nOn 17. Apr 2018, at 3:38 PM, Daniel Evans wrote:\r\n> \r\n> > [...] column 12 has zero width, i.e. shape (0, nrow). If that’s actually allowed by the FITS standard\r\n> \r\n> From my non-expert reading of the standard, v4 Sect. 7.3.1, it looks to be explicitly permitted:\r\n> \r\n> \"The repeat count r is the ASCII representation of a non-negative integer specifying the number of elements in field n. The default value of r is 1; the repeat count need not be present if it has the default value. A zero element count, indicating an empty field, is permitted.\"\r\n> \r\n> Regards,\r\n> Daniel\r\n> \r\n> On 17 April 2018 at 13:52, Derek Homeier wrote:\r\n> On 17. Apr 2018, at 12:53 PM, Jordan Alexander wrote:\r\n> > \r\n> > First, thank you astropy for this outstanding package.  It played an important role in the completion of my PhD; much respect :)\r\n> > \r\n> > Using python 2.7.12 &  astropy 2.0.5 and following Lia R. Corrales' useful tutorial,\r\n> > \r\n> > http://www.astropy.org/astropy-tutorials/FITS-tables.html\r\n> > \r\n> > I am trying to access data stored in a FITS table, which generates \r\n> > \r\n> > ValueError: Inconsistent data column lengths: set([0, 27645])\"\r\n\r\nJordan, then I’d also suggest to file an issue on https://github.com/astropy/astropy/issues\r\nif you could provide an example file. I guess reading the HDU directly into a Table as\r\n\r\ndat = Table.read('WS001H.0.bin0000.source0000.FITS’, hdu=8)\r\n\r\nfails in the same way?\r\n\r\nCheers,\r\n                                        Derek\r\n\r\n\r\n_______________________________________________\r\nAstroPy mailing list\r\nAstroPy@python.org\r\nhttps://mail.python.org/mailman/listinfo/astropy\r\nAstroPy  on behalf of Daniel Evans\r\n[Reply All]\r\n \r\n18 April 2018 01:40\r\n> [...] column 12 has zero width, i.e. shape (0, nrow). If that’s actually allowed by the FITS standard\r\n\r\nFrom my non-expert reading of the standard, v4 Sect. 7.3.1, it looks to be explicitly permitted:\r\n\r\n\"The repeat count r is the ASCII representation of a non-negative integer specifying the number of elements in field n. The default value of r is 1; the repeat count need not be present if it has the default value. A zero element count, indicating an empty field, is permitted.\"\r\n\r\nRegards,\r\nDaniel\r\nDerek Homeier\r\nOn 17. Apr 2018, at 12:53 PM, Jordan Alexander wrote: First, thank you astropy for this outstanding package. It played an important role in the completion of my PhD; much respect :) Using python 2.7.12 & astropy 2.0.5 and following\r\n01:28\r\nDerek Homeier\r\nOn 17. Apr 2018, at 2:45 PM, Aldcroft, Thomas wrote: That particular HDU (#8) has a table with a column that has data type 0J. This the source of the problem. I see that numpy arrays can have a length with zero-width (e.g. shape=(10,\r\n01:24\r\n\r\n-------------\r\n\r\nAstroPy on behalf of Aldcroft, Thomas \r\n[Reply All]\r\n \r\n18 April 2018 00:47\r\nHi Jordan,\r\n\r\nThat particular HDU (#8) has a table with a column that has data type 0J.  This the source of the problem.  I see that numpy arrays can have a length with zero-width (e.g. shape=(10, 0)), so in theory astropy should be able to support this.  If you can file this as an issue on GitHub that would be very helpful.\r\n\r\nIn the meantime something like this might work (untested) to just skip that column:\r\n\r\ndat = hdulist[8].data\r\nnames = [name for name in dat.dtype.names if name != 'col_with_0J']\r\ncols = [dat[name] for name in names]\r\n\r\ntbl = Table(cols, names=names)\r\n\r\n- Tom\r\n\r\n---------------\r\n\r\nAstroPy on behalf of Jordan Alexander \r\n[Reply All]\r\nInbox, Sent Items\r\n17 April 2018 22:59\r\n\r\nFirst, thank you astropy for this outstanding package.  It played an important role in the completion of my PhD; much respect :)\r\n\r\nUsing python 2.7.12 &  astropy 2.0.5 and following Lia R. Corrales' useful tutorial,\r\n\r\nhttp://www.astropy.org/astropy-tutorials/FITS-tables.html\r\n\r\nI am trying to access data stored in a FITS table, which generates\r\n\r\nValueError: Inconsistent data column lengths: set([0, 27645])\"\r\n\r\nBelow are my steps and intermediate results that leads to this error...\r\n\r\nCan you please help here, astropy@python.org?\r\n\r\nP.S. I am able to access other tables in the following FITS file, just not the one I am interested in...\r\n\r\n--------\r\n\r\nfrom astropy.io import fits\r\n\r\nfrom astropy.table import Table\r\n\r\nhdulist = fits.open('WS001H.0.bin0000.source0000.FITS')\r\n\r\nhdulist.info()\r\n\r\n<generates the following output...>\r\n\r\nFilename: WS001H.0.bin0000.source0000.FITS\r\nNo.    Name      Ver    Type      Cards   Dimensions   Format\r\n  0  PRIMARY       1 GroupsHDU       51   ()      0 Groups  0 Parameters\r\n  1  ARRAY_GEOMETRY    1 BinTableHDU     53   2R x 7C   [8A, 3D, 3E, 0D, 1J, 1J, 3E]   \r\n  2  SOURCE        1 BinTableHDU     89   3R x 26C   [1J, 16A, 1J, 4A, 1J, 8E, 8E, 8E, 8E, 8E, 8D, 1D, 1D, 8A, 1D, 1D, 8D, 8A, 8A, 8D, 1D, 1D, 1E, 1D, 1D, 1D]   \r\n  3  ANTENNA       1 BinTableHDU     52   18R x 13C   [1D, 1E, 8A, 1J, 1J, 1J, 1J, 1A, 8E, 8E, 1A, 8E, 8E]   \r\n  4  FREQUENCY     1 BinTableHDU     35   1R x 6C   [1J, 8D, 8E, 8E, 8J, 8J]   \r\n  5  INTERFEROMETER_MODEL    1 BinTableHDU     83   946R x 20C   [1D, 1E, 1J, 1J, 1J, 1J, 1E, 8E, 48D, 6D, 48D, 6D, 1E, 1E, 48D, 6D, 48D, 6D, 1E, 1E]   \r\n  6  CALC          1 BinTableHDU     75   5R x 11C   ['1D', '1D', '1D', '1D', '1A', '2D', '1A', '1D', '1D', '1D', '1D']   \r\n  7  MODEL_COMPS    1 BinTableHDU     86   946R x 21C   ['1D', '1J', '1J', '1J', '1J', '1D', '1D', '1D', '1D', '1D', '1D', '8E', '8E', '1E', '1E', '1D', '1D', '8E', '8E', '1E', '1E']   \r\n  8  UV_DATA       1 BinTableHDU     93   27645R x 13C   ['1E', '1E', '1E', '1D', '1D', '1J', '1J', '1J', '1J', '1E', '32E', '0J', '4096E']   \r\n  9  PHASE-CAL     1 BinTableHDU     61   2406R x 17C   [1D, 1E, 1J, 1J, 1J, 1J, 1D, 32E, 16D, 16E, 16E, 16E, 32E, 16D, 16E, 16E, 16E]   \r\n 10  GAIN_CURVE    1 BinTableHDU     62   0R x 19C   [1J, 1J, 1J, 8J, 8J, 8J, 8J, 8E, 48E, 48E, 8E, 8J, 8J, 8J, 8J, 8E, 48E, 48E, 8E]   \r\n\r\n\r\nTable(hdulist[8].data)\r\n\r\n<generates...>\r\n\r\nValueError                                Traceback (most recent call last)\r\n<ipython-input-82-fca4b3ff146b> in <module>()\r\n      1 hdulist.info()\r\n----> 2 Table(hdulist[8].data)\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in __init__(self, data, masked, names, dtype, meta, copy, rows, copy_indices, **kwargs)\r\n    411         init_func(data, names, dtype, n_cols, copy)\r\n    412 \r\n--> 413         # Whatever happens above, the masked property should be set to a boolean\r\n    414         if type(self.masked) is not bool:\r\n    415             raise TypeError(\"masked property has not been set to True or False\")\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _init_from_ndarray(self, data, names, dtype, n_cols, copy)\r\n    700             self._init_from_list(cols, names, dtype, n_cols, copy)\r\n    701         else:\r\n--> 702             dtype = [(name, col.dtype, col.shape[1:]) for name, col in zip(names, cols)]\r\n    703             newdata = data.view(dtype).ravel()\r\n    704             columns = self.TableColumns()\r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _init_from_list(self, data, names, dtype, n_cols, copy)\r\n    684         self._init_from_cols(cols)\r\n    685 \r\n--> 686     def _init_from_ndarray(self, data, names, dtype, n_cols, copy):\r\n    687         \"\"\"Initialize table from an ndarray structured array\"\"\"\r\n    688 \r\n\r\n/usr/local/lib/python2.7/dist-packages/astropy/table/table.pyc in _init_from_cols(self, cols)\r\n    749                              .format(lengths))\r\n    750 \r\n--> 751         # Set the table masking\r\n    752         self._set_masked_from_cols(cols)\r\n    753 \r\n\r\nValueError: Inconsistent data column lengths: set([0, 27645])"},"comment":{"url":"https://api.github.com/repos/astropy/astropy/issues/comments/382412198","html_url":"https://github.com/astropy/astropy/issues/7386#issuecomment-382412198","issue_url":"https://api.github.com/repos/astropy/astropy/issues/7386","id":382412198,"user":{"login":"dhomeier","id":709020,"avatar_url":"https://avatars2.githubusercontent.com/u/709020?v=4","gravatar_id":"","url":"https://api.github.com/users/dhomeier","html_url":"https://github.com/dhomeier","followers_url":"https://api.github.com/users/dhomeier/followers","following_url":"https://api.github.com/users/dhomeier/following{/other_user}","gists_url":"https://api.github.com/users/dhomeier/gists{/gist_id}","starred_url":"https://api.github.com/users/dhomeier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhomeier/subscriptions","organizations_url":"https://api.github.com/users/dhomeier/orgs","repos_url":"https://api.github.com/users/dhomeier/repos","events_url":"https://api.github.com/users/dhomeier/events{/privacy}","received_events_url":"https://api.github.com/users/dhomeier/received_events","type":"User","site_admin":false},"created_at":"2018-04-18T14:44:41Z","updated_at":"2018-04-18T14:44:41Z","author_association":"CONTRIBUTOR","body":"Creating a smaller test case for this, at least part of the issue is a general problem of `astropy.table` dealing with shape-0 columns:\r\n```\r\n>>> a = np.ones(shape=(5,), dtype=[ ('W', 'f8'), ('FP', '4f4'), ('eF', '0i4')])\r\n>>> t1 = Table(a)\r\n>>> t1.colnames\r\n['W', 'FP', 'eF']\r\n>>> t1['FP'].pprint()\r\n  FP [4]  \r\n----------\r\n1.0 .. 1.0\r\n1.0 .. 1.0\r\n1.0 .. 1.0\r\n1.0 .. 1.0\r\n1.0 .. 1.0\r\n\r\nt1['eF'].pprint()\r\n---------------------------------------------------------------------------\r\nIndexError                                Traceback (most recent call last)\r\n<ipython-input-159-a95764a5b430> in <module>()\r\n----> 1 t1['eF'].pprint()\r\n\r\n/sw/lib/python3.6/site-packages/astropy/table/column.py in pprint(self, max_lines, show_name, show_unit, show_dtype)\r\n    552           q : quit browsing\r\n    553           h : print this help\r\n--> 554 \r\n    555         Parameters\r\n    556         ----------\r\n\r\n/sw/lib/python3.6/site-packages/astropy/table/pprint.py in _pformat_col(self, col, max_lines, show_name, show_unit, show_dtype, show_length, html, align)\r\n    243         outs = {}  # Some values from _pformat_col_iter iterator that are needed here\r\n    244         col_strs_iter = self._pformat_col_iter(col, max_lines, show_name=show_name,\r\n--> 245                                                show_unit=show_unit,\r\n    246                                                show_dtype=show_dtype,\r\n    247                                                show_length=show_length,\r\n\r\n/sw/lib/python3.6/site-packages/astropy/table/pprint.py in _pformat_col_iter(self, col, max_lines, show_name, show_unit, outs, show_dtype, show_length)\r\n    449                     col_str = format_func(col_format, col[i])\r\n    450                 yield col_str\r\n--> 451 \r\n    452         outs['show_length'] = show_length\r\n    453         outs['n_header'] = n_header\r\n\r\n/sw/lib/python3.6/site-packages/astropy/table/pprint.py in format_col_str(idx)\r\n    437             else:\r\n    438                 if multidims:\r\n--> 439                     # Prevents columns like Column(data=[[(1,)],[(2,)]], name='a')\r\n    440                     # with shape (n,1,...,1) from being printed as if there was\r\n    441                     # more than one element in a row\r\n\r\nastropy/table/_column_mixins.pyx in astropy.table._column_mixins._ColumnGetitemShim.__getitem__()\r\n\r\nastropy/table/_column_mixins.pyx in astropy.table._column_mixins.base_getitem()\r\n\r\nastropy/table/_column_mixins.pyx in astropy.table._column_mixins.column_getitem()\r\n\r\nIndexError: index 0 is out of bounds for axis 1 with size 0\r\n```\r\nThe same behaviour occurs when first manually creating a `FITS_rec` out of the array as\r\n```\r\nt2 = Table(fits.FITS_rec(a))\r\n```\r\n\r\nHowever when reading in such an array from a FITS file, an error is already raised on creating the table, apparently on verifying the Column types:\r\n```\r\n>>> hdu0 = fits.open('https://heibox.uni-heidelberg.de/f/91f88ee892/?raw=1')\r\n>>> hdu0.info()\r\nFilename: zerocol.fits\r\nNo.    Name      Ver    Type      Cards   Dimensions   Format\r\n  0  PRIMARY       1 PrimaryHDU       5   ()      \r\n  1                1 BinTableHDU     37   61751R x 3C   ['E', 'E', '0E']\r\n\r\n>>> t3 = Table(hdu0[1].data)\r\n/sw/lib/python3.6/site-packages/astropy/io/fits/fitsrec.py:684: UserWarning: Field 'F_err' has a repeat count of 0 in its format code, indicating an empty field.\r\n  if format.dtype.itemsize == 0:\r\n---------------------------------------------------------------------------\r\nValueError                                Traceback (most recent call last)\r\n<ipython-input-213-9aee329d209e> in <module>()\r\n----> 1 t3 = apt.Table(hdu0[1].data)\r\n\r\n/sw/lib/python3.6/site-packages/astropy/table/table.py in __init__(self, data, masked, names, dtype, meta, copy, rows, copy_indices, **kwargs)\r\n    406         names = [fix_column_name(name) for name in names]\r\n    407 \r\n--> 408         self._check_names_dtype(names, dtype, n_cols)\r\n    409 \r\n    410         # Finally do the real initialization\r\n\r\n/sw/lib/python3.6/site-packages/astropy/table/table.py in _init_from_ndarray(self, data, names, dtype, n_cols, copy)\r\n    703             newdata = data.view(dtype).ravel()\r\n    704             columns = self.TableColumns()\r\n--> 705 \r\n    706             for name in names:\r\n    707                 columns[name] = self.ColumnClass(name=name, data=newdata[name])\r\n\r\n/sw/lib/python3.6/site-packages/astropy/table/table.py in _init_from_list(self, data, names, dtype, n_cols, copy)\r\n    687         \"\"\"Initialize table from an ndarray structured array\"\"\"\r\n    688 \r\n--> 689         data_names = data.dtype.names or _auto_names(n_cols)\r\n    690         struct = data.dtype.names is not None\r\n    691         names = [name or data_names[i] for i, name in enumerate(names)]\r\n\r\n/sw/lib/python3.6/site-packages/astropy/table/table.py in _init_from_cols(self, cols)\r\n    752         self._set_masked_from_cols(cols)\r\n    753 \r\n--> 754         # Make sure that all Column-based objects have correct class.  For\r\n    755         # plain Table this is self.ColumnClass, but for instance QTable will\r\n    756         # convert columns with units to a Quantity mixin.\r\n\r\nValueError: Inconsistent data column lengths: {0, 61751}\r\n```\r\nCasting the data first to an array will again allow the creation of the table, but with the same issues as in the first example:\r\n```\r\n>>> t3 = apt.Table(np.array(hdu1[1].data))\r\n>>> t3['Wavelength']\r\n<Column name='Wavelength' dtype='float32' length=61751>\r\n  5000.0\r\n  5000.5\r\n  5001.0\r\n  5001.5\r\n  5002.0\r\n  5002.5\r\n  5003.0\r\n  5003.5\r\n  5004.0\r\n  5004.5\r\n  5005.0\r\n     ...\r\n299550.0\r\n299600.0\r\n299650.0\r\n299700.0\r\n299750.0\r\n299800.0\r\n299850.0\r\n299900.0\r\n299950.0\r\n300000.0\r\n\r\n>>> t3\r\n---------------------------------------------------------------------------\r\nIndexError                                Traceback (most recent call last)\r\n/sw/lib/python3.6/site-packages/IPython/core/formatters.py in __call__(self, obj)\r\n    700                 type_pprinters=self.type_printers,\r\n    701                 deferred_pprinters=self.deferred_printers)\r\n--> 702             printer.pretty(obj)\r\n    703             printer.flush()\r\n    704             return stream.getvalue()\r\n\r\n/sw/lib/python3.6/site-packages/IPython/lib/pretty.py in pretty(self, obj)\r\n    393                             if callable(meth):\r\n    394                                 return meth(obj, self, cycle)\r\n--> 395             return _default_pprint(obj, self, cycle)\r\n    396         finally:\r\n    397             self.end_group()\r\n\r\n/sw/lib/python3.6/site-packages/IPython/lib/pretty.py in _default_pprint(obj, p, cycle)\r\n    508     if _safe_getattr(klass, '__repr__', None) is not object.__repr__:\r\n    509         # A user-provided repr. Find newlines and replace them with p.break_()\r\n--> 510         _repr_pprint(obj, p, cycle)\r\n    511         return\r\n    512     p.begin_group(1, '<')\r\n\r\n/sw/lib/python3.6/site-packages/IPython/lib/pretty.py in _repr_pprint(obj, p, cycle)\r\n    699     \"\"\"A pprint that just redirects to the normal repr function.\"\"\"\r\n    700     # Find newlines and replace them with p.break_()\r\n--> 701     output = repr(obj)\r\n    702     for idx,output_line in enumerate(output.splitlines()):\r\n    703         if idx:\r\n\r\n/sw/lib/python3.6/site-packages/astropy/table/table.py in __repr__(self)\r\n    875     def __unicode__(self):\r\n    876         return '\\n'.join(self.pformat())\r\n--> 877     if not six.PY2:\r\n    878         __str__ = __unicode__\r\n    879 \r\n\r\n/sw/lib/python3.6/site-packages/astropy/table/table.py in _base_repr_(self, html, descr_vals, max_width, tableid, show_dtype, max_lines, tableclass)\r\n    864             out = out.encode('utf-8')\r\n    865 \r\n--> 866         return out\r\n    867 \r\n    868     def _repr_html_(self):\r\n\r\n/sw/lib/python3.6/site-packages/astropy/table/pprint.py in _pformat_table(self, table, max_lines, max_width, show_name, show_unit, show_dtype, html, tableid, tableclass, align)\r\n    539 \r\n    540         if not cols:\r\n--> 541             return ['<No columns>'], {'show_length': False}\r\n    542 \r\n    543         # Use the values for the last column since they are all the same\r\n\r\n/sw/lib/python3.6/site-packages/astropy/table/pprint.py in _pformat_col(self, col, max_lines, show_name, show_unit, show_dtype, show_length, html, align)\r\n    243         outs = {}  # Some values from _pformat_col_iter iterator that are needed here\r\n    244         col_strs_iter = self._pformat_col_iter(col, max_lines, show_name=show_name,\r\n--> 245                                                show_unit=show_unit,\r\n    246                                                show_dtype=show_dtype,\r\n    247                                                show_length=show_length,\r\n\r\n/sw/lib/python3.6/site-packages/astropy/table/pprint.py in _pformat_col_iter(self, col, max_lines, show_name, show_unit, outs, show_dtype, show_length)\r\n    449                     col_str = format_func(col_format, col[i])\r\n    450                 yield col_str\r\n--> 451 \r\n    452         outs['show_length'] = show_length\r\n    453         outs['n_header'] = n_header\r\n\r\n/sw/lib/python3.6/site-packages/astropy/table/pprint.py in format_col_str(idx)\r\n    437             else:\r\n    438                 if multidims:\r\n--> 439                     # Prevents columns like Column(data=[[(1,)],[(2,)]], name='a')\r\n    440                     # with shape (n,1,...,1) from being printed as if there was\r\n    441                     # more than one element in a row\r\n\r\nastropy/table/_column_mixins.pyx in astropy.table._column_mixins._ColumnGetitemShim.__getitem__()\r\n\r\nastropy/table/_column_mixins.pyx in astropy.table._column_mixins.base_getitem()\r\n\r\nastropy/table/_column_mixins.pyx in astropy.table._column_mixins.column_getitem()\r\n\r\nIndexError: index 0 is out of bounds for axis 1 with size 0\r\n```"}}
{"actor":{"display_login":"dhomeier"}}