Welcome to iraf.net Tuesday, May 21 2024 @ 10:07 PM GMT
smp |
06/09/2010 11:42AM (Read 3171 times)
|
|
|
Status: offline
Registered: 07/27/2008
Posts: 70
|
hi,I have an image section [x1 2, y1:y2].
I want to calculate total counts in these (x2-x1) x (y2-y1) pixels.
Any help is appreciated.Regards,
smp
|
|
|
|
fitz |
06/09/2010 11:42AM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
Try something like[code:1:62c5608009]
cl> listpix dev$pix[1:10,1:10] verb- | fields STDIN 3 | average STDIN
[/code:1:62c5608009]The sum of the pixels in the section will be in the 'sum' parameter of the AVERAGE task or you can multiple the average times the number of samples that appear on the output.
|
|
|
|
smp |
06/09/2010 11:42AM
|
|
|
Status: offline
Registered: 07/27/2008
Posts: 70
|
Thanks.
'sum' parameter of 'average' task shows sum of pixel values.[code:1:a71bcd4384]cl> listpix dev$pix[1:10,1:10] verb- | fields STDIN 3 | average STDIN [/code:1:a71bcd4384]But I did not get following meanings:what is 'dev$pix' ?
verb- says do not list the pixel values ?
what is ' | fields STDIN 3' ? especially number 3?regards,
smp
|
|
|
|
fitz |
06/09/2010 11:42AM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
[quote:341fcd4baf]what is 'dev$pix' ?[/quote:341fcd4baf]The standard test image distributed with the system.[quote:341fcd4baf]verb- says do not list the pixel values ?[/quote:341fcd4baf]See the help page, it just supresses the title line not the pixels.[quote:341fcd4baf]what is ' | fields STDIN 3' ? especially number 3?[/quote:341fcd4baf]The example pipes the output of LISTPIX to the FIELDS task where column 3 is selected, that then gets piped to the AVERAGE task to do the sum.
|
|
|
|
jcadien1 |
06/09/2010 11:42AM
|
|
|
Status: offline
Registered: 11/28/2006
Posts: 21
|
SMP,
If you do an imstat file.fits[x1 2,y1:y2]. it will print the number of pixels and the average. Multiply the two and you will have the sum of counts in all those pixels.
N.B. the number of pixels in x1 2 is NOT x2-x1. Eg. 1:10 is 10 pixels,
10-1=9.Jim
|
|
|
|
smp |
06/09/2010 11:42AM
|
|
|
Status: offline
Registered: 07/27/2008
Posts: 70
|
Thanks, fitz and jcadien1.Regards,
smp
|
|
|
|
| |
|
Content generated in: 0.21 seconds |
|