Developer guide
Getting started
First, clone the repository and install BLIP locally in a virtual environment. Use an editable installation with all development dependencies (includes tests and documentation):
pip install -e .[gpu] --group dev
Run the test suite:
pytest
Build the documentation in HTML format:
cd docs
make html
General architecture
The main pipeline logic is in blip.run_blip.
Data generation is done by an injection, while data
analysis is done by a model. Injections and models are
collections of submodels.
The model is specified by params.model in the configuration file,
whereas the injection is specified by inj.injection.
The submodels are uniquely identified by the raw strings used to specify them in the
config file. See the attributes components and component_names for an injection
or submodels and submodel_names for a model.
Input parameters
The input parameters given in the configuration by the user are parsed
using parse_config and passed around in BLIP as the
ubiquitous dictionaries named params and inj.
Time-frequency grids
In BLIP there are two main time-frequency grids: the one used for data generation, and the one used for data analysis. Throughout the code, the following convention for names specifies which one we are talking about:
Analysis grid |
Simulation grid |
|
|---|---|---|
time chunks |
“segments” (default 1e5) |
“splices” (default 1e4) |
time array (mid-segments) |
|
|
size of segment |
|
|
frequency resolution |
higher ( |
lower ( |
frequency range |
between |
full range excluding DC |
frequency array |
|
|
implementation |
|
Moreover, inside the blip.src.faster_geometry module, a sparse time-frequency
grid is used for the response calculation. The sparse grid is generated by
blip.src.faster_geometry.get_sparse_tf_grid() based on the required dense grid,
which could be either the analysis or the simulation grid.
Response matrices
Response matrices are passed around as attributes in submodels. This is the list of attributes currently used:
response_mat: complex array of shape(3, 3, nfreqs, ntimes), the first two dimensions referring to TDI channels. If the submodel has a parametrized spatial model, this has an additional dimension in the end which is the number of active pixels for pixel models and the number of terms in the spherical harmonic expansion for sph model.fdata_response_mat: in injection submodels, this is the same asresponse_mat, but computed on the analysis time-frequency grid rather than on the simulation grid. This is used for plotting injections together with analysis results. Using this rather thanresponse_matis indicated by a function parameterplot_flagin, e.g.,calculate_response_functions.unconvolved_response_mat: deprecated, usedresponse_matinstead. (Was used for parametrized spatial models, complex array of shape(3, 3, nfreqs, ntimes, npix or nsph)).unconvolved_fdata_response_mat: combination of the two above.summ_response_mat: deprecated, useresponse_matinstead.inj_response_mat: deprecated, useresponse_matinstead.