Changeset 35611
- Timestamp:
- May 30, 2013, 2:32:30 PM (13 years ago)
- File:
-
- 1 edited
-
trunk/pstamp/src/ppstampMakeStamp.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pstamp/src/ppstampMakeStamp.c
r35497 r35611 814 814 psArray *inSources = inDetections->allSources; 815 815 816 // copy analysis metadata in order to pick up any data stored there from the input file. 817 // This includes detection efficiency analysis and extended source parameters. 818 psMetadataCopy(outReadout->analysis, inReadout->analysis); 819 820 // now replace the sources with a new container 816 821 pmDetections *outDetections = pmDetectionsAlloc(); 817 822 psMetadataAddPtr (outReadout->analysis, PS_LIST_TAIL, "PSPHOT.DETECTIONS", PS_META_REPLACE | PS_DATA_UNKNOWN, … … 820 825 psArray *outSources = outDetections->allSources = psArrayAllocEmpty( 100 ); 821 826 822 // include sources that are off the stamp by just a little bit 827 // include sources that are off the stamp by just a little bit 828 // XXX: should I be doing this? 823 829 #define EXPAND_SIZE 16 824 830 psRegion sourceRegion = extractRegion; … … 828 834 sourceRegion.y1 += EXPAND_SIZE; 829 835 836 bool adjustCoords = extractRegion.x0 != 0 || extractRegion.y0 != 0; 837 830 838 for (int i = 0; i < inSources->n; i++ ) { 831 839 pmSource *src = inSources->data[i]; … … 837 845 continue; 838 846 } 847 if (adjustCoords) { 848 // adjust the source position for the stamp coordinate system 849 src->peak->x -= extractRegion.x0; 850 src->peak->xf -= extractRegion.x0; 851 852 src->peak->y -= extractRegion.y0; 853 src->peak->yf -= extractRegion.y0; 854 if (src->moments) { 855 src->moments->Mx -= extractRegion.x0; 856 src->moments->My -= extractRegion.y0; 857 } 858 if (src->modelPSF) { 859 src->modelPSF->params->data.F32[PM_PAR_XPOS] -= extractRegion.x0; 860 src->modelPSF->params->data.F32[PM_PAR_YPOS] -= extractRegion.y0; 861 } 862 863 if (src->modelFits) { 864 for (int j = 0; j < src->modelFits->n; j++) { 865 pmModel *model = src->modelFits->data[j]; 866 assert (model != NULL); 867 model->params->data.F32[PM_PAR_XPOS] -= extractRegion.x0; 868 model->params->data.F32[PM_PAR_YPOS] -= extractRegion.y0; 869 } 870 } 871 } 872 839 873 psArrayAdd(outSources, 100, src); 840 874 }
Note:
See TracChangeset
for help on using the changeset viewer.
