[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Merging Bytarr
Thanks Craig.
I used this clumsy way:
d=bytarr(3,40,700)
d(0,0,0)=a & d(0,0,200)=b & d(0,0,300)=c
You way is better.
What throws me off in the first place was that the image, when shown on
screen, was 40 wide and 100 high, the next one 200 high, and the last one
400 high. To be pasted into 40 wide x 700 wide. The sequence of the
(3,40,etc) was not the same as my experience with other array indices (may
be I am missing something).
Thanks,
Mark Chan
"Craig Markwardt" <craigmnet@cow.physics.wisc.edu> wrote in message
on8zoct3qv.fsf@cow.physics.wisc.edu">news:on8zoct3qv.fsf@cow.physics.wisc.edu...
>
> "Mark Chan" <chanm@cadvision.com> writes:
>
> > I am new to bytarr operation.
> >
> > I have 3 separate color images in the following format:
> >
> > bytarr(3,40,15500)=a
> > bytarr(3,40,15500)=b
> > bytarr(3,40,4000)=c
> >
> > Each representing a portion of a large image. They were read from 3
separate
> > files.
> >
> > What is the easiest way to combine these 3 files into one file and
output it
> > to a single file for later operation.
>
> I am assuming you want to concatenate the three arrays into a
> 3x40x35000 array. If that's the case then the following code shold
> show you the way, here using three arrays BB1, BB2 and BB3 as a
> example
>
> IDL> bb1 = bytarr(3,40,100)
> IDL> bb2 = bytarr(3,40,200)
> IDL> bb3 = bytarr(3,40,400)
>
> IDL> help, [[[bb1]],[[bb2]],[[bb3]]]
> <Expression> BYTE = Array[3, 40, 700]
>
> Voila. To be honest with you, I never understand how many nested []'s
> I need in order to make it work. I just go for trial and error until
> it does.
>
> Craig
>
> --
> --------------------------------------------------------------------------
> Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
> Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
> --------------------------------------------------------------------------