Changeset 5621
- Timestamp:
- Nov 28, 2005, 2:27:22 PM (20 years ago)
- Location:
- trunk/archive/scripts/src/phase2
- Files:
-
- 4 added
- 8 edited
-
Makefile (modified) (1 diff)
-
gpc1_raw.config (added)
-
ipprc.config (modified) (1 diff)
-
megacam_raw.config (modified) (3 diffs)
-
nonlin.dat (added)
-
papPhase2.c (modified) (9 diffs)
-
phase2.config (modified) (1 diff)
-
pmChipMosaic.c (added)
-
pmChipMosaic.h (added)
-
pmFPAConceptsGet.c (modified) (2 diffs)
-
pmFPAConceptsSet.c (modified) (1 diff)
-
pmFPAMorph.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/archive/scripts/src/phase2/Makefile
r5564 r5621 12 12 13 13 OBJS = 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 \ 15 15 pmFlatField.o pmMaskBadPixels.o pmNonLinear.o pmSubtractBias.o 16 16 TARGET = papPhase2 -
trunk/archive/scripts/src/phase2/ipprc.config
r5583 r5621 22 22 LOGDEST STR STDOUT # Log destination 23 23 TRACE METADATA # Trace levels 24 pmConfigRead S32 1025 24 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 29 29 END -
trunk/archive/scripts/src/phase2/megacam_raw.config
r5583 r5621 98 98 CELL.TRIMSEC STR DATASEC 99 99 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 100 102 END 101 103 right METADATA # Right amplifier … … 105 107 CELL.TRIMSEC STR DATASEC 106 108 CELL.XPARITY S32 -1 # This cell is read out in the opposite direction 109 CELL.X0 S32 2048 110 CELL.Y0 S32 1 107 111 END 108 112 END … … 153 157 CELL.TIME STR MJD 154 158 # CELL.BINNING STR SEPARATE 159 CELL.X0 STR FORTRAN 160 CELL.Y0 STR FORTRAN 155 161 END 156 162 -
trunk/archive/scripts/src/phase2/papPhase2.c
r5583 r5621 16 16 #include "pmNonLinear.h" 17 17 #include "pmSubtractBias.h" 18 #include "pmChipMosaic.h" 18 19 19 20 // Phase 2 needs to: … … 81 82 #endif 82 83 83 psT raceSetLevel("pmConfigCameraFromHeader", 10);84 psTimerStart("phase2"); 84 85 85 86 // Parse the configurations … … 276 277 psLogMsg("phase2", PS_LOG_INFO, "Operating only on chip %d\n", chipNum); 277 278 } 279 280 psLogMsg("phase2", PS_LOG_INFO, "Setup completed after %f sec.\n", psTimerMark("phase2")); 278 281 279 282 // Read in the input pixels … … 447 450 } 448 451 452 psLogMsg("phase2", PS_LOG_INFO, "Input completed after %f sec.\n", psTimerMark("phase2")); 453 449 454 psArray *inputChips = input->chips; // Array of chips in input image 450 455 psArray *biasChips = bias->chips; // Array of chips in bias image … … 766 771 // XXX: Temporary: until the other functions are altered to do this themselves. 767 772 // Trim, so that flat, fringe etc computations are faster. 773 #if 0 768 774 #ifndef PRODUCTION 769 775 psRegion *trimRegion = psMetadataLookupPtr(NULL, inputCell->concepts, "CELL.TRIMSEC"); … … 772 778 inputReadout->image = trimmed; 773 779 #endif 774 780 #endif 775 781 // Flat-field correction 776 782 if (doFlat) { … … 804 810 } 805 811 812 806 813 } // Iterating over readouts 807 814 } // 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 808 825 } // Iterating over chips 826 827 psLogMsg("phase2", PS_LOG_INFO, "Processing completed after %f sec.\n", psTimerMark("phase2")); 809 828 810 829 // Write the output … … 812 831 pmFPAWriteMask(input, outputFile); 813 832 pmFPAWriteWeight(input, outputFile); 833 834 psLogMsg("phase2", PS_LOG_INFO, "Output completed after %f sec.\n", psTimerMark("phase2")); 814 835 815 836 #ifdef PRODUCTION … … 831 852 psFree(overscanFit); 832 853 psFree(overscanStats); 854 855 psLogMsg("phase2", PS_LOG_INFO, "Cleanup completed after %f sec.\n", psTimerMark("phase2")); 856 psTimerStop(); 833 857 834 858 #if 1 -
trunk/archive/scripts/src/phase2/phase2.config
r5564 r5621 6 6 BIAS BOOL FALSE # Bias subtraction 7 7 DARK BOOL FALSE # Dark subtraction 8 OVERSCAN BOOL FALSE # Overscan subtraction8 OVERSCAN BOOL TRUE # Overscan subtraction 9 9 FLAT BOOL FALSE # Flat-field normalisation 10 10 FRINGE BOOL FALSE # Fringe subtraction -
trunk/archive/scripts/src/phase2/pmFPAConceptsGet.c
r5564 r5621 344 344 case PS_TYPE_S32: 345 345 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; 346 356 break; 347 357 default: … … 977 987 } 978 988 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 979 1014 // Pau. 980 1015 } -
trunk/archive/scripts/src/phase2/pmFPAConceptsSet.c
r5583 r5621 856 856 } 857 857 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 858 881 // Pau. 859 882 } -
trunk/archive/scripts/src/phase2/pmFPAMorph.c
r5106 r5621 68 68 } 69 69 70 70 // Splice a list of cells together 71 71 static psArray *spliceCells(psList *outCells, // List of target cells (required for parity info) 72 72 psList *inCells, // List of cells to splice together
Note:
See TracChangeset
for help on using the changeset viewer.
