Welcome to iraf.net Wednesday, May 01 2024 @ 06:54 AM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 To find coordinates of the pixel having maximum counts
   
smp
 03/19/2009 04:27AM (Read 4354 times)  
++++-
Regular Member

Status: offline


Registered: 07/27/2008
Posts: 70
Hi,I want to know whether there is any IRAF task which will tell (x,y) coordinates of that pixel which is having maximum counts , in a specified image section.thanks
swapnil

 
Profile Email
 Quote
fitz
 03/19/2009 04:27AM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
See MINMAX.

 
Profile Email
 Quote
smp
 03/19/2009 04:27AM  
++++-
Regular Member

Status: offline


Registered: 07/27/2008
Posts: 70
hi,I tried MINMAX task. But it showed only minimum and maximum values for an image section. It did not show (x,y) coordinates of those two pixels.what I got is this:
[code:1:4b4370c7a0]im> minmax
Images to be examined (myimage.fits[1525:1570,520:540]): myimage.fits[1525:1570,520:540] [46,3] 21.58049011230469 [20,9] 33647.60546875
[/code:1:4b4370c7a0]So 21.58049011230469 is min. count and 33647.60546875 is max. count.What are [46,3] and [20,9] before the counts? Definitely they are not x,y coordinates in my image section.swapnil

 
Profile Email
 Quote
fitz
 03/19/2009 04:27AM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
They are the coords of the min/max pixel. However, suppose you have a 100x100 section of a 1024x1024 image, the coords will have a max value of 100 because the section size is only 100x100. Passing an image section into any task is very much like copying out that section to a new image first, in your case just add the task coords to the image section to get the coord in the parent image.-Mike

 
Profile Email
 Quote
smp
 03/19/2009 04:27AM  
++++-
Regular Member

Status: offline


Registered: 07/27/2008
Posts: 70
Thanks Mike. I checked the co-ordiantes. They are right.Now I am writing a small script , so that I can find x,y coordiantes of min. and max. counts for a specified image section in all my images:[code:1:5a15cd5923]procedure find_xy(input)string input {prompt = "Name of file containing reduced images"}begin string str minmax(images = input, force = no,update = no, verbose = no) | scan(str) print(str)end
[/code:1:5a15cd5923]If I run this script , I get the error:[quote:5a15cd5923]ERROR on line 13: Attempt to access undefined local variable `str'.
find_xy ()
find_xy ()[/quote:5a15cd5923]I have declared the 'str' as string .
What is the reason for such error?Swapnil

 
Profile Email
 Quote
jturner
 03/19/2009 04:27AM  
+++++
Active Member

Status: offline


Registered: 12/29/2005
Posts: 165
The cause of the error is that no value was placed in "str" by scan() because you ran minmax with verbose-, which doesn't print anything... Thus in the final print statement you are trying to print the value of an uninitialized variable.Before using scan() to parse output from a command, it is always a good idea to run exactly the same command without the pipe first, to make sure it is doing what you think it should be.Cheers,James.

 
Profile Email
 Quote
   
Content generated in: 0.20 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login