GreenBankObservatory/dysh

`ScanBlock` mapping to its contents

Opened this issue · 1 comments

Feature description
How do we go from the elements in a ScanBlock to scans, IFs and/or polarizations?
If a ScanBlock has four elements, How can a user tell which element corresponds to which scan, IF and/or polarization?
Right now this would require querying each Scan individually for its Scan.scan or the corresponding attribute. This could be simplified for ease of use.

Solution
One possible solution would be to provide a summary listing what is where. For example:

ScanBlock.summary()
{0: {"ifnum":1, "scan":32, "plnum":0, "RESTFREQ": 1420 MHz},
 1: {"ifnum":1, "scan":32, "plnum":1, "RESTFREQ": 1420 MHz},
 2: {"ifnum":2, "scan":32, "plnum":0, "RESTFREQ": 1660 MHz},
 3: {"ifnum":2, "scan":32, "plnum":1, "RESTFREQ": 1660 MHz},
}

It does not need to be a dictionary of dictionaries, but that shows the idea.

I think it should be possible to use a Selection object so that summary and selection resembles that of SDFITS but with fewer columns to choose from. Then methods like timeaverage could take kwargs for selection or use the preselected kwargs like getps & friends.
This is scope expansion so we need to tread carefully, but it enhances usability a lot.