IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5621


Ignore:
Timestamp:
Nov 28, 2005, 2:27:22 PM (20 years ago)
Author:
Paul Price
Message:

Adding pmChipMosaic

Location:
trunk/archive/scripts/src/phase2
Files:
4 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/archive/scripts/src/phase2/Makefile

    r5564 r5621  
    1212
    1313OBJS = papPhase2.o psAdditionals.o pmConfig.o pmFPA.o pmFPAConstruct.o papStuff.o pmFPARead.o                \
    14         pmFPAConceptsGet.o pmFPAConceptsSet.o pmFPAWrite.o                                                   \
     14        pmFPAConceptsGet.o pmFPAConceptsSet.o pmFPAWrite.o pmChipMosaic.o                                    \
    1515        pmFlatField.o pmMaskBadPixels.o pmNonLinear.o pmSubtractBias.o
    1616TARGET = papPhase2
  • trunk/archive/scripts/src/phase2/ipprc.config

    r5583 r5621  
    2222LOGDEST STR     STDOUT                          # Log destination
    2323TRACE           METADATA                        # Trace levels
    24         pmConfigRead            S32     10
    2524        pap                     S32     10
    26         pmFPAWriteMask          S32     10
    27         pmFPAWriteWeight        S32     10
    28         p_pmFPATranslateName    S32     10
     25#       pmConfigRead            S32     10
     26#       pmFPAWriteMask          S32     10
     27#       pmFPAWriteWeight        S32     10
     28        pmChipMosaic            S32     10
    2929END
  • trunk/archive/scripts/src/phase2/megacam_raw.config

    r5583 r5621  
    9898                CELL.TRIMSEC            STR     DATASEC
    9999                CELL.XPARITY            S32     1 # We could have specified this as a DEFAULT, but this works
     100                CELL.X0                 S32     1
     101                CELL.Y0                 S32     1
    100102        END
    101103        right   METADATA        # Right amplifier
     
    105107                CELL.TRIMSEC            STR     DATASEC
    106108                CELL.XPARITY            S32     -1 # This cell is read out in the opposite direction
     109                CELL.X0                 S32     2048
     110                CELL.Y0                 S32     1
    107111        END
    108112END
     
    153157        CELL.TIME       STR     MJD
    154158#       CELL.BINNING    STR     SEPARATE
     159        CELL.X0         STR     FORTRAN
     160        CELL.Y0         STR     FORTRAN
    155161END
    156162
  • trunk/archive/scripts/src/phase2/papPhase2.c

    r5583 r5621  
    1616#include "pmNonLinear.h"
    1717#include "pmSubtractBias.h"
     18#include "pmChipMosaic.h"
    1819
    1920// Phase 2 needs to:
     
    8182#endif
    8283
    83     psTraceSetLevel("pmConfigCameraFromHeader", 10);
     84    psTimerStart("phase2");
    8485
    8586    // Parse the configurations
     
    276277        psLogMsg("phase2", PS_LOG_INFO, "Operating only on chip %d\n", chipNum);
    277278    }
     279
     280    psLogMsg("phase2", PS_LOG_INFO, "Setup completed after %f sec.\n", psTimerMark("phase2"));
    278281
    279282    // Read in the input pixels
     
    447450    }
    448451   
     452    psLogMsg("phase2", PS_LOG_INFO, "Input completed after %f sec.\n", psTimerMark("phase2"));
     453
    449454    psArray *inputChips = input->chips; // Array of chips in input image
    450455    psArray *biasChips = bias->chips;   // Array of chips in bias image
     
    766771                // XXX: Temporary: until the other functions are altered to do this themselves.
    767772                // Trim, so that flat, fringe etc computations are faster.
     773#if 0
    768774#ifndef PRODUCTION
    769775                psRegion *trimRegion = psMetadataLookupPtr(NULL, inputCell->concepts, "CELL.TRIMSEC");
     
    772778                inputReadout->image = trimmed;
    773779#endif
    774 
     780#endif
    775781                // Flat-field correction
    776782                if (doFlat) {
     
    804810                }
    805811
     812
    806813            } // Iterating over readouts
    807814        } // Iterating over cells
     815
     816        // Testing pmChipMosaic
     817        {
     818            psImage *mosaic = pmChipMosaic(inputChip, 1, 1); // Mosaic of chip
     819            psFits *mosaicFile = psFitsAlloc("mosaic.fits"); // FITS file to which to write
     820            psFitsWriteImage(mosaicFile, NULL, mosaic, 0);
     821            psFree(mosaicFile);
     822            psFree(mosaic);             
     823        }
     824 
    808825    } // Iterating over chips
     826
     827    psLogMsg("phase2", PS_LOG_INFO, "Processing completed after %f sec.\n", psTimerMark("phase2"));
    809828
    810829    // Write the output
     
    812831    pmFPAWriteMask(input, outputFile);
    813832    pmFPAWriteWeight(input, outputFile);
     833
     834    psLogMsg("phase2", PS_LOG_INFO, "Output completed after %f sec.\n", psTimerMark("phase2"));
    814835
    815836#ifdef PRODUCTION
     
    831852    psFree(overscanFit);
    832853    psFree(overscanStats);
     854
     855    psLogMsg("phase2", PS_LOG_INFO, "Cleanup completed after %f sec.\n", psTimerMark("phase2"));
     856    psTimerStop();
    833857
    834858#if 1
  • trunk/archive/scripts/src/phase2/phase2.config

    r5564 r5621  
    66BIAS            BOOL    FALSE           # Bias subtraction
    77DARK            BOOL    FALSE           # Dark subtraction
    8 OVERSCAN        BOOL    FALSE           # Overscan subtraction
     8OVERSCAN        BOOL    TRUE            # Overscan subtraction
    99FLAT            BOOL    FALSE           # Flat-field normalisation
    1010FRINGE          BOOL    FALSE           # Fringe subtraction
  • trunk/archive/scripts/src/phase2/pmFPAConceptsGet.c

    r5564 r5621  
    344344          case PS_TYPE_S32:
    345345            value = item->data.S32;
     346            break;
     347          case PS_TYPE_F32:
     348            psLogMsg(__func__, PS_LOG_WARN, "Concept %s (%s) should be S32, but is F32 --- converting.\n",
     349                     name, comment);
     350            value = (int)item->data.F32;
     351            break;
     352          case PS_TYPE_F64:
     353            psLogMsg(__func__, PS_LOG_WARN, "Concept %s (%s) should be S32, but is F64 --- converting.\n",
     354                     name, comment);
     355            value = (int)item->data.F64;
    346356            break;
    347357          default:
     
    977987    }
    978988
     989    // These are new and experimental concepts: CELL.X0 and CELL.Y0
     990
     991    // CELL.X0
     992    p_pmFPAConceptGetS32(fpa, chip, cell, db, cell->concepts, "CELL.X0", "Position of (0,0) on the chip ");
     993    // CELL.Y0
     994    p_pmFPAConceptGetS32(fpa, chip, cell, db, cell->concepts, "CELL.Y0", "Position of (0,0) on the chip");
     995    // Add corrective
     996    {
     997        const psMetadata *camera = fpa->camera;
     998        bool mdok = false;              // Result of MD lookup
     999        psMetadata *formats = psMetadataLookupMD(&mdok, camera, "FORMATS");
     1000        if (mdok && formats) {
     1001            psString format = psMetadataLookupString(&mdok, formats, "CELL.X0");
     1002            if (mdok && strlen(format) > 0 && strcasecmp(format, "FORTRAN") == 0) {
     1003                psMetadataItem *cellx0 = psMetadataLookup(cell->concepts, "CELL.X0");
     1004                cellx0->data.S32 -= 1;
     1005            }
     1006            format = psMetadataLookupString(&mdok, formats, "CELL.Y0");
     1007            if (mdok && strlen(format) > 0 && strcasecmp(format, "FORTRAN") == 0) {
     1008                psMetadataItem *celly0 = psMetadataLookup(cell->concepts, "CELL.Y0");
     1009                celly0->data.S32 -= 1;
     1010            }
     1011        }
     1012    }
     1013
    9791014    // Pau.
    9801015}
  • trunk/archive/scripts/src/phase2/pmFPAConceptsSet.c

    r5583 r5621  
    856856    }
    857857
     858    // Remove corrective
     859    {
     860        const psMetadata *camera = fpa->camera;
     861        bool mdok = false;              // Result of MD lookup
     862        psMetadata *formats = psMetadataLookupMD(&mdok, camera, "FORMATS");
     863        if (mdok && formats) {
     864            psString format = psMetadataLookupString(&mdok, formats, "CELL.X0");
     865            if (mdok && strlen(format) > 0 && strcasecmp(format, "FORTRAN") == 0) {
     866                psMetadataItem *cellx0 = psMetadataLookup(cell->concepts, "CELL.X0");
     867                cellx0->data.S32 += 1;
     868            }
     869            format = psMetadataLookupString(&mdok, formats, "CELL.Y0");
     870            if (mdok && strlen(format) > 0 && strcasecmp(format, "FORTRAN") == 0) {
     871                psMetadataItem *celly0 = psMetadataLookup(cell->concepts, "CELL.Y0");
     872                celly0->data.S32 += 1;
     873            }
     874        }
     875    }
     876    // CELL.X0
     877    setConcept(fpa, chip, cell, db, cell->concepts, "CELL.X0");
     878    // CELL.Y0
     879    setConcept(fpa, chip, cell, db, cell->concepts, "CELL.Y0");
     880
    858881    // Pau.
    859882}
  • trunk/archive/scripts/src/phase2/pmFPAMorph.c

    r5106 r5621  
    6868}
    6969
    70 
     70// Splice a list of cells together
    7171static psArray *spliceCells(psList *outCells, // List of target cells (required for parity info)
    7272                            psList *inCells, // List of cells to splice together
Note: See TracChangeset for help on using the changeset viewer.