# include "psphot.h"

bool psphotSetThreads () {

    psThreadTask *task = NULL;

    task = psThreadTaskAlloc("PSPHOT_GUESS_MODEL", 5);
    task->function = &psphotGuessModel_Threaded;
    psThreadTaskAdd(task);
    psFree(task);

    task = psThreadTaskAlloc("PSPHOT_MAGNITUDES", 9);
    task->function = &psphotMagnitudes_Threaded;
    psThreadTaskAdd(task);
    psFree(task);

    task = psThreadTaskAlloc("PSPHOT_PSF_WEIGHTS", 3);
    task->function = &psphotPSFWeights_Threaded;
    psThreadTaskAdd(task);
    psFree(task);

    task = psThreadTaskAlloc("PSPHOT_APRESID_MAGS", 7);
    task->function = &psphotApResidMags_Threaded;
    psThreadTaskAdd(task);
    psFree(task);

    task = psThreadTaskAlloc("PSPHOT_SOURCE_STATS", 11);
    task->function = &psphotSourceStats_Threaded;
    psThreadTaskAdd(task);
    psFree(task);

    task = psThreadTaskAlloc("PSPHOT_KRON_ITERATE", 7);
    task->function = &psphotKronIterate_Threaded;
    psThreadTaskAdd(task);
    psFree(task);

    task = psThreadTaskAlloc("PSPHOT_BLEND_FIT", 10);
    task->function = &psphotBlendFit_Threaded;
    psThreadTaskAdd(task);
    psFree(task);

    task = psThreadTaskAlloc("PSPHOT_EXTENDED_FIT", 14);
    task->function = &psphotExtendedSourceFits_Threaded;
    psThreadTaskAdd(task);
    psFree(task);

    task = psThreadTaskAlloc("PSPHOT_EXTENDED_ANALYSIS", 8);
    task->function = &psphotExtendedSourceAnalysis_Threaded;
    psThreadTaskAdd(task);
    psFree(task);

    task = psThreadTaskAlloc("PSPHOT_RADIAL_APERTURES", 6);
    task->function = &psphotRadialApertures_Threaded;
    psThreadTaskAdd(task);
    psFree(task);

    task = psThreadTaskAlloc("PSPHOT_RADIAL_PROFILE_WINGS", 3);
    task->function = &psphotRadialProfileWings_Threaded;
    psThreadTaskAdd(task);
    psFree(task);

    return true;
}
