Standard Forth versus Python: a case study

John Doty jpd at whispertel.LoseTheH.net
Thu Oct 12 15:29:43 EDT 2006


Juho Schultz wrote:
> John Doty wrote:
> 
>> The problem:
>>
>> I have a bunch of image files in FITS format. For each raster row in
>> each file, I need to determine the median pixel value and subtract it
>> from all of the pixels in that row, and then write out the results as
>> new FITS files.
>>
> 
> This may be personal bias... I have spent a few years with FITS files
> so every time I see 'FITS' I think 'astronomy' - maybe you are doing
> something else. (Someone wrote he does not know what FITS is - see
> fits.gsfc.nasa.gov In a nutshell: FITS file is a list of header-data
> units. Each header is text containing optional keyword-value pairs and
> reading instructions for the data unit. Usually astronomical image data
> but it can be anything.)
> 
> Sounds like subtracting sky background from the frames, though for some
> reason (speed?) column-wise. You could have a look at either PyRAF
> (www.stsci.edu/resources/software_hardware/pyraf) or PyMidas
> (www.eso.org/sampo/pymidas/). Running some semi-official
> sky-subtraction algorithm would at least give you a good case to test
> against.
> 
> You could also check if ftools already does this. I have not used it
> much, but sometimes it saves huge amounts of coding time.
> heasarc.gsfc.nasa.gov/docs/software/ftools/ftools_menu.html
> 
>> This is a real problem I need to solve, not a made-up toy problem. I was
>> originally thinking of solving it in C (I know where to get the pieces
>> in that language)
> 
> Could you tell a bit more of the data? Are you aiming for accuracy,
> speed or getting as complete time series as possible? (for me, speed
> has never been an issue) Photometry/astrometry/something else? Is there
> some trade-off like "get best possible result in X seconds"?

Yeah, I'm fairly familiar with that stuff, I was/am an investigator on 
ASCA, Chandra, HETE-2, Suzaku. Didn't know of anything quite right for 
this job. With the right imports it was only 15 lines of Python, hard to 
beat that.

It isn't my data to release, it's MKI's. Development project. And they 
have plenty of folks who know IRAF, ftools, etc. They didn't know how to 
do quite what they wanted here.

-- 
John Doty, Noqsi Aerospace, Ltd.
--
Specialization is for robots.



More information about the Python-list mailing list