Array2D#
- class gwpy.types.Array2D(
- data: QuantityLike,
- unit: UnitBase | str | None = None,
- x0: QuantityLike | None = None,
- dx: QuantityLike | None = None,
- xindex: QuantityLike | None = None,
- xunit: UnitBase | str | None = None,
- y0: QuantityLike | None = None,
- dy: QuantityLike | None = None,
- yindex: QuantityLike | None = None,
- yunit: UnitBase | str | None = None,
- **kwargs,
Bases:
SeriesA two-dimensional array with metadata.
- Parameters:
- valuearray_like
Input data array.
- unit
Unit, optional Physical unit of these data.
- x0
float,Quantity, optional The starting value for the x-axis of this array.
- dx
float,Quantity, optional The step size for the x-axis of this array.
- xindex
array-like The complete array of x-axis values for this array. This argument takes precedence over
x0anddxso should be given in place of these if relevant, not alongside.- xunit
Unit, optional The unit of the x-axis coordinates. If not given explicitly, it will be taken from any of
dx,x0, orxindex, or set to a boring default.- y0
float,Quantity, optional The starting value for the y-axis of this array.
- dy
float,Quantity, optional The step size for the y-axis of this array.
- yindex
array-like The complete array of y-axis values for this array. This argument takes precedence over
y0anddyso should be given in place of these if relevant, not alongside.- yunit
Unit, optional The unit of the y-axis coordinates. If not given explicitly, it will be taken from any of
dy,y0, oryindex, or set to a boring default.- epoch
LIGOTimeGPS,float,str, optional GPS epoch associated with these data, any input parsable by
to_gpsis fine.- name
str, optional Descriptive title for this array.
- channel
Channel,str, optional Source data stream for these data.
- dtype
dtype, optional Input data type.
- copy
bool, optional Choose to copy the input data to new memory.
- subok
bool, optional Allow passing of sub-classes by the array generator.
- Returns:
- array
Array a new array, with a view of the data, and all associated metadata
- array
Attributes Summary
Return the transpose of this
Array2D.Y-axis sample separation.
Read data into a
Array2D.Write this
Array2Dto a file.Y-axis coordinate of the first data point.
Positions of the data on the y-axis.
Y-axis [low, high) segment encompassed by these data.
Unit of Y-axis index.
Methods Summary
imshow(**kwargs)Render this array on a
Plotusingimshow.pcolormesh(**kwargs)Render this array on a
Plotusingpcolormesh.plot([method])"Render this array on a
Plot.value_at(x, y)Return the value of this
Seriesat the given(x, y)coordinates.Attributes Documentation
- read#
Read data into a
Array2D.Arguments and keywords depend on the output format, see the online documentation for full details for each format, the parameters below are common to most formats.
- Parameters:
- source
str,pathlib.Path,file,list Source of data, any of the following:
open (readable) file object
path to a file
list of files (open or paths)
- format
str, Source format identifier. If not given, the format will be detected if possible. See below for list of acceptable formats.
- kwargs
Other keywords arguments depend on the format, see the online documentation for details.
- source
- Returns:
- data
Array2D
- data
- Raises:
IndexErrorif
sourceis an empty list
- write#
Write this
Array2Dto a file.Arguments and keywords depend on the output format, see the online documentation for full details for each format, the parameters below are common to most formats.
Methods Documentation
- imshow(**kwargs) Plot[source]#
Render this array on a
Plotusingimshow.- Parameters:
- kwargs
All arguments are passed to
plot.
See also
plotFor details of plotting this object.
- pcolormesh(**kwargs) Plot[source]#
Render this array on a
Plotusingpcolormesh.- Parameters:
- kwargs
All arguments are passed to
plot.
See also
plotFor details of plotting this object.
- plot(method: str = 'imshow', **kwargs) Plot[source]#
“Render this array on a
Plot.- Parameters:
See also
gwpy.plot.PlotFor details of plotting this object.