Welcome to iraf.net Tuesday, May 21 2024 @ 10:53 AM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 Searching for star IDs in coordinate files
   
aaron
 07/28/2008 11:11PM (Read 3659 times)  
+----
Newbie

Status: offline


Registered: 06/13/2008
Posts: 9
Hello,I'm doing some profile-fitting photometry on a bunch of images and we have run daofind on them. They produce a .coo file corresponding to each file. I wrote a program that calculates a predicted pixel position based upon an offset from one image. These pixel positions are within +/- 1 pixel (xcenter and ycenter) from their actual position in their .coo file. I was wondering if there is a way to search through these files to get the best coordinate match based upon the predicted position that my program gives for their pixel position, knowing that the actual position is only +/- 1 pixel away in either the xcenter and/or ycenter value. More importantly, I would like to use this to extract the ID number for these stars. There are about 67 images and about 20 stars we are working on in each image, making the process by hand very tedious and time consuming.Is there a fast way to do this?Thanks,
Aaron

 
Profile Email
 Quote
valdes
 07/28/2008 11:11PM  
+++++
Active Member

Status: offline


Registered: 11/11/2005
Posts: 728
Hello Aaron,I believe the task you want is tables.ttools.tmatch. This is a general tables matching task which, in combination with other tables tools, provides quite a lot of functionality. One key thing to know is that the tables tools read several formats including plain text tables, text tables with headers such as produced by the photometry tasks, binary tables, and STSDAS tables. In particularly, the photometry tasks were developed with the idea that the tables tasks could be used.So I think you would make a text file with your predictions in two columns and you would then be able to use tmatch to match against the .coo files. To just get the ID's you might need to use another tables task to just select the column (or a phot tools task too).Yours,
Frank Valdes

 
Profile Email
 Quote
aaron
 07/28/2008 11:11PM  
+----
Newbie

Status: offline


Registered: 06/13/2008
Posts: 9
I looked into this routine and it compares rows, but not columns. The coordinates in the .coo file are listed with 1 star per line and their data are sorted into columns. Is there a routine like tmatch that finds a best match through columns? That would be very helpful!

 
Profile Email
 Quote
valdes
 07/28/2008 11:11PM  
+++++
Active Member

Status: offline


Registered: 11/11/2005
Posts: 728
I think you are misunderstanding what the match task does. Suppose you have two files like:[code:1:ca5929dfa4]
File 1:
starid1 ... 10.1 12.2 ...
starid2 ... 25.3 91.2 ...
starid3 ... 47.6 98.4 ...File 2:
mycalc1 83.2 55.7
mycalc2 10.8 11.9
mycalc3 47.0 98.1
mycalc4 66.2 80.8
[/code:1:ca5929dfa4]Then tmatch would match mycal2 to starid1, mycalc3 to starid3. It matches the rows based on the values in the columns.Frank Valdes

 
Profile Email
 Quote
aaron
 07/28/2008 11:11PM  
+----
Newbie

Status: offline


Registered: 06/13/2008
Posts: 9
I've tried using this but I haven't been able to get this to work. I want it to match the closest coordinates between two files and be able to extract the ID number with the coordinates from the .coo file compared to my projected coordinate file.A sample .coo file is:#K IRAF = NOAO/IRAFV2.12.2-EXPORT version %-23s
#K USER = aaron name %-23s
#K HOST = bastet computer %-23s
#K DATE = 2008-07-28 yyy-mm-dd %-23s
#K TIME = 17:33:23 hh:mm:ss %-23s
#K PACKAGE = apphot name %-23s
#K TASK = daofind name %-23s
#
#K SCALE = 1. units %-23.7g
#K FWHMPSF = 3. scaleunit %-23.7g
#K EMISSION = yes switch %-23b
#K DATAMIN = -1000. counts %-23.7g
#K DATAMAX = 15000. counts %-23.7g
#K EXPOSURE = EXPTIME keyword %-23s
#K AIRMASS = AIRMASS keyword %-23s
#K FILTER = FILTER keyword %-23s
#K OBSTIME = OBSTIME keyword %-23s
#
#K NOISE = poisson model %-23s
#K SIGMA = 5. counts %-23.7g
#K GAIN = GAIN keyword %-23s
#K EPADU = 72. e-/adu %-23.7g
#K CCDREAD = RDNOISE keyword %-23s
#K READNOISE = 45. e- %-23.7g
#
#K IMAGE = shiftrir040619.ADDEDK.5 imagename %-23s
#K FWHMPSF = 3. scaleunit %-23.7g
#K THRESHOLD = 3. sigma %-23.7g
#K NSIGMA = 1.5 sigma %-23.7g
#K RATIO = 1. number %-23.7g
#K THETA = 0. degrees %-23.7g
#
#K SHARPLO = 0.2 number %-23.7g
#K SHARPHI = 1. number %-23.7g
#K ROUNDLO = -1. number %-23.7g
#K ROUNDHI = 1. number %-23.7g
#
#N XCENTER YCENTER MAG SHARPNESS SROUND GROUND ID \
#U pixels pixels # # # # # \
#F %-13.3f %-10.3f %-9.3f %-12.3f %-12.3f %-12.3f %-6d \
#
85.116 1.355 -0.090 0.648 -0.184 0.772 1
179.550 2.022 -2.092 0.627 -0.197 0.030 2
405.077 1.484 -0.038 0.439 0.517 0.594 3
30.037 3.520 -0.398 0.455 -0.490 0.163 4
277.604 4.387 -2.058 0.533 -0.609 -0.128 5
365.135 4.555 -1.538 0.621 0.094 0.226 6
46.164 4.775 -1.436 0.492 -0.723 0.297 7
74.530 4.899 -1.058 0.585 -0.716 -0.440 8
.
.
.My projected coordinate file just looks like:XCENTER YCENTER
229.928 201.95
228.872 150.846
248.529 120.13
216.788 94.575
193.332 72.62
185.077 100.108
195.423 118.306
155.593 109.959
151.278 115.364
149.784 132.46
156.931 155.596
196.464 176.343
155.079 208.354
108.679 169.288
99.912 187.125
111.891 68.061
77.417 45.543
47.076 67.575
55.299 85.614
74.166 87.163When I use tmatch, it says:tt> tmatch
First input table: shiftrir040619.ADDEDK.5.coo
Second input table: result2.txt
Output table: zresult.txt
Columns to match in first table: XCENTER,YCENTER
Columns to match in second table: XCENTER,YCENTER
Maximum distance for allowed match (0.Smile: 2
ERROR: Match columns not found in tableDo you know how I can get this to work?Thanks again,
Aaron

 
Profile Email
 Quote
valdes
 07/28/2008 11:11PM  
+++++
Active Member

Status: offline


Registered: 11/11/2005
Posts: 728
Below is an example using some of your data. I had to change the coordinates in the .coo file because you only gave the beginning and none of the coordinates overlapped the results2.txt file. I added an 0.1 pixel offset in both x and y between the two lists. In reality there would be a different offset and a random error component.[code:1:1014f1dc02]
ttools> type sample.coo
#K IRAF = NOAO/IRAFV2.12.2-EXPORT version %-23s
#K USER = aaron name %-23s
#K HOST = bastet computer %-23s
#K DATE = 2008-07-28 yyy-mm-dd %-23s
#K TIME = 17:33:23 hh:mm:ss %-23s
#K PACKAGE = apphot name %-23s
#K TASK = daofind name %-23s
#
#K SCALE = 1. units %-23.7g
#K FWHMPSF = 3. scaleunit %-23.7g
#K EMISSION = yes switch %-23b
#K DATAMIN = -1000. counts %-23.7g
#K DATAMAX = 15000. counts %-23.7g
#K EXPOSURE = EXPTIME keyword %-23s
#K AIRMASS = AIRMASS keyword %-23s
#K FILTER = FILTER keyword %-23s
#K OBSTIME = OBSTIME keyword %-23s
#
#K NOISE = poisson model %-23s
#K SIGMA = 5. counts %-23.7g
#K GAIN = GAIN keyword %-23s
#K EPADU = 72. e-/adu %-23.7g
#K CCDREAD = RDNOISE keyword %-23s
#K READNOISE = 45. e- %-23.7g
#
#K IMAGE = shiftrir040619.ADDEDK.5 imagename %-23s
#K FWHMPSF = 3. scaleunit %-23.7g
#K THRESHOLD = 3. sigma %-23.7g
#K NSIGMA = 1.5 sigma %-23.7g
#K RATIO = 1. number %-23.7g
#K THETA = 0. degrees %-23.7g
#
#K SHARPLO = 0.2 number %-23.7g
#K SHARPHI = 1. number %-23.7g
#K ROUNDLO = -1. number %-23.7g
#K ROUNDHI = 1. number %-23.7g
#
#N XCENTER YCENTER MAG SHARPNESS SROUND GROUND ID \
#U pixels pixels # # # # # \
#F %-13.3f %-10.3f %-9.3f %-12.3f %-12.3f %-12.3f %-6d \
#
229.828 201.85 -2.058 0.533 -0.609 -0.128 5
248.429 120.03 -0.398 0.455 -0.490 0.163 4
216.688 94.475 -1.058 0.585 -0.716 -0.440 8
184.977 100.008 -0.090 0.648 -0.184 0.772 1
195.323 118.206 -1.538 0.621 0.094 0.226 6
151.178 115.264 -2.092 0.627 -0.197 0.030 2
156.831 155.496 -0.038 0.439 0.517 0.594 3
154.979 208.254 -1.436 0.492 -0.723 0.297 7
ttools> type results2.txt
229.928 201.95
228.872 150.846
248.529 120.13
216.788 94.575
193.332 72.62
185.077 100.108
195.423 118.306
155.593 109.959
151.278 115.364
149.784 132.46
156.931 155.596
196.464 176.343
155.079 208.354
108.679 169.288
99.912 187.125
111.891 68.061
77.417 45.543
47.076 67.575
55.299 85.614
74.166 87.163
ttools> lpar tmatch
input1 = "sample.coo" First input table
input2 = "results2.txt" Second input table
output = "match.txt" Output table
match1 = "c1 c2" Columns to match in first table
match2 = "c1 c2" Columns to match in second table
maxnorm = 2. Maximum distance for allowed match
(incol1 = " ") Columns copied to output from first table
(incol2 = " ") Columns copied to output from second table
(factor = " ") Weighting factors used in computing distance
(diagfile = "STDOUT") Diagnostic output file
(nmcol1 = " ") ID columns in diagnostic output from first tabl
(nmcol2 = " ") ID columns in diagnostic output from second tab
(sphere = no) Apply spherical correction?
(mode = "ql")
ttools> tmatch sample.coo results2.txt match.txt "c1 c2" "c1 c2" 2.The following objects have the largest norms:
Norm = 0.1414214
1:3
2:4 Norm = 0.1414214
1:7
2:11 Norm = 0.1414214
1:8
2:13 Norm = 0.1414214
1:4
2:6 Norm = 0.1414214
1:6
2:9 Norm = 0.1414214
1:5
2:7 Norm = 0.1414214
1:2
2:3 Norm = 0.1414214
1:1
2:1 ttools> type match.txt
#c C1_1 d %8.6g
#c C2_1 d %8.6g
#c C3 d %6.4g
#c C4 d %6.4g
#c C5 d %6.4g
#c C6 d %6.4g
#c C7 i %2d
#c C1_2 d %8.6g
#c C2_2 d %8.6g
#k IRAF = NOAO/IRAFV2.12.2-EXPORT version %-23s
#k USER = aaron name %-23s
#k HOST = bastet computer %-23s
#k DATE = 2008-07-28 yyy-mm-dd %-23s
#k TIME = 17:33:23 hh:mm:ss %-23s
#k PACKAGE = apphot name %-23s
#k TASK = daofind name %-23s
#k SCALE = 1. units %-23.7g
#k FWHMPSF = 3. scaleunit %-23.7g
#k EMISSION = yes switch %-23b
#k DATAMIN = -1000. counts %-23.7g
#k DATAMAX = 15000. counts %-23.7g
#k EXPOSURE = EXPTIME keyword %-23s
#k AIRMASS = AIRMASS keyword %-23s
#k FILTER = FILTER keyword %-23s
#k OBSTIME = OBSTIME keyword %-23s
#k NOISE = poisson model %-23s
#k SIGMA = 5. counts %-23.7g
#k GAIN = GAIN keyword %-23s
#k EPADU = 72. e-/adu %-23.7g
#k CCDREAD = RDNOISE keyword %-23s
#k READNOIS = 45. e- %-23.7g
#k IMAGE = shiftrir040619.ADDEDK.5 imagename %-23s
#k FWHMPSF = 3. scaleunit %-23.7g
#k THRESHOL = 3. sigma %-23.7g
#k NSIGMA = 1.5 sigma %-23.7g
#k RATIO = 1. number %-23.7g
#k THETA = 0. degrees %-23.7g
#k SHARPLO = 0.2 number %-23.7g
#k SHARPHI = 1. number %-23.7g
#k ROUNDLO = -1. number %-23.7g
#k ROUNDHI = 1. number %-23.7g
#
#
#
#
#
#N XCENTER YCENTER MAG SHARPNESS SROUND GROUND ID U pixels pixels # # # # # F
%-13.3f %-10.3f %-9.3f %-12.3f %-12.3f %-12.3f %-6d
229.828 201.85 -2.058 0.533 -0.609 -0.128 5 229.928 201.95
248.429 120.03 -0.398 0.455 -0.49 0.163 4 248.529 120.13
216.688 94.475 -1.058 0.585 -0.716 -0.44 8 216.788 94.575
184.977 100.008 -0.09 0.648 -0.184 0.772 1 185.077 100.108
195.323 118.206 -1.538 0.621 0.094 0.226 6 195.423 118.306
151.178 115.264 -2.092 0.627 -0.197 0.03 2 151.278 115.364
156.831 155.496 -0.038 0.439 0.517 0.594 3 156.931 155.596
154.979 208.254 -1.436 0.492 -0.723 0.297 7 155.079 208.354
[/code:1:1014f1dc02]Note I took out the header line of the results2.txt file. If it was commented it probably would also work.Frank

 
Profile Email
 Quote
aaron
 07/28/2008 11:11PM  
+----
Newbie

Status: offline


Registered: 06/13/2008
Posts: 9
Thanks! I got it working! This will be very helpful.Thanks for showing me how to use this routine Smile

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