package leigh.astro.app;

import leigh.astro.catalog.CatalogObject;
import leigh.astro.catalog.StellarCatalog;
import leigh.astro.wcstools.Sky2XYExecutor;
import leigh.astro.wcstools.Sky2XYTask;
import leigh.mecha.log.MechaLogger;
import leigh.mecha.log.MechaLoggerFactory;

import java.util.ArrayList;

/**
 * Reference application for calculating astrometric solutions.
 *
 * @author Alex Leigh
 */
public class ObjFindApp {
    private static final MechaLogger logger = MechaLoggerFactory.getLogger(ObjFindApp.class);

    public static void main(String[] args) throws Exception {
        StellarCatalog catalog = new StellarCatalog();
        ArrayList<CatalogObject> skyCoords = new ArrayList<>();
        skyCoords.add(catalog.get("NGC6888"));
        skyCoords.add(catalog.get("NGC7000"));
        skyCoords.add(catalog.get("NGC1234"));

        Sky2XYTask task = new Sky2XYTask(skyCoords);

        Sky2XYExecutor exec = new Sky2XYExecutor("/Users/aleigh/fits/3cb38d47-e4cd-47ff-b431-ffa03197fd5d.fits",
                task.getTmpFile().getAbsolutePath());

        exec.exec(task);

        logger.info("Matched: {}", task.getMatched());

    }
}
