[Tutor] how to read and transmit/send only section of the image (sub-image)

Kent Johnson kent37 at tds.net
Sun Sep 6 16:23:53 CEST 2009


On Sat, Sep 5, 2009 at 10:52 AM, Jojo Mwebaze <jojo.mwebaze at gmail.com> wrote:
> oooh that will be helpful,  kindly point me to how i can begin with getting
> a sub-image that has the same width as the
> original. That will be my starting point.

I don't know the details of FITS format, but I imagine it would be
something like this:
- read enough of the FITS header to figure out where the image data is
in the file
- seek to the start of the sub-image and read the image data
- construct a new header for the sub-image
- write the new header and data to a new file

This will require some understanding of FITS format, or a library that
supports the operations you need. You might find code in PyFITS that
will help.

Kent


More information about the Tutor mailing list