Welcome to iraf.net Friday, April 19 2024 @ 07:52 PM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 Cutting out postage stamps around given RA & DEC
   
sa14722
 08/06/2015 12:46PM (Read 1572 times)  
+----
Newbie

Status: offline


Registered: 12/11/2014
Posts: 6
Hi,

I have two images of a cluster taken from two different filters. I've ran photometry on the two images and have a list of RA & DEC of objects that are common in both images. I want to cut out small postage stamps of these objects with a user specified dx and dy to match the size of the objects. The images have already been aligned and processed.

Is there anyway for me to feed iraf a list of RA & DEC (text file?) along with the size of the postage stamps so that iraf can then cut them out in both filters? I haven't yet found a function that can do this task.

 
Profile Email
 Quote
fitz
 08/11/2015 08:40PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040

We don't (yet) have a a generalized cutout tool, the closest you might find in distribution is the ACECUTOUTS task in the NFEXTERN.ACE package (see the help page for details).

In general, the problem involves converting the RA/DEC coords to image coords and then simply copying out the pixels. This can be done in some cases with a script using tasks like WCSCTRAN and IMCOPY or with a compiled task, but it's starts to get messy depending on whether you need to deal with registration, rotation, image extensions and so on.

 
Profile Email
 Quote
sa14722
 08/12/2015 12:54PM  
+----
Newbie

Status: offline


Registered: 12/11/2014
Posts: 6
Quote by: fitz


We don't (yet) have a a generalized cutout tool, the closest you might find in distribution is the ACECUTOUTS task in the NFEXTERN.ACE package (see the help page for details).

In general, the problem involves converting the RA/DEC coords to image coords and then simply copying out the pixels. This can be done in some cases with a script using tasks like WCSCTRAN and IMCOPY or with a compiled task, but it's starts to get messy depending on whether you need to deal with registration, rotation, image extensions and so on.



So I've got the X/Y coords of the objects (converted from RA/DEC using the header) and have aligned the frames together with WCS. I'm currently trying a pyraf script to imcopy a 150 by 150 pixel region. Not being very familiar with pyraf or python, so far I've got this simple script:

#! /usr/bin/env python

import sys
from pyraf import iraf

iraf.images()

iraf.imcopy('r_new.fits[4708:4858,4937:5087]')
iraf.imcopy('fuv.fits[4708:4858,4937:5087]')

__

Are there any quick changes/additions you could suggest through which I could feed in a text file containing all the X and Y of the objects and get the regions out? I seem to run into a brick wall when I try to put in a general defined variable within imcopy rather than a number like this:

#! /usr/bin/env python

import sys
from pyraf import iraf

a=4708
b=4858
c=4937
d=5087

iraf.images()

iraf.imcopy('r_new.fits[a:b,c:d]')
iraf.imcopy('fuv.fits[a:b,c:d]')
__

I'm not quite sure why this gives an error even though its essentially doing the same as above. The other issue is that I haven't yet found a way to tell pyraf within the script what to name the output file. It always prompts me to name the file on the terminal after I've run the script. Sorry for the long question and thank you for the help.

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