#ifndef PM_FPA_ENSEMBLE_H
#define PM_FPA_ENSEMBLE_H

// An ensemble of FPAs: given a bunch of filenames, we want to generate the FPAs that those files represent,
// along with the links from one to the other, and the other to the one.
typedef struct
{
    // The data
    psMetadata *fpa;                    // Focal plane arrays, indexed by FPA.NAME
    psArray *fits;                      // FITS file pointers
    // The translations
    psMetadata *fpaToFits;              // Given an FPA.NAME, what is the FITS file?
    psArray *fitsToFpa;                 // Given a FITS file, what is the FPA?
}
pmFPAEnsemble;

pmFPAEnsemble *pmFPAEnsembleAlloc(psArray *filenames, // Array of file names
                                  pmConfig *config // Configuration
                                 );

// A component of an FPA, represented by the FPA and a view.
typedef struct
{
    pmFPA *fpa;                         // Focal plane array
    pmFPAview *view;                    // View corresponding to the PHU
}
pmFPAComponent;

pmFPAComponent *pmFPAComponentAlloc(pmFPA *fpa, pmFPAview *view);

// Set the file_exist flag for this FPA component
bool pmFPAComponentSetExist(pmFPAComponent *component);

// Check the file_exist flags for this FPA component
bool pmFPAComponentCheckExist(pmFPAComponent *component);

// Copy a component of the source FPA to the target
bool pmFPAComponentCopy(pmFPAComponent *target, pmFPA *source);


#endif
