I'm very new to scripting and have a relatively simple problem that I'm hoping someone can help with.
So I have a FITS image file and I'm basically copying small subsections of it using this function called imcopy within iraf:
http://stsdas.stsci.edu/cgi-bin/gethelp.cgi?imcopy
The function requires me to provide the two x inputs and two y inputs, so something like this:
imcopy image.fits[x1:x2,y1:y2] output.fits
But I have about 300 of these x1,x2,x3,x4 input rows in a text file and I'm wondering if it would be possible to feed this text file using a python script somehow.
I imagine a loop in pyraf (which uses the python language) that runs the above function for every row may be a possibility but I'm only just starting to learn python so I'm not very familiar with it yet.
Any help would be greatly appreciated.