QueryResponseTable#

class sunpy.net.base_client.QueryResponseTable(data=None, masked=False, names=None, dtype=None, meta=None, copy=True, rows=None, copy_indices=True, units=None, descriptions=None, **kwargs)[source]#

Bases: QTable

A class to represent tables of heterogeneous data.

QTable provides a class for heterogeneous tabular data which can be easily modified, for instance adding columns or new rows.

The QTable class is identical to Table except that columns with an associated unit attribute are converted to Quantity objects.

For more information see:

Parameters:
  • data (numpy ndarray, dict, list, table-like object, optional) – Data to initialize table.

  • masked (bool, optional) – Specify whether the table is masked.

  • names (list, optional) – Specify column names.

  • dtype (list, optional) – Specify column data types.

  • meta (dict, optional) – Metadata associated with the table.

  • copy (bool, optional) – Copy the input data. If the input is a (Q)Table the meta is always copied regardless of the copy parameter. Default is True.

  • rows (numpy ndarray, list of list, optional) – Row-oriented data for table instead of data argument.

  • copy_indices (bool, optional) – Copy any indices in the input data. Default is True.

  • units (list, dict, optional) – List or dict of units to apply to columns.

  • descriptions (list, dict, optional) – List or dict of descriptions to apply to columns.

  • **kwargs (dict, optional) – Additional keyword args when converting table-like object.

Attributes Summary

client

Descriptor to define a custom attribute for a Table subclass.

display_keys

Descriptor to define a custom attribute for a Table subclass.

hide_keys

Descriptor to define a custom attribute for a Table subclass.

size_column

Methods Summary

path_format_keys()

Returns all the names that can be used to format filenames.

show(*cols)

Return a table with only cols present.

total_size()

Returns the total size of all files in a query.

unhide_columns()

Modify this table so that all columns are displayed.

Attributes Documentation

client#

Descriptor to define a custom attribute for a Table subclass.

The value of the TableAttribute will be stored in a dict named __attributes__ that is stored in the table meta. The attribute can be accessed and set in the usual way, and it can be provided when creating the object.

Defining an attribute by this mechanism ensures that it will persist if the table is sliced or serialized, for example as a pickle or ECSV file.

See the MetaAttribute documentation for additional details.

Parameters:

default (object) – Default value for attribute

Examples

>>> from astropy.table import Table, TableAttribute
>>> class MyTable(Table):
...     identifier = TableAttribute(default=1)
>>> t = MyTable(identifier=10)
>>> t.identifier
10
>>> t.meta
OrderedDict([('__attributes__', {'identifier': 10})])
display_keys#

Descriptor to define a custom attribute for a Table subclass.

The value of the TableAttribute will be stored in a dict named __attributes__ that is stored in the table meta. The attribute can be accessed and set in the usual way, and it can be provided when creating the object.

Defining an attribute by this mechanism ensures that it will persist if the table is sliced or serialized, for example as a pickle or ECSV file.

See the MetaAttribute documentation for additional details.

Parameters:

default (object) – Default value for attribute

Examples

>>> from astropy.table import Table, TableAttribute
>>> class MyTable(Table):
...     identifier = TableAttribute(default=1)
>>> t = MyTable(identifier=10)
>>> t.identifier
10
>>> t.meta
OrderedDict([('__attributes__', {'identifier': 10})])
hide_keys#

Descriptor to define a custom attribute for a Table subclass.

The value of the TableAttribute will be stored in a dict named __attributes__ that is stored in the table meta. The attribute can be accessed and set in the usual way, and it can be provided when creating the object.

Defining an attribute by this mechanism ensures that it will persist if the table is sliced or serialized, for example as a pickle or ECSV file.

See the MetaAttribute documentation for additional details.

Parameters:

default (object) – Default value for attribute

Examples

>>> from astropy.table import Table, TableAttribute
>>> class MyTable(Table):
...     identifier = TableAttribute(default=1)
>>> t = MyTable(identifier=10)
>>> t.identifier
10
>>> t.meta
OrderedDict([('__attributes__', {'identifier': 10})])
size_column = None#

Methods Documentation

path_format_keys()[source]#

Returns all the names that can be used to format filenames.

Each one corresponds to a single column in the table, and the format syntax should match the dtype of that column, i.e. for a Time object or a Quantity.

show(*cols)[source]#

Return a table with only cols present.

If no cols are specified, all columns will be shown, including any hidden by default.

This differs slightly from QueryResponseTable[cols] as it allows keys which are not in the table to be requested.

total_size()[source]#

Returns the total size of all files in a query.

Derived classes must set the ‘size_column’ class attribute to make use of this.

unhide_columns()[source]#

Modify this table so that all columns are displayed.