Skip to content

error in loading a fits table as a DataFrame #182

Description

@Illuminista

I am a rookie but it seems that something is to working as expected

from the manual:

julia> f[2]
File: file.fits
HDU: 2
Type: Table
Rows: 20
Columns: Name  Size  Type    TFORM  
         .... ....
Table HDUs implement the [Tables.jl] interface, so you can load them into other table types, like [DataFrames].
julia> df = DataFrame(f[2])

my case:

julia> f[2]
File:XXX.fits
HDU: 2
Type: Table
Rows: 24
Columns: Name               Size  Type     TFORM  
                    col1                         Float64  D   
.... ....

julia> df=DataFrame(f[2])
ArgumentError: no default `Tables.columns` implementation for type: TableHDU

Stacktrace:
 [1] columns
   @ ~/.julia/packages/Tables/M26tI/src/fallbacks.jl:264 [inlined]
 [2] DataFrame(x::TableHDU; copycols::Nothing)
   @ DataFrames ~/.julia/packages/DataFrames/BM4OQ/src/other/tables.jl:58
 [3] DataFrame(x::TableHDU)
   @ DataFrames ~/.julia/packages/DataFrames/BM4OQ/src/other/tables.jl:49
 [4] top-level scope
   @ In[17]:1
 [5] eval
   @ ./boot.jl:373 [inlined]
 [6] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
   @ Base ./loading.jl:1196

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions