AlanLoh / nenupy

NenuFAR python package
MIT License
10 stars 6 forks source link

SST_Data not showing all MRs #48

Closed CedricDViou closed 3 years ago

CedricDViou commented 3 years ago

Hi! In https://github.com/AlanLoh/nenupy/blob/master/nenupy/beamlet/sstdata.py:636, only MR ON (used for observation) are read from the fits file (noMROn). But for engineering purposes, one could want to get data from all MR (noMR) monitored by the telescope. Is it possible to give an extra argument to SST_Data (All_MR=True) to allow advanced user to get them all, please? Thanks, Cedric

AlanLoh commented 3 years ago

Hi Cedric.

I have added a hidden keyword option to the SST_Data class: allMAs set to False by default. While allMAs=True the selections and other operations on the SST data can be performed on all the recorded Mini-Arrays, not only those which were ON during the observation (notice the MA 01 on the following example).

>>> from nenupy.beamlet import SST_Data

>>> sst = SST_Data('/SST.fits', allMAs=False)
>>> sst.mas
array([ 0,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16, 17,
       18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
       35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
       52, 53, 54, 55], dtype=int16)

>>> sst = SST_Data('/SST.fits', allMAs=True)
>>> sst.mas
array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
       17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
       34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
       51, 52, 53, 54, 55], dtype=int16)
>>> data = sst.select(ma=1, freqRange=40) # works now!
CedricDViou commented 3 years ago

Thanks! That's exactly what I need! Cheers