tablerows_to_2d

marxs.utils.tablerows_to_2d(tab)[source]

Get a 2d array from an input table.

In the table, the data is flattened to a 1d form. The first two columns are x and y, like this: The first column looks like this with many duplicates: [1,1,1,1,1,1,2,2,2,2,2,2,3,3,3, …]. Column B repeats like this: [1,2,3,4,5,6,1,2,3,4,5,6,1,2,3, …].

All remaining columns are data on the same x-y grid, and the grid has to be regular.

Parameters

tabastropy.table.Table

Table as read in. Useful to access units or other meta data.

Returns

x, yastropy.table.Column

Unique entries in first and second column

datnp.array

The remaining outputs are np.arrays of shape (len(x), len(y))