IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 10, 2010, 6:28:51 PM (16 years ago)
Author:
watersc1
Message:

Skycell Summary and stack Association stuff should be finished. I'll merge and do final tests on monday.

Location:
branches/czw_branch/20100519
Files:
7 edited
1 copied

Legend:

Unmodified
Added
Removed
  • branches/czw_branch/20100519

  • branches/czw_branch/20100519/psModules/src/camera/pmFPAfileIO.c

    r27989 r28304  
    751751    file->filename = pmFPAfileName(file, view, config);
    752752    if (!file->filename) {
    753         psError(PS_ERR_IO, true, "Unable to determine filename");
     753        psError(PS_ERR_IO, true, "Unable to determine filename for file %s", file->name);
    754754        return false;
    755755    }
  • branches/czw_branch/20100519/psModules/src/config/pmConfigMask.c

    r25828 r28304  
    88
    99#include "pmConfigMask.h"
     10
     11// Structure to hold the properties of a mask value
     12typedef struct {
     13    char *badMaskName;                  // name for "bad" (i.e., mask me please) pixels
     14    char *fallbackName;                 // Fallback name in case a bad mask name is not defined
     15    psImageMaskType defaultMaskValue;   // Default value in case a bad mask name and its fallback are not defined
     16    bool isBad; // include this value as part of the MASK.VALUE entry (generically bad)
     17} pmConfigMaskInfo;
    1018
    1119static pmConfigMaskInfo masks[] = {
  • branches/czw_branch/20100519/psModules/src/config/pmConfigMask.h

    r21183 r28304  
    2020/// @{
    2121
    22 // structure to hold the properties of a mask value
    23 typedef struct {
    24     char *badMaskName;                  // name for "bad" (i.e., mask me please) pixels
    25     char *fallbackName;                 // Fallback name in case a bad mask name is not defined
    26     psImageMaskType defaultMaskValue;   // Default value in case a bad mask name and its fallback are not defined
    27     bool isBad; // include this value as part of the MASK.VALUE entry (generically bad)
    28 } pmConfigMaskInfo;
    29 
    3022// pmConfigMaskSetInMetadata examines named mask values and set the bits for maskValue and
    3123// markValue.  Ensures that the below-named mask values are set, and calculates the mask value
     
    3325// name is not found, or the default values if the fallback name is not found.
    3426bool pmConfigMaskSetInMetadata(psImageMaskType *outMaskValue, // Value of MASK.VALUE, returned
    35                                psImageMaskType *outMarkValue, // Value of MARK.VALUE, returned
    36                                psMetadata *source  // Source of mask bits
     27                               psImageMaskType *outMarkValue, // Value of MARK.VALUE, returned
     28                               psMetadata *source  // Source of mask bits
    3729  );
    3830
     
    4032// Get a mask value by name(s)
    4133psImageMaskType pmConfigMaskGetFromMetadata(psMetadata *source, // Source of masks
    42                                             const char *masks // Mask values to get
     34                                            const char *masks // Mask values to get
    4335  );
    4436
    4537
    46 // lookup an image mask value by name from a psMetadata, without requiring the entry to 
     38// lookup an image mask value by name from a psMetadata, without requiring the entry to
    4739// be of type psImageMaskType, but verifying that it will fit in psImageMaskType
    4840psImageMaskType psMetadataLookupImageMaskFromGeneric (bool *status, const psMetadata *md, const char *name);
     
    5042// Remove from the header keywords starting with the provided string
    5143int pmConfigMaskRemoveHeaderKeywords(psMetadata *header, // Header from which to remove keywords
    52                                      const char *start // Remove keywords that start with this string
     44                                     const char *start // Remove keywords that start with this string
    5345  );
    5446
  • branches/czw_branch/20100519/psModules/src/extras/pmVisual.c

    r25754 r28304  
    8686
    8787
     88// ask the user to continue or not.  give up after 2 seconds.
     89// XXX add option to turn on/off timeouts?
    8890bool pmVisualAskUser(bool *plotFlag)
    8991{
     92    struct timeval timeout;
     93    fd_set fdSet;
     94    int status;
     95
    9096    char key[10];
    9197    if (plotFlag) {
    92         fprintf (stdout, "[c]ontinue? [s]kip the rest of these plots? [a]bort all visual plots? (c) ");
     98        fprintf (stderr, "[p]ause? [c]ontinue? [s]kip the rest of these plots? [a]bort all visual plots? (c) ");
    9399    } else {
    94         fprintf (stdout, "[c]ontinue? [a]bort all visual plots? (c) ");
    95     }
    96     if (!fgets(key, 8, stdin)) {
    97         psWarning("Unable to read option");
    98     }
    99     if (plotFlag && (key[0] == 's')) {
    100         *plotFlag = false;
    101     }
    102     if (key[0] == 'a') {
    103         isVisual = false;
     100        fprintf (stderr, "[p]ause? [c]ontinue? [a]bort all visual plots? (c) ");
     101    }
     102
     103    /* Wait up to 1.0 second for a response, then continue */
     104    timeout.tv_sec = 2;
     105    timeout.tv_usec = 0;
     106
     107    FD_ZERO (&fdSet);
     108    FD_SET (STDIN_FILENO, &fdSet);
     109
     110    status = select (1, &fdSet, NULL, NULL, &timeout);
     111    if (status <= 0) {
     112        fprintf (stderr, "\n");
     113        return true; // if no data, give up
     114    }
     115
     116    while (true) {
     117        if (!fgets(key, 8, stdin)) {
     118            psWarning("Unable to read option");
     119        }
     120        switch (key[0]) {
     121          case 's':
     122            if (plotFlag) *plotFlag = false;
     123            *plotFlag = false;
     124            return true;
     125          case 'a':
     126            isVisual = false;
     127            return true;
     128          case 'c':
     129          case '\n':
     130            return true;
     131          default:
     132            break;
     133        }
     134       
     135        if (plotFlag) {
     136            fprintf (stderr, "[c]ontinue? [s]kip the rest of these plots? [a]bort all visual plots? (c) ");
     137        } else {
     138            fprintf (stderr, "[c]ontinue? [a]bort all visual plots? (c) ");
     139        }
    104140    }
    105141    return true;
  • branches/czw_branch/20100519/psModules/src/imcombine/pmSubtraction.c

    r27086 r28304  
    3232#define MIN_SAMPLE_STATS    7           // Minimum number to use sample statistics; otherwise use quartiles
    3333#define USE_KERNEL_ERR                  // Use kernel error image?
     34#define NUM_COVAR_POS 5                 // Number of positions for covariance calculation
    3435
    3536//////////////////////////////////////////////////////////////////////////////////////////////////////////////
     
    13281329    // This can be fairly involved, so we only do it for a single instance
    13291330    // Enable threads for covariance calculation, since we're not threading on top of it.
     1331    float position[NUM_COVAR_POS] = { -1.0, -0.5, 0.0, +0.5, +1.0 }; // Positions for covariance calculations
    13301332    oldThreads = psImageCovarianceSetThreads(true);
    13311333    if (kernels->mode == PM_SUBTRACTION_MODE_1 || kernels->mode == PM_SUBTRACTION_MODE_DUAL) {
    1332         psKernel *kernel = pmSubtractionKernel(kernels, 0.0, 0.0, false); // Convolution kernel
    1333         psKernelTruncate(kernel, covarFrac);
    1334         out1->covariance = psImageCovarianceCalculate(kernel, ro1->covariance);
    1335         psFree(kernel);
     1334        psArray *covars = psArrayAlloc(PS_SQR(NUM_COVAR_POS)); // Covariances
     1335        for (int y = 0, i = 0; y < NUM_COVAR_POS; y++) {
     1336            for (int x = 0; x < NUM_COVAR_POS; x++, i++) {
     1337                psKernel *kernel = pmSubtractionKernel(kernels, position[x], position[y],
     1338                                                       false); // Convolution kernel
     1339                psKernelTruncate(kernel, covarFrac);
     1340                covars->data[i] = psImageCovarianceCalculate(kernel, ro1->covariance);
     1341                psFree(kernel);
     1342            }
     1343        }
     1344        out1->covariance = psImageCovarianceAverage(covars);
     1345        psFree(covars);
    13361346    }
    13371347    if (kernels->mode == PM_SUBTRACTION_MODE_2 || kernels->mode == PM_SUBTRACTION_MODE_DUAL) {
    1338         psKernel *kernel = pmSubtractionKernel(kernels, 0.0, 0.0,
    1339                                                kernels->mode == PM_SUBTRACTION_MODE_DUAL); // Conv. kernel
    1340         psKernelTruncate(kernel, covarFrac);
    1341         out2->covariance = psImageCovarianceCalculate(kernel, ro2->covariance);
    1342         psFree(kernel);
     1348        psArray *covars = psArrayAlloc(PS_SQR(NUM_COVAR_POS)); // Covariances
     1349        for (int y = 0, i = 0; y < NUM_COVAR_POS; y++) {
     1350            for (int x = 0; x < NUM_COVAR_POS; x++, i++) {
     1351                psKernel *kernel = pmSubtractionKernel(kernels, position[x], position[y],
     1352                                                       kernels->mode == PM_SUBTRACTION_MODE_DUAL); // Convolution kernel
     1353                psKernelTruncate(kernel, covarFrac);
     1354                covars->data[i] = psImageCovarianceCalculate(kernel, ro2->covariance);
     1355                psFree(kernel);
     1356            }
     1357        }
     1358        out2->covariance = psImageCovarianceAverage(covars);
     1359        psFree(covars);
    13431360    }
    13441361    psImageCovarianceSetThreads(oldThreads);
  • branches/czw_branch/20100519/psModules/src/objects/pmSourceMatch.c

    r27333 r28304  
    280280    psFree(boundsMaster);
    281281
     282    if (!matches) {
     283        psError(PM_ERR_OBJECTS, true, "No matches made.");
     284        return NULL;
     285    }
     286
    282287    if (cullSingles) {
    283288        // Now cull the matches that contain only a single star
     
    300305    }
    301306
     307    if (matches->n == 0) {
     308        psError(PM_ERR_OBJECTS, true, "No matches made.");
     309        psFree(matches);
     310        return NULL;
     311    }
     312
    302313    return matches;
    303314}
     
    311322    psArray *matches = pmSourceMatchSources(sourceArrays, radius, false); // Source matches
    312323    if (!matches) {
    313         psError(PS_ERR_UNKNOWN, false, "Unable to match source lists.");
     324        psError(psErrorCodeLast(), false, "Unable to match source lists.");
    314325        return NULL;
    315326    }
Note: See TracChangeset for help on using the changeset viewer.