Re: adding lines of an image together [message #67397] |
Mon, 27 July 2009 14:07 |
Barbara
Messages: 17 Registered: July 2009
|
Junior Member |
|
|
On Jul 27, 1:51 pm, David Fanning <n...@dfanning.com> wrote:
> Barbara writes:
>> For my research, I need to be able to add/condense lines of a fits
>> image to be able to plot it. It can be up to 100 lines, and so I was
>> thinking I need a program. I was wondering if there was one already
>> created. If not, I was wondering how to set up a program to do this. I
>> have attempted to try and came up with this:
>
>> pro sum_rows, image, start, death, new
>> COMPILE_OPT idl2
>> current=start
>> while (current le death) do begin
>
>> new= image[*,start]++
>> current=new
>> endwhile
>
>> iplot, new
>> end
>
>> (where start is the row i want to start at and death is the place i
>> want to stop) Any advice/help would be appreciated!
>
> How about this:
>
> sumLine = Total(image[*,start:death], 2)
>
> Cheers,
>
> David
> --
> David Fanning, Ph.D.
> Coyote's Guide to IDL Programming (www.dfanning.com)
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")
yep that would do it! Thank you very much!
|
|
|
Re: adding lines of an image together [message #67398 is a reply to message #67397] |
Mon, 27 July 2009 13:51  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Barbara writes:
> For my research, I need to be able to add/condense lines of a fits
> image to be able to plot it. It can be up to 100 lines, and so I was
> thinking I need a program. I was wondering if there was one already
> created. If not, I was wondering how to set up a program to do this. I
> have attempted to try and came up with this:
>
> pro sum_rows, image, start, death, new
> COMPILE_OPT idl2
> current=start
> while (current le death) do begin
>
> new= image[*,start]++
> current=new
> endwhile
>
> iplot, new
> end
>
> (where start is the row i want to start at and death is the place i
> want to stop) Any advice/help would be appreciated!
How about this:
sumLine = Total(image[*,start:death], 2)
Cheers,
David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|