Changeset 13900 for trunk/psphot/src/psphotSourcePlots.c
- Timestamp:
- Jun 19, 2007, 4:40:44 PM (19 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotSourcePlots.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotSourcePlots.c
r13006 r13900 1 1 # include "psphotInternal.h" 2 2 3 bool psphotSourcePlots (pmReadout *readout, psArray *sources, psMetadata *recipe ) {3 bool psphotSourcePlots (pmReadout *readout, psArray *sources, psMetadata *recipe, psMaskType maskVal) { 4 4 5 5 // bool status = false; … … 17 17 18 18 // counters to track the size of the image and area used in a row 19 int dX = 0; // starting corner of next box20 int dY = 0; // height of row so far21 int NX = 20*DX; // full width of output image22 int NY = 0; // total height of output image19 int dX = 0; // starting corner of next box 20 int dY = 0; // height of row so far 21 int NX = 20*DX; // full width of output image 22 int NY = 0; // total height of output image 23 23 24 24 // first, examine the PSF and SAT stars: … … 28 28 pmSource *source = sources->data[i]; 29 29 30 bool keep = false;30 bool keep = false; 31 31 keep |= (source->mode & PM_SOURCE_MODE_PSFSTAR); 32 32 keep |= (source->mode & PM_SOURCE_MODE_SATSTAR); 33 if (!keep) continue;33 if (!keep) continue; 34 34 35 // how does this subimage get placed into the output image?36 // DX = source->pixels->numCols37 // DY = source->pixels->numRows35 // how does this subimage get placed into the output image? 36 // DX = source->pixels->numCols 37 // DY = source->pixels->numRows 38 38 39 if (dX + DX > NX) {40 // too wide for the rest of this row41 if (dX == 0) {42 // alone on this row43 NY += DY;44 dX = 0;45 dY = 0;46 } else {47 // start the next row48 NY += dY;49 dX = DX;50 dY = DY;51 }52 } else {53 // extend this row54 dX += DX;55 dY = PS_MAX (dY, DY);56 }39 if (dX + DX > NX) { 40 // too wide for the rest of this row 41 if (dX == 0) { 42 // alone on this row 43 NY += DY; 44 dX = 0; 45 dY = 0; 46 } else { 47 // start the next row 48 NY += dY; 49 dX = DX; 50 dY = DY; 51 } 52 } else { 53 // extend this row 54 dX += DX; 55 dY = PS_MAX (dY, DY); 56 } 57 57 } 58 58 … … 61 61 psImage *outsub = psImageAlloc (NX, NY, PS_TYPE_F32); 62 62 63 int Xo = 0; // starting corner of next box64 int Yo = 0; // starting corner of next box65 dY = 0; // height of row so far63 int Xo = 0; // starting corner of next box 64 int Yo = 0; // starting corner of next box 65 dY = 0; // height of row so far 66 66 67 67 int nPSF = 0; 68 68 int nSAT = 0; 69 int kapa = 0; // file descriptor for plotting routine69 int kapa = 0; // file descriptor for plotting routine 70 70 71 71 // first, examine the PSF and SAT stars: … … 76 76 pmSource *source = sources->data[i]; 77 77 78 bool keep = false;78 bool keep = false; 79 79 if (source->mode & PM_SOURCE_MODE_PSFSTAR) { 80 nPSF ++;81 keep = true;82 }80 nPSF ++; 81 keep = true; 82 } 83 83 if (source->mode & PM_SOURCE_MODE_SATSTAR) { 84 nSAT ++;85 keep = true;86 } 87 if (!keep) continue;84 nSAT ++; 85 keep = true; 86 } 87 if (!keep) continue; 88 88 89 // how does this subimage get placed into the output image?90 // DX = source->pixels->numCols91 // DY = source->pixels->numRows89 // how does this subimage get placed into the output image? 90 // DX = source->pixels->numCols 91 // DY = source->pixels->numRows 92 92 93 if (Xo + DX > NX) {94 // too wide for the rest of this row95 if (Xo == 0) {96 // place source alone on this row97 psphotAddWithTest (source, true); // replace source if subtracted98 psphotRadialPlot (&kapa, "radial.plots.ps", source);99 psphotMosaicSubimage (outpos, source, Xo, Yo, DX, DY);93 if (Xo + DX > NX) { 94 // too wide for the rest of this row 95 if (Xo == 0) { 96 // place source alone on this row 97 psphotAddWithTest (source, true, maskVal); // replace source if subtracted 98 psphotRadialPlot (&kapa, "radial.plots.ps", source); 99 psphotMosaicSubimage (outpos, source, Xo, Yo, DX, DY); 100 100 101 psphotSubWithTest (source, false); // remove source (force)102 psphotMosaicSubimage (outsub, source, Xo, Yo, DX, DY);101 psphotSubWithTest (source, false, maskVal); // remove source (force) 102 psphotMosaicSubimage (outsub, source, Xo, Yo, DX, DY); 103 103 104 psphotSetState (source, false); // replace source (has been subtracted)105 Yo += DY;106 Xo = 0;107 dY = 0;108 } else {109 // start the next row110 Yo += dY;111 Xo = 0;112 psphotAddWithTest (source, true); // replace source if subtracted113 psphotRadialPlot (&kapa, "radial.plots.ps", source);114 psphotMosaicSubimage (outpos, source, Xo, Yo, DX, DY);104 psphotSetState (source, false, maskVal); // replace source (has been subtracted) 105 Yo += DY; 106 Xo = 0; 107 dY = 0; 108 } else { 109 // start the next row 110 Yo += dY; 111 Xo = 0; 112 psphotAddWithTest (source, true, maskVal); // replace source if subtracted 113 psphotRadialPlot (&kapa, "radial.plots.ps", source); 114 psphotMosaicSubimage (outpos, source, Xo, Yo, DX, DY); 115 115 116 psphotSubWithTest (source, false); // remove source (force)117 psphotMosaicSubimage (outsub, source, Xo, Yo, DX, DY);118 psphotSetState (source, false); // replace source (has been subtracted)116 psphotSubWithTest (source, false, maskVal); // remove source (force) 117 psphotMosaicSubimage (outsub, source, Xo, Yo, DX, DY); 118 psphotSetState (source, false, maskVal); // replace source (has been subtracted) 119 119 120 Xo = DX;121 dY = DY;122 }123 } else {124 // extend this row125 psphotAddWithTest (source, true); // replace source if subtracted126 psphotRadialPlot (&kapa, "radial.plots.ps", source);127 psphotMosaicSubimage (outpos, source, Xo, Yo, DX, DY);120 Xo = DX; 121 dY = DY; 122 } 123 } else { 124 // extend this row 125 psphotAddWithTest (source, true, maskVal); // replace source if subtracted 126 psphotRadialPlot (&kapa, "radial.plots.ps", source); 127 psphotMosaicSubimage (outpos, source, Xo, Yo, DX, DY); 128 128 129 psphotSubWithTest (source, false); // remove source (force)130 psphotMosaicSubimage (outsub, source, Xo, Yo, DX, DY);131 psphotSetState (source, false); // replace source (has been subtracted)129 psphotSubWithTest (source, false, maskVal); // remove source (force) 130 psphotMosaicSubimage (outsub, source, Xo, Yo, DX, DY); 131 psphotSetState (source, false, maskVal); // replace source (has been subtracted) 132 132 133 Xo += DX;134 dY = PS_MAX (dY, DY);135 }133 Xo += DX; 134 dY = PS_MAX (dY, DY); 135 } 136 136 } 137 137
Note:
See TracChangeset
for help on using the changeset viewer.
