IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5837


Ignore:
Timestamp:
Dec 23, 2005, 1:58:45 PM (21 years ago)
Author:
eugene
Message:

fixing output functions

Location:
trunk/psphot
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/Makefile

    r5828 r5837  
    9797$(MODELTEST): $(SRC)/psphot.h
    9898
    99 test.install: psphotTest.install
     99test-install: psphotTest.install
    100100test: $(BIN)/psphotTest.$(ARCH)
    101101$(BIN)/psphotTest.$(ARCH) : $(TEST)
  • trunk/psphot/src/psphotApResid.c

    r5828 r5837  
    55    int Npsf;
    66    bool status;
    7     float x, y;
    8     float fitMag, obsMag;
     7    pmModel *model;
     8    pmSource *source;
    99
    1010    // XXX EAM : check that PSF_FIT_RADIUS < SKY_OUTER_RADIUS
     
    2626    // select the NNN brightest, non-saturated sources, or just select PSFSTARs?
    2727    for (int i = 0; (i < sources->n) && (Npsf < 300); i++) {
    28         pmSource *source = sources->data[i];
    29         pmModel  *model  = source->modelPSF;
     28        source = sources->data[i];
    3029
    31         if (model == NULL) continue;
    3230        if (source->type != PM_SOURCE_STAR) continue;
    3331        if (source->mode &  PM_SOURCE_SATSTAR) continue;
     
    3634        if (source->mode &  PM_SOURCE_POOR) continue;
    3735
    38         // set shape for this model based on PSF
    39         x = model->params->data.F32[2];
    40         y = model->params->data.F32[3];
    41 
    42         pmSourceAddModel (source->pixels, source->mask, model, false, false);
    43 
    44         psImageKeepCircle (source->mask, x, y, RADIUS, "OR", PSPHOT_MASK_MARKED);
    45         status = pmSourcePhotometry (&fitMag, &obsMag, model, source->pixels, source->mask);
    46         psImageKeepCircle (source->mask, x, y, RADIUS, "AND", ~PSPHOT_MASK_MARKED);
    47 
    48         pmSourceSubModel (source->pixels, source->mask, model, false, false);
    49         if (!status) continue;
     36        // get magnitudes, uncorrected for (x, y, rflux)
     37        model = pmSourceMagnitudes (source, NULL, RADIUS);
     38        if (model == NULL) continue;
    5039
    5140        mask->data.U8[Npsf] = 0;
    52         xPos->data.F64[Npsf] = x;
    53         yPos->data.F64[Npsf] = y;
    54         rflux->data.F64[Npsf] = pow(10.0, 0.4*fitMag);
    55         apResid->data.F64[Npsf] = obsMag - fitMag;
     41        xPos->data.F64[Npsf] = model->params->data.F32[2];
     42        yPos->data.F64[Npsf] = model->params->data.F32[3];
     43        rflux->data.F64[Npsf] = pow(10.0, 0.4*source->fitMag);
     44        apResid->data.F64[Npsf] = source->apMag - source->fitMag;
    5645
    5746        psVectorExtend (mask, 100, 1);
  • trunk/psphot/src/psphotArguments.c

    r5828 r5837  
    6161
    6262    bool ModelTest = false;
    63     float ModelTest_X, ModelTest_Y;
     63    float ModelTest_X = 0;
     64    float ModelTest_Y = 0;
    6465    char *model = NULL;
    6566    char *fitset = NULL;
  • trunk/psphot/src/psphotEnsemblePSF.c

    r5828 r5837  
    7474
    7575    bool UseAnalysisRegion = false;
    76     psRegion AnalysisRegion;
     76    psRegion AnalysisRegion = {0, 0, 0, 0};
    7777    char *region = psMetadataLookupPtr (&status, config, "ANALYSIS_REGION");
    7878    if (status) {
     
    236236    // XXX EAM : need to free up many things here
    237237
    238     psLogMsg ("psphot.emsemble", 3, "measure ensemble of PSFs: %f\n", psTimerMark ("psphot"));
     238    psLogMsg ("psphot.emsemble", 3, "measure ensemble of PSFs: %f sec\n", psTimerMark ("psphot"));
    239239    return true;
    240240}
  • trunk/psphot/src/psphotMagnitudes.c

    r5828 r5837  
    11# include "psphot.h"
    22
    3 // XXX EAM : the apMag should only be calculated for the brighter sources
     3// XXX EAM : the apMag should only be calculated for the brighter sources?
    44// XXX EAM : SN limit set by user?
    55// XXX EAM : masked region should be (optionally) elliptical
     
    77
    88    int status;
     9    bool isPSF;
    910    float x, y;
    1011    float rflux;
     12    float radius;
    1113    pmModel *model;
    1214
    13     // use the correct model (PSF vs FLT)
    14     if (psf != NULL) {
    15       model = source->modelPSF;
    16     } else {
    17       model = source->modelFLT;
     15    switch (source->type) {
     16      case PM_SOURCE_STAR:
     17        model = source->modelPSF;
     18        if (model == NULL) return NULL;
     19        radius = apRadius;
     20        isPSF = true;
     21        break;
     22
     23      case PM_SOURCE_GALAXY:
     24        model = source->modelFLT;
     25        if (model == NULL) return NULL;
     26        radius = model->radius;
     27        isPSF = false;
     28        break;
     29           
     30      default:
     31        return NULL;
    1832    }
    19     if (model == NULL) return NULL;
    2033
    21     x = source->peak->x;
    22     y = source->peak->y;
    23 
    24     // we have already (psphotApplyPSF) defined pixels at least OUTER_RADIUS from source
    25     // we need to mask pixels to measure the aperture magnitude
    26     // set aperture mask circle of PSF_FIT_RADIUS
    27     psImageKeepCircle (source->mask, x, y, apRadius, "OR", PSPHOT_MASK_MARKED);
     34    x = model->params->data.F32[2];
     35    y = model->params->data.F32[3];
    2836
    2937    // replace source flux
    3038    pmSourceAddModel (source->pixels, source->mask, model, false, false);
     39
     40    // set aperture mask circle of PSF_FIT_RADIUS
     41    psImageKeepCircle (source->mask, x, y, radius, "OR", PSPHOT_MASK_MARKED);
    3142
    3243    // measure object photometry
     
    3445
    3546    // for PSFs, correct both apMag and fitMag to same system, consistent with infinite flux star in aperture RADIUS
    36     if (psf != NULL) {
     47    if (isPSF && (psf != NULL)) {
    3748      rflux   = pow (10.0, 0.4*source->fitMag);
    3849      source->apMag  -= rflux * psf->skyBias * (M_PI * PS_SQR(apRadius));
     
    4455
    4556    // unmask aperture
    46     psImageKeepCircle (source->mask, x, y, apRadius, "AND", ~PSPHOT_MASK_MARKED);
     57    psImageKeepCircle (source->mask, x, y, radius, "AND", ~PSPHOT_MASK_MARKED);
     58
     59    if (!status) return NULL;
    4760    return model;
    48 }
    49 
    50 pmModel *pmSourceSelectModel (pmSource *source) {
    51 
    52     pmModel *model;
    53 
    54     switch (source->type) {
    55    
    56         // use PSF model with stars
    57       case PM_SOURCE_STAR:
    58         model = source->modelPSF;
    59         break;
    60 
    61         // use FLT model with galaxies
    62       case PM_SOURCE_GALAXY:
    63         model = source->modelFLT;
    64         break;
    65            
    66         // skip defects and poorly fitted stars or galaxies
    67       default:
    68         model = NULL;
    69     }
    70     return (model);
    7161}
    7262
  • trunk/psphot/src/psphotModelTest.c

    r5828 r5837  
    88    float obsMag, fitMag, value;
    99    char name[64];
    10     pmPSF *psf;
     10    pmPSF *psf = NULL;
    1111
    1212    psMetadataItem *item  = NULL;
  • trunk/psphot/src/psphotOutput.c

    r5828 r5837  
    2424        return;
    2525    }
     26    if (!strcasecmp (outputMode, "OBJ")) {
     27        pmSourcesWriteOBJ (imdata, config, outputFile, sources, psf, sky);
     28        return;
     29    }
     30    if (!strcasecmp (outputMode, "SX")) {
     31        pmSourcesWriteSX (imdata, config, outputFile, sources, psf, sky);
     32        return;
     33    }
     34    if (!strcasecmp (outputMode, "CMP")) {
     35        pmSourcesWriteCMP (imdata, config, outputFile, sources, psf, sky);
     36        return;
     37    }
     38    if (!strcasecmp (outputMode, "CMF")) {
     39        pmSourcesWriteCMF (imdata, config, outputFile, sources, psf, sky);
     40        return;
     41    }
    2642    if (!strcasecmp (outputMode, "TEXT")) {
    2743        pmSourcesWriteText (imdata, config, outputFile, sources, psf, sky);
     
    2945    }
    3046
    31     if (!strcasecmp (outputMode, "OBJ")) {
    32         pmSourcesWriteOBJ (imdata, config, outputFile, sources, psf, sky);
    33         return;
    34     }
    35  
    36     if (!strcasecmp (outputMode, "SX")) {
    37         pmSourcesWriteSX (imdata, config, outputFile, sources, psf, sky);
    38         return;
    39     }
    40  
    41     if (!strcasecmp (outputMode, "CMP")) {
    42         pmSourcesWriteCMP (imdata, config, outputFile, sources, psf, sky);
    43         return;
    44     }
    45  
    46     if (!strcasecmp (outputMode, "CMF")) {
    47         pmSourcesWriteCMF (imdata, config, outputFile, sources, psf, sky);
    48         return;
    49     }
    50 
    5147    psAbort ("psphot", "unknown output mode %s", outputMode);
    52 }
    53 
    54 bool pmSourcesWriteText (eamReadout *imdata, psMetadata *config, char *filename, psArray *sources, pmPSF *psf, psStats *sky) {
    55 
    56     char *name = (char *) psAlloc (strlen(filename) + 10);
    57 
    58     sprintf (name, "%s.psf.dat", filename);
    59     pmModelWritePSFs (sources, config, name, psf);
    60 
    61     sprintf (name, "%s.flt.dat", filename);
    62     pmModelWriteFLTs (sources, name);
    63 
    64     sprintf (name, "%s.nul.dat", filename);
    65     pmModelWriteNULLs (sources, name);
    66 
    67     sprintf (name, "%s.mnt.dat", filename);
    68     pmMomentsWriteText (sources, name);
    69 
    70     psFree (name);
    71     return true;
    7248}
    7349
     
    11591        psLineAdd (line, "%9.3f", PAR[5]);
    11692        psLineAdd (line, "%7.2f", PAR[6]);
    117         psLineAdd (line, "%8.3f", 32.0);
     93        psLineAdd (line, "%8.3f", 99.999);
    11894        psLineAdd (line, "%8.3f", source->apMag);
    11995        psLineAdd (line, "%8.2f\n", apResid);
     
    166142        psLineAdd (line, "%9.2f", 0.0); // should be FWHMy
    167143        psLineAdd (line, "%6.1f", 0.0); // should be Theta
    168         psLineAdd (line, "%9.4f", 32.0); // should be MAG_ISO
     144        psLineAdd (line, "%9.4f", 99.999); // should be MAG_ISO
    169145        psLineAdd (line, "%9.4f", source->apMag);
    170146        psLineAdd (line, "%4d\n", 0); // should be flags
     
    182158    psMetadataItem *mdi;
    183159    psF32 *PAR, *dPAR;
    184     float dmag, apResid, lsky;
     160    float dmag, lsky;
    185161    bool status;
    186162
     
    188164    float RADIUS = psMetadataLookupF32 (&status, config, "PSF_FIT_RADIUS");
    189165    float ZERO_POINT = psMetadataLookupF32 (&status, config, "ZERO_POINT");
     166    if (!status) ZERO_POINT = 25.0;
    190167    char *PHOTCODE = psMetadataLookupPtr (&status, config, "PHOTCODE");
    191168
     
    237214        dmag = dPAR[1] / PAR[1];
    238215        type = pmSourceDophotType (source);
    239         apResid = source->apMag - source->fitMag;
    240216        lsky = (PAR[0] < 1.0) ? 0.0 : log10(PAR[0]);
    241217
     
    243219        psLineAdd (line, "%6.1f ", PAR[2]);
    244220        psLineAdd (line, "%6.1f ", PAR[3]);
    245         psLineAdd (line, "%6.3f ", PS_MIN (32.0, source->fitMag + ZERO_POINT));
    246         psLineAdd (line, "%03d ", (int)(1000*dmag));
     221        psLineAdd (line, "%6.3f ", PS_MIN (99.999, source->fitMag + ZERO_POINT));
     222        psLineAdd (line, "%03d ",  PS_MIN (999, (int)(1000*dmag)));
    247223        psLineAdd (line, "%2d ",   type);
    248224        psLineAdd (line, "%3.1f ", lsky);
    249         psLineAdd (line, "%6.3f ", 32.0);    // should be 'Mgal
    250         psLineAdd (line, "%6.3f ", PS_MIN (32.0, source->apMag + ZERO_POINT));
     225        psLineAdd (line, "%6.3f ", 99.999);    // should be 'Mgal
     226        psLineAdd (line, "%6.3f ", PS_MIN (99.999, source->apMag + ZERO_POINT));
    251227        psLineAdd (line, "%6.2f ", PAR[4]);  // should be 'FHWM x'
    252228        psLineAdd (line, "%6.2f ", PAR[5]);  // should be 'FHWM y'
     
    297273
    298274    table = psArrayAlloc (sources->n);
    299     sources->n = 0;
     275    table->n = 0;
    300276
    301277    for (i = 0; i < sources->n; i++) {
     
    313289
    314290        row = psMetadataAlloc ();
    315         psMetadataAdd (row, PS_LIST_HEAD, "X_PIX",   PS_DATA_F32, "", PAR[2]);
    316         psMetadataAdd (row, PS_LIST_HEAD, "Y_PIX",   PS_DATA_F32, "", PAR[3]);
    317         psMetadataAdd (row, PS_LIST_HEAD, "MAG_RAW", PS_DATA_F32, "", source->fitMag + ZERO_POINT);
    318         psMetadataAdd (row, PS_LIST_HEAD, "MAG_ERR", PS_DATA_F32, "", (int)(1000*dmag));
    319         psMetadataAdd (row, PS_LIST_HEAD, "MAG_GAL", PS_DATA_F32, "", type);
    320         psMetadataAdd (row, PS_LIST_HEAD, "MAG_AP",  PS_DATA_F32, "", lsky);
    321         psMetadataAdd (row, PS_LIST_HEAD, "LOG_SKY", PS_DATA_F32, "", 32.0);    // should be 'Mgal'
    322         psMetadataAdd (row, PS_LIST_HEAD, "FWHM_X",  PS_DATA_F32, "", source->apMag + ZERO_POINT);
    323         psMetadataAdd (row, PS_LIST_HEAD, "FWHM_Y",  PS_DATA_F32, "", PAR[4]);  // should be 'FHWM x'
    324         psMetadataAdd (row, PS_LIST_HEAD, "THETA",   PS_DATA_F32, "", PAR[5]);  // should be 'FHWM y'
    325         psMetadataAdd (row, PS_LIST_HEAD, "DOPHOT",  PS_TYPE_S8, "", 0);   // should be theta
     291        psMetadataAdd (row, PS_LIST_TAIL, "X_PIX",   PS_DATA_F32, "", PAR[2]);
     292        psMetadataAdd (row, PS_LIST_TAIL, "Y_PIX",   PS_DATA_F32, "", PAR[3]);
     293        psMetadataAdd (row, PS_LIST_TAIL, "MAG_RAW", PS_DATA_F32, "", source->fitMag + ZERO_POINT);
     294        psMetadataAdd (row, PS_LIST_TAIL, "MAG_ERR", PS_DATA_F32, "", (int)(1000*dmag));
     295        psMetadataAdd (row, PS_LIST_TAIL, "MAG_GAL", PS_DATA_F32, "", type);
     296        psMetadataAdd (row, PS_LIST_TAIL, "MAG_AP",  PS_DATA_F32, "", lsky);
     297        psMetadataAdd (row, PS_LIST_TAIL, "LOG_SKY", PS_DATA_F32, "", 32.0);    // should be 'Mgal'
     298        psMetadataAdd (row, PS_LIST_TAIL, "FWHM_X",  PS_DATA_F32, "", source->apMag + ZERO_POINT);
     299        psMetadataAdd (row, PS_LIST_TAIL, "FWHM_Y",  PS_DATA_F32, "", PAR[4]);  // should be 'FHWM x'
     300        psMetadataAdd (row, PS_LIST_TAIL, "THETA",   PS_DATA_F32, "", PAR[5]);  // should be 'FHWM y'
     301        psMetadataAdd (row, PS_LIST_TAIL, "DOPHOT",  PS_TYPE_S32, "", 0);   // should be theta
    326302        // psMetadataAdd (header, PS_LIST_HEAD, "DUMMY",   PS_DATA_STRING, "", NULL);
    327303   
     
    339315    psMetadataAdd (theader, PS_LIST_HEAD, "EXTNAME", PS_DATA_STRING, "extension name", "SMPFILE");
    340316
     317    psImage *image;
     318
     319    image = psImageAlloc (512, 512, PS_DATA_F32);
     320    for (int j = 0; j < 512; j++) {
     321        for (int i = 0; i < 512; i++) {
     322            image->data.F32[j][i] = i;
     323        }
     324    }
     325
    341326    psFits *fits = psFitsOpen (filename, "w");
    342     psFitsWriteHeader (imdata->header, fits);
    343     psFitsWriteTable (fits, theader, table);
     327    // psFitsWriteHeader (imdata->header, fits);
     328    // psFitsWriteTable (fits, theader, table);
     329
     330    psFitsWriteImage (fits, NULL, image, 0);
     331    psFitsWriteTable (fits, NULL, table);
    344332    psFitsClose (fits);
    345333
     
    349337/***** Text Output Methods *****/
    350338
    351 // write the peaks to an output file
    352 bool pmPeaksWriteText (psArray *peaks, char *filename) {
    353 
    354     int i;
    355     FILE *f;
    356        
    357     f = fopen (filename, "w");
    358     if (f == NULL) {
    359         psLogMsg ("pmPeaksWriteText", 3, "can't open output file for peaks%s\n", filename);
    360         return false;
    361     }
    362 
    363     for (i = 0; i < peaks->n; i++) {
    364         pmPeak *peak = peaks->data[i];
    365         if (peak == NULL) continue;
    366         fprintf (f, "%5d %5d  %7.1f\n",
    367                  peak->x, peak->y, peak->counts);
    368     }
    369     fclose (f);
     339bool pmSourcesWriteText (eamReadout *imdata, psMetadata *config, char *filename, psArray *sources, pmPSF *psf, psStats *sky) {
     340
     341    char *name = (char *) psAlloc (strlen(filename) + 10);
     342
     343    sprintf (name, "%s.psf.dat", filename);
     344    pmModelWritePSFs (sources, config, name, psf);
     345
     346    sprintf (name, "%s.flt.dat", filename);
     347    pmModelWriteFLTs (sources, name);
     348
     349    sprintf (name, "%s.nul.dat", filename);
     350    pmModelWriteNULLs (sources, name);
     351
     352    sprintf (name, "%s.mnt.dat", filename);
     353    pmMomentsWriteText (sources, name);
     354
     355    psFree (name);
    370356    return true;
    371357}
     
    381367    bool status;
    382368
     369    float RADIUS = psMetadataLookupF32 (&status, config, "PSF_FIT_RADIUS");
     370
    383371    f = fopen (filename, "w");
    384372    if (f == NULL) {
     
    387375    }
    388376
    389     float RADIUS = psMetadataLookupF32 (&status, config, "PSF_FIT_RADIUS");
    390 
    391377   // write sources with models first
    392378    for (i = 0; i < sources->n; i++) {
     
    394380
    395381        if (source->type != PM_SOURCE_STAR) continue;
    396         // if (source->mode & PM_SOURCE_FAIL) continue;
    397         // if (source->mode & PM_SOURCE_POOR) continue;
    398 
    399382        model = pmSourceMagnitudes (source, psf, RADIUS);
    400383        if (model == NULL) continue;
     
    407390        dMag = dPAR[1] / PAR[1];
    408391
    409         fprintf (f, "%7.1f %7.1f  %5.1f %8.4f  %7.4f %7.4f  ",
     392        fprintf (f, "%7.1f %7.1f  %7.1f %8.4f  %7.4f %7.4f  ",
    410393                 PAR[2], PAR[3], PAR[0], source->fitMag, dMag, dPos);
    411394
     
    449432
    450433        if (source->type != PM_SOURCE_GALAXY) continue;
    451        
    452         if (source->modelFLT == NULL) continue;
    453         model = pmSourceMagnitudes (source, NULL, source->modelFLT->radius);
     434        model = pmSourceMagnitudes (source, NULL, 0.0);
     435        if (model == NULL) continue;
    454436
    455437        PAR  = model->params->data.F32;
     
    458440        // dPos is shape error
    459441        // XXX these are hardwired for SGAUSS
    460         dPos = 0;
    461         dPos += PS_SQR(dPAR[4] / PAR[4]);
    462         dPos += PS_SQR(dPAR[5] / PAR[5]);
    463         // dPos += PS_SQR(dPAR[7] / PAR[7]);
    464         dPos = sqrt (dPos);
     442        dPos = hypot ((dPAR[4] / PAR[4]), (dPAR[5] / PAR[5]));
    465443        dMag = dPAR[1] / PAR[1];
    466444
    467         fprintf (f, "%7.1f %7.1f  %7.1f %7.3f  %7.4f %7.4f  ",
     445        fprintf (f, "%7.1f %7.1f  %7.1f %8.4f  %7.4f %7.4f  ",
    468446                 PAR[2], PAR[3], PAR[0], source->fitMag, dMag, dPos);
    469447
     
    560538}
    561539
     540// write the peaks to an output file
     541bool pmPeaksWriteText (psArray *peaks, char *filename) {
     542
     543    int i;
     544    FILE *f;
     545       
     546    f = fopen (filename, "w");
     547    if (f == NULL) {
     548        psLogMsg ("pmPeaksWriteText", 3, "can't open output file for peaks%s\n", filename);
     549        return false;
     550    }
     551
     552    for (i = 0; i < peaks->n; i++) {
     553        pmPeak *peak = peaks->data[i];
     554        if (peak == NULL) continue;
     555        fprintf (f, "%5d %5d  %7.1f\n",
     556                 peak->x, peak->y, peak->counts);
     557    }
     558    fclose (f);
     559    return true;
     560}
     561
    562562// translations between psphot object types and dophot object types
    563563int pmSourceDophotType (pmSource *source) {
  • trunk/psphot/src/psphotTest.c

    r5672 r5837  
    33int main (int argc, char **argv) {
    44
    5     bool status;
     5    char line[80];
     6    psImage *image;
    67
    7     psMetadata *config = psphotTestArguments (&argc, argv);
    8     eamReadout *imdata = psphotSetup (config);
    9 
    10     int x = psMetadataLookupF32 (&status, config, "TEST_FIT_X");
    11     int y = psMetadataLookupF32 (&status, config, "TEST_FIT_Y");
    12     float fraction = psMetadataLookupF32 (&status, config, "TEST_FRACTION");
    13     float threshold = psMetadataLookupF32 (&status, config, "TEST_THRESHOLD");
    14 
    15     if (threshold == -1) {
    16         threshold = fraction * imdata->image->data.F32[y][x];
     8    image = psImageAlloc (512, 512, PS_DATA_F32);
     9    for (int j = 0; j < 512; j++) {
     10        for (int i = 0; i < 512; i++) {
     11            image->data.F32[j][i] = i;
     12        }
    1713    }
    1814
    19     psArray *contour = pmSourceContour_EAM (imdata->image, x, y, threshold);
    20     if (contour == NULL) {
    21         fprintf (stderr, "error: invalid contour\n");
    22         exit (1);
     15    psMetadata *row = NULL;
     16
     17    psArray *table = psArrayAlloc (100);
     18    table->n = 0;
     19   
     20    for (int i = 0; i < 100; i++) {
     21        row = psMetadataAlloc ();
     22        sprintf (line, "line %03d", i);
     23        psMetadataAdd (row, PS_LIST_HEAD, "FLOAT_DATA", PS_DATA_F32,    "", 0.2*i);
     24        psMetadataAdd (row, PS_LIST_HEAD, "INT_DATA",   PS_DATA_S32,    "", i);
     25        psMetadataAdd (row, PS_LIST_HEAD, "CHAR_DATA",  PS_DATA_STRING, "", line);
     26        psArrayAdd (table, 100, row);
     27        // psFree (row);
    2328    }
    2429
    25     psVector *xV = contour->data[0];
    26     psVector *yV = contour->data[1];
     30    psFits *fits = psFitsOpen ("test.fits", "w");
     31    psFitsWriteImage (fits, NULL, image, 0);
     32    psFitsWriteTable (fits, NULL, table);
     33    psFitsClose (fits);
    2734
    28     for (int i = 0; i < xV->n; i++) {
    29         fprintf (stdout, "%d %f %f\n", i, xV->data.F32[i], yV->data.F32[i]);
    30     }
    31 
    32     // psSparseMatrixTest ();
    3335    exit (0);
    3436}
Note: See TracChangeset for help on using the changeset viewer.