Closed steven-murray closed 3 months ago
Attention: Patch coverage is 98.89841%
with 9 lines
in your changes are missing coverage. Please review.
Project coverage is 97.24%. Comparing base (
f0cfd8d
) to head (bacc1d0
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This PR does a few things (sorry) in support of defining a nice notebook-based interface for LST-binning.
Bug-Fixes
LST-Bin Configuration File
LSTBinConfiguration
andLSTConfig
classes. The first natively houses the configuration options, and is able to be directly created from a simple TOML file. It also has methods of getting all the file-configuration (i.e. finding matched files, the universal list of antpairs, etc.). The second class (LSTConfig
) can be created by the first, and is more like a static container housing all the configuration (so, the matched files, lst grid etc). It doesn't do any calculations itself, but is meant to be read directly from a HDF5 file.Binning Updates
lst_bin_files_for_baselines
function which was the entry-point for binning up some given files (enabling chunking over baselines controlled by a higher-level function). This function is nice, but most of its inputs need to be constructed outside the function by reading meta-data files and doing appropriate checks (this was done in thelst_bin_files_single_outfile
function). Now that we have a niceconfig
object, it was easy to add a simpler wrapper to thelst_bin_files_for_baselines
function, which is simply thelst_bin_files_from_config
. There you just need to pass the config itself, and a few options, to be able to do the relevant binning (not averaging!).lst_bin_files_from_config
function is a list of UVData objects (one per LST-bin in the output file). It turns out this is a nice fit for output, enabling it to be packaged up in one object.Averaging updates
Metrics Module
A new
metrics
module was added, whose aim is to calculate metrics and stats from the lst-bin outputs.Examples
A full example of using the new code can be found in the lststack notebook in hera_notebook _templates. But to give a flavor, assume
fileconf
is the lst-configuration file created to keep all the alignment info. Then we do:This thing has all the info from all the files, as well as metadata about how the binning was done. The most important part is that you can subselect the bins based on either an LST or output file index:
this will return 2 bins (by default) corresponding to a single outfile. You can get a single bin as well:
To get lst-aligned data, use the very simple function:
The
lst_aligned_uvds
is a list ofUVData
objects that have the format where Ntimes is Nnights (or, more generally, Nintegrations that fit into the lst bin over all nights).