IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 9, 2009, 4:19:37 PM (17 years ago)
Author:
beaumont
Message:

merging from cnb_branch_20090215

Location:
trunk/psModules
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules

  • trunk/psModules/src/extras/pmVisual.c

    r21422 r23242  
    1818#include "pmHDU.h"
    1919#include "pmFPA.h"
     20#include "pmFPAfile.h"
    2021#include "pmAstrometryObjects.h"
     22#include "pmSubtractionStamps.h"
     23#include "pmTrend2D.h"
    2124#include "pmFPAExtent.h"
    2225
     
    2831# define KAPAY 700
    2932
     33#include "pmAstrometryVisual.h"
     34#include "pmSubtractionVisual.h"
     35#include "pmStackVisual.h"
     36#include "pmSourceVisual.h"
     37
     38//#define TESTING
     39
     40static bool isVisual = false;
     41
     42
     43bool pmVisualSetVisual(bool value) {
     44    isVisual = value;
     45    return true;
     46}
     47
     48
     49bool pmVisualIsVisual(void) {return isVisual;}
     50
     51bool pmVisualClose(void) {
     52    pmAstromVisualClose();
     53    pmSubtractionVisualClose();
     54    pmStackVisualClose();
     55    pmSourceVisualClose();
     56    //XXX handle psphot
     57    //    psphotVisualClose();
     58    return true;
     59}
    3060
    3161bool pmVisualInitWindow (int *kapid, char *name) {
     
    3464        if (*kapid == -1) {
    3565            fprintf (stderr, "Failure to open kapa.\n");
     66            isVisual = false;
    3667            return false;
    3768        }
     
    5283
    5384
    54 bool pmVisualAskUser(bool *plotFlag, bool *packageFlag)
     85bool pmVisualAskUser(bool *plotFlag)
    5586{
    5687    char key[10];
     
    6394    }
    6495    if (key[0] == 'a') {
    65         *packageFlag = false;
     96        isVisual = false;
    6697    }
    6798    return true;
     
    182213
    183214bool pmVisualScaleImage(int kapaFD, psImage *inImage, const char *name, int channel, bool clip) {
    184 
    185215    KiiImage image;
    186216    KapaImageData data;
    187217    Coords coords;
    188218
    189     //make sure we have a compatible image type
     219    //make sure we have a compatible image
     220    if (inImage == NULL) {
     221        fprintf(stderr, "Image is NULL, and cannot be displayed\n");
     222        return false;
     223    }
     224
    190225    if(inImage->type.type != PS_TYPE_F32) {
    191226        fprintf(stderr, "Cannot display this image (imcompatible data type)\n");
     
    194229
    195230    strcpy (coords.ctype, "RA---TAN");
     231
    196232
    197233    double min, max, stdev, mean;
     
    304340
    305341#else
    306 
     342bool pmVisualSetVisual(bool value) {return true;}
     343bool pmVisualIsVisual(void) {return false;}
     344bool pmVisualClose(void) {return true;}
    307345bool pmVisualInitWindow(int *kapid, char *name){return true;}
    308346bool pmVisualInitGraph (int kapa, void *section, void *graphdata){return true;}
    309347
    310 bool pmVisualAskUser(bool *plotFlag, bool *packageFlag){return true;}
     348bool pmVisualAskUser(bool *plotFlag){return true;}
    311349bool pmVisualImStats(psImage *image, double *mean,
    312350                     double *stdev, double *min, double *max){return true;}
  • trunk/psModules/src/extras/pmVisual.h

    r21422 r23242  
    1010
    1111#if (HAVE_KAPA)
     12
     13
     14/** Globally enable or disable plotting
     15 * @param value - true to enable plotting
     16 * @return true
     17 */
     18bool pmVisualSetVisual(bool value);
     19
     20
     21/** Check whether plotting is enabled
     22 * @retrun true if plots should be generated
     23 */
     24bool pmVisualIsVisual(void);
     25
     26
     27/** Destroy plotting windows at the end of a run
     28 * @return true for success */
     29bool pmVisualClose(void);
    1230
    1331
     
    3250 * At the user's request, this will disable diagnostic plotting.
    3351 * @param plotFlag, set to false if this plot should be disabled in the future
    34  * @param packageFlag, set to false if all plots from this package (e.g. psastro, pmSubtraction)
    35  *                      should be disabled.
    3652 */
    37 bool pmVisualAskUser(bool *plotFlag, bool *packageFlag);
     53bool pmVisualAskUser(bool *plotFlag);
    3854
    3955
     
    115131
    116132// kapa-specific data types are changed to void
     133bool pmVisualSetVisual(bool value);
     134bool pmVisualIsVisual(void);
     135bool pmVisualClose(void);
    117136bool pmVisualInitWindow (int *kapid, char *name);
    118137bool pmVisualInitGraph (int kapa, void *section, void *graphdata);
    119 bool pmVisualAskUser(bool *plotFlag, bool *packageFlag);
     138bool pmVisualAskUser(bool *plotFlag);
    120139bool pmVisualScaleImage(int kapaFD, psImage *inImage,
    121140                        const char *name, int channel, bool clip);
Note: See TracChangeset for help on using the changeset viewer.