Welcome to iraf.net Friday, May 17 2024 @ 01:58 PM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 Simple tvmark question
   
Gaba_p
 11/11/2009 08:50PM (Read 4700 times)  
++++-
Regular Member

Status: offline


Registered: 10/10/2008
Posts: 104
Hi all,I'm trying to do something very simple: I want to delete all stars found by daofind inside a given region (an arbitrary polynomial) . I've been experimenting with the 'e', 's', 'f', keystrokes and ':save', ':write', etc.. commands, but I can't seem to get it.Thanks!Cheers,
Gabriel

 
Profile Email Website
 Quote
fitz
 11/11/2009 08:50PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
What exactly is going wrong? Is it not editing the pixels correctly or just not saving the result? Note that with TVMARK the image you read back is the scaled display image not your original input image with the edits.You might also look at the SUBSTAR task in DAOPHOT to see if that can help, otherwise you might be looking for a task like IMEDIT or FIXPIX instead (see their help pages).-Mike

 
Profile Email
 Quote
Gaba_p
 11/11/2009 08:50PM  
++++-
Regular Member

Status: offline


Registered: 10/10/2008
Posts: 104
Nothing's going wrong really. I have an over saturated BIG star in the frame, and 'daofind' finds a bunch of objects inside that region that are actually nothing (i.e: inside that very big star 'daofind' finds dozens of objects that are not stars). If I have to delete those objects one by one (by positioning the cursor over each object and hitting the 'd' key) it takes me a long time. If I could select a region and then tell 'tvmark' to remove ALL objects inside that region from the '.coo.1' file, it would speed up the process a great deal.Is there a way I can do this with 'tvmarks' commands?Thanks Mike!

 
Profile Email Website
 Quote
fitz
 11/11/2009 08:50PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
TVMARK doesn't edit the image, it edits what's display in ximtool/ds9. If you then save that image you get a new image of the 200 graylevels displayed and not your edited input image suitable for daofind.I think the task you're looking for is IMEDIT, it will allow you interactively display and edit the image, and what you get out is the edited input image pixels. See the help page, and "help cursors" for a description of how to write a cursor file to do the interactive stuff automatically.-Mike

 
Profile Email
 Quote
Gaba_p
 11/11/2009 08:50PM  
++++-
Regular Member

Status: offline


Registered: 10/10/2008
Posts: 104
But I don't need/want to edit the image. I want to edit the '*.coo.1' file.I'll try to explain what I do:
After I run 'daofind' on a given frame, I run an interactive 'tvmark' to remove objects marked as stars when they are not, and add stars that were not found as such. What 'tvmark' does for me is edit the '*.coo.1' file, removing and adding what I tell it to with the cursor + the 'd' and 'a' keys. Now what I need is a way to select a whole region of the image and have 'tvmark' remove ALL objects inside that region from the '*.coo.1' file, just like it does if I select a single object moving the cursor over it and hitting the 'd' key.Long story short: I want to remove several objects AT THE SAME TIME from a '*.coo.1' file, using 'tvmark' (instead of having to remove them one by one by positioning the cursor over them and hitting the 'd' key)Hope I made myself clear.Thanks for bearing with me here Mike!
Gabriel

 
Profile Email Website
 Quote
fitz
 11/11/2009 08:50PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Ahh, I get it now. As I said, TVMARK is meant to edit the display, the ':save' and ":write' are means to save the displayed image to something new. When you use e.g. the 'd' to delete a point it removes it from the internal coord list in TVMARK, but there's no way to save that edited coordinate list (only the displayed image).What you want is a task that edits the coords file and answers the question: Is this (x,y) coord with a region defined by my arbitrary polynomial? That task doesn't exist. The best you can do is something like TSELECT to select from the .coo file those row where the (x,y) is within some range and then manually delete remaining points from the file.Alternatively, look at the STARFIND task. It has detection parameters such as 'hwhmpsf' that you might be able to set so it doesn't produce detections in the saturated star. Likewise, if you could create a mask of the saturated star (e.g. using MSKEXPR or IMEXPR (see help pages)) you could use IMEXPR to create an image that zeroes out this masked region and run DAOFIND on that output. There may be other mask-making tasks you could string together as a way to exclude the saturated star, you may need to script this up to automate it if you have many images.Frank might also comment, I know saturated stars are something he has to deal with in the iraf pipelines.Cheers,
-Mike

 
Profile Email
 Quote
Gaba_p
 11/11/2009 08:50PM  
++++-
Regular Member

Status: offline


Registered: 10/10/2008
Posts: 104
You say:"...When you use e.g. the 'd' to delete a point it removes it from the internal coord list in TVMARK, but [b:8deca05422]there's no way to save that edited coordinate list[/b:8deca05422] (only the displayed image). "What do you mean by 'there's no way'? I can save the edited coordinate list just by hitting the 'q' key to exit the interactive 'tvmark'. That way the '*.coo.1' file is edited and the objects I removed and/or added (with the 'd' and 'a' keys) are removed and/or added to that file.I thought that since 'tvmark' has ways to mark regions (like with the 's', 'v' and 'b' keys) it would somehow recognize which objects from the '*.coo.1' file where inside that region.And what about the 'e' key? In the help file it says:"e Mark region to be erased and restored, 2 keystrokes"What exactly does this key does?I'll check the STARFIND task. I can't create a mask since that saturated star has different sizes in frames taken with different filters.It would be great to add that functionality to 'tvmark', at least I know I would give it a good use SmileThanks again for all your help Mike!Cheers,
Gabriel

 
Profile Email Website
 Quote
fitz
 11/11/2009 08:50PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
You're right, the coord file is changed. (I'm in Germany at the moment and jet-lagged, my comment was based on the commands available in the help page).The 'e' key however does just erase the display, the result is saved to a "scratch" image internally until you :save it but I don't see where the coord list is modified. I'm hoping Frank can suggest a way to automatically identify/mask saturated stars since I know he does this all the time, at the moment I'm out of ideas but might think of something on the plane.Cheers,
-Mike

 
Profile Email
 Quote
Gaba_p
 11/11/2009 08:50PM  
++++-
Regular Member

Status: offline


Registered: 10/10/2008
Posts: 104
Hi Mike,still with this issue. I'm trying to use the 'pselect' task to remove a section from the '*.coo.1' file, but I'm running into a problem. First I show you the simple script I wrote to do this:procedure select (image,xmin1,xmax1,ymin1,ymax1)file image {prompt = "Input file name"}
real xmin1 {prompt = "Input min x value"}
real xmax1 {prompt = "Input max x value"}
real ymin1 {prompt = "Input min y value"}
real ymax1 {prompt = "Input max y value"}
begin string imname, expression
real xmin,xmax,ymin,ymax

imname = image
xmin = xmin1
xmax = xmax1
ymin = ymin1
ymax = ymax1

expression = "XCENTER < "//xmin
expression = expression // " "// '|| XCENTER > '//xmax
expression = expression // " "// '&& YCENTER < '//ymin
expression = expression // " "// '|| YCENTER > '//ymax

print ('\n Expression: '//expression) pselect.infiles = imname
pselect.outfiles = imname//'_pselect'
pselect.expr = expression
pselect

endThis way I feed the script with a section I want to remove from the file like this:xmin: 236, xmax: 715
ymin: 1445, ymax: 1646The problem is that, with this values I gave above, 'pselect' removes ALL objects in the region:xmin: 236, xmax: [b:dee7cbe2e1]end of frame[/b:dee7cbe2e1]
ymin: 1445, ymax: 1646I don't know why it wont recognize the '715' 'xmax' limit I give it, but it doesn't.Any help much appreciated!Cheers,
Gabriel
Edit:If I change the form of 'expression' like so: expression = "YCENTER < "//ymin
expression = expression // " "// '|| YCENTER > '//ymax
expression = expression // " "// '&& XCENTER < '//xmin
expression = expression // " "// '|| XCENTER > '//xmaxnow 'pselect' removes ALL objects in the region:xmin: 236, xmax: 715
ymin: 1445, ymax: [b:dee7cbe2e1]end of frame[/b:dee7cbe2e1]
Edit 2:Well, I fixed it with this: expression = "XCENTER < "//xmin
expression = expression // " "// '|| XCENTER > '//xmax
expression = expression // " "// '|| YCENTER < '//ymin
expression = expression // " "// '|| YCENTER > '//ymax

 
Profile Email Website
 Quote
fitz
 11/11/2009 08:50PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
Without trying it myself, I'd suggest you put parentheses around parts of the '||' parts of the expression so the '&&' part evaluates correctly. You might also look at the TSELECT task in TABLES.TTOOLS.

 
Profile Email
 Quote
   
Content generated in: 0.36 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