torrance / Casacore.jl

A high level Julia interface to Casacore
MIT License
9 stars 0 forks source link

Allow empty index as shortcut for all colons #4

Closed david-macmahon closed 1 year ago

david-macmahon commented 1 year ago

Indexing into a column to get all data currently requires using as many colons (or 1:N UnitRanges) as there are dimensions. As a convenience, it would be nice if one could use empty indexing to get all data. This also avoids having to know the dimensionality of the data, which can aid exploration of the data format.

Instead of:

antpos = table.ANETNNA[:POSITION][:,:]

one could use:

antpos = table.ANETNNA[:POSITION][]

FWIW, HDF5.jl uses this convention to read data from HDF5 Datasets.

torrance commented 1 year ago

This is in dev now, and will be in v0.2 when released.

david-macmahon commented 1 year ago

Awesome, thanks!