# include "dvomerge.h"

int LoadCatalog (Catalog *catalog, SkyRegion *region, char *filename, char *mode, int Nsecfilt) {

    // set the parameters which guide catalog open/load/create
    catalog[0].filename  = filename;
    catalog[0].Nsecfilt  = Nsecfilt;

    // always load all of the data (if any exists)
    catalog[0].catflags = LOAD_AVES | LOAD_MEAS | LOAD_MISS | LOAD_SECF | LOAD_LENSING | LOAD_LENSOBJ;

    catalog[0].catformat = dvo_catalog_catformat (CATFORMAT);  // set the default catformat from config data
    catalog[0].catmode   = dvo_catalog_catmode (CATMODE);      // set the default catmode from config data

    if (!dvo_catalog_open (catalog, region, VERBOSE, mode)) {
	fprintf (stderr, "ERROR: failure to open catalog file %s\n", filename);
	exit (2);
    }
    return (TRUE);
}
