Skip to content

Access table metadata without loading data #166

@LibrEars

Description

@LibrEars

Hello =)

Is it possible to access only the metadata of e.g. Qtables stored in the .asdf file-format without loading the data itself into memory? I tried to use QTable.read() with a find_table key-word but tree["data"]["meta"] will result in an error since the meta-data alone does not represent a table.

In the asdf documentation they state that "Array data remains unloaded until it is explicitly accessed". Therefore I thought it might be possible.

Here is a try using the example-data (QTable) from #118 :

# For the export of example data see issue 118
import asdf

# Is this only loading the meta-data into memory?
with asdf.open("Nr42_fluxgenerator.asdf") as af:
    meta = af["data"].meta

Or is a simple

meta = QTable.read("Nr42_fluxgenerator.asdf").meta 

already doing the job without reading the table data into memory? Otherwise, would it be useful to be implemented into astropy somehow?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions