Re: String Array to 'regular' array? [message #67609] |
Tue, 04 August 2009 21:07 |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
On Aug 4, 2:46 pm, David Fanning <n...@dfanning.com> wrote:
> Barbara writes:
>> Ok so here's the current issue. I created an average of a few images
>> the other day, and saved the images as an .isv file. I went to use
>> it, and realized I can't use half of the image because the numbers are
>> zeros. So I tried to just take a few rows of the image, and I get an
>> error every time. The image is a 1024x1024 image. But I get an error
>> that says:
>
>> % Attempt to subscript MF with <INT ( 123)> is out of range.
>> % Execution halted at: $MAIN$
>
>> (after I had input IDL> read2=mf[123,123] )
>
>> Is there a way to fix this or do I have to re-average the images? And
>> if that's the case, how do I save it next time so I can use it after
>> having closed and reopened IDL?
>
> On my way to buy a sandwich, I have been trying
> to think of a way to explain this. Suppose you
> wanted to have a conversation with your Mother,
> who lives across town in a house with an address.
> File_Which will return the address of the house.
> It seems to me you are trying to have a conversation
> with the address, rather than with your Mother.
I think with enough alcohol I could have a conversation with an
address... :-)
Craig
|
|
|
Re: String Array to 'regular' array? [message #67610 is a reply to message #67609] |
Tue, 04 August 2009 12:54  |
Barbara
Messages: 17 Registered: July 2009
|
Junior Member |
|
|
On Aug 4, 11:49 am, pp <pp.pente...@gmail.com> wrote:
> On Aug 4, 3:12 pm, Barbara <med...@susqu.edu> wrote:
>
>
>
>> On Aug 4, 11:07 am, pp <pp.pente...@gmail.com> wrote:
>
>>> On Aug 4, 2:51 pm, Barbara <med...@susqu.edu> wrote:
>
>>>> On Aug 4, 10:49 am, Barbara <med...@susqu.edu> wrote:
>
>>>> > Ok so here's the current issue. I created an average of a few images
>>>> > the other day, and saved the images as an .isv file. I went to use
>>>> > it, and realized I can't use half of the image because the numbers are
>>>> > zeros. So I tried to just take a few rows of the image, and I get an
>>>> > error every time. The image is a 1024x1024 image. But I get an error
>>>> > that says:
>
>>>> > % Attempt to subscript MF with <INT ( 123)> is out of range.
>>>> > % Execution halted at: $MAIN$
>
>>>> > (after I had input IDL> read2=mf[123,123] )
>
>>>> > Is there a way to fix this or do I have to re-average the images? And
>>>> > if that's the case, how do I save it next time so I can use it after
>>>> > having closed and reopened IDL?
>
>>>> I should also add that mf is a string array, I had done mf=file_which
>>>> (blah blah blah))
>
>>> From that I do not understand what you did. What do you mean by "went
>>> to use it"? How did you make the isv files?
>
>>> Also, what is about string arrays that makes you call them not
>>> regular?
>
>>> file_which always returns a string scalar, which is why the indexes
>>> you use (123,123) do not exist. It is just the path for the first file
>>> found matching the conditions of its arguments.
>
>> i saved the image as an isv file.. in itools i went to save as and
>> saved the file. If lie_which is a scalar, how do I get an array from
>> it of the numbers that are in the image?
>
> Open the isv in an itool (in Windows, double-clicking the file should
> do it, or just open any itool from IDL (a simple iplot in the command
> line is enough, it does not matter which itool made the isv file)).
> Then select the image you are interested in, and use File->Export data
> to IDL (I think before IDL 7.1 it used to be in File->Export->To an
> IDL variable). You can then select to export the image (imagepixels)
> and/or the palette, and pick the name of the variables where they are
> put (they default to image_planes and palette).
Thank you both! This was very helpful (and David your story made me
smile and but me into perspective haha) and I am glad I have it all
figured out now!
|
|
|
Re: String Array to 'regular' array? [message #67612 is a reply to message #67610] |
Tue, 04 August 2009 11:49  |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
On Aug 4, 3:12 pm, Barbara <med...@susqu.edu> wrote:
> On Aug 4, 11:07 am, pp <pp.pente...@gmail.com> wrote:
>
>
>
>> On Aug 4, 2:51 pm, Barbara <med...@susqu.edu> wrote:
>
>>> On Aug 4, 10:49 am, Barbara <med...@susqu.edu> wrote:
>
>>>> Ok so here's the current issue. I created an average of a few images
>>>> the other day, and saved the images as an .isv file. I went to use
>>>> it, and realized I can't use half of the image because the numbers are
>>>> zeros. So I tried to just take a few rows of the image, and I get an
>>>> error every time. The image is a 1024x1024 image. But I get an error
>>>> that says:
>
>>>> % Attempt to subscript MF with <INT ( 123)> is out of range.
>>>> % Execution halted at: $MAIN$
>
>>>> (after I had input IDL> read2=mf[123,123] )
>
>>>> Is there a way to fix this or do I have to re-average the images? And
>>>> if that's the case, how do I save it next time so I can use it after
>>>> having closed and reopened IDL?
>
>>> I should also add that mf is a string array, I had done mf=file_which
>>> (blah blah blah))
>
>> From that I do not understand what you did. What do you mean by "went
>> to use it"? How did you make the isv files?
>
>> Also, what is about string arrays that makes you call them not
>> regular?
>
>> file_which always returns a string scalar, which is why the indexes
>> you use (123,123) do not exist. It is just the path for the first file
>> found matching the conditions of its arguments.
>
> i saved the image as an isv file.. in itools i went to save as and
> saved the file. If lie_which is a scalar, how do I get an array from
> it of the numbers that are in the image?
Open the isv in an itool (in Windows, double-clicking the file should
do it, or just open any itool from IDL (a simple iplot in the command
line is enough, it does not matter which itool made the isv file)).
Then select the image you are interested in, and use File->Export data
to IDL (I think before IDL 7.1 it used to be in File->Export->To an
IDL variable). You can then select to export the image (imagepixels)
and/or the palette, and pick the name of the variables where they are
put (they default to image_planes and palette).
|
|
|
Re: String Array to 'regular' array? [message #67613 is a reply to message #67612] |
Tue, 04 August 2009 11:46  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Barbara writes:
> Ok so here's the current issue. I created an average of a few images
> the other day, and saved the images as an .isv file. I went to use
> it, and realized I can't use half of the image because the numbers are
> zeros. So I tried to just take a few rows of the image, and I get an
> error every time. The image is a 1024x1024 image. But I get an error
> that says:
>
>
> % Attempt to subscript MF with <INT ( 123)> is out of range.
> % Execution halted at: $MAIN$
>
> (after I had input IDL> read2=mf[123,123] )
>
> Is there a way to fix this or do I have to re-average the images? And
> if that's the case, how do I save it next time so I can use it after
> having closed and reopened IDL?
On my way to buy a sandwich, I have been trying
to think of a way to explain this. Suppose you
wanted to have a conversation with your Mother,
who lives across town in a house with an address.
File_Which will return the address of the house.
It seems to me you are trying to have a conversation
with the address, rather than with your Mother.
Have you ever read Oliver Sack's book, The Man
Who Mistook His Wife For His Hat? It's kind of
like that. :-)
You need data. Not the name of the file where the data
resides. Although knowing where it resides is a good
first step to obtaining it!
Cheers,
David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: String Array to 'regular' array? [message #67614 is a reply to message #67613] |
Tue, 04 August 2009 11:24  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Barbara writes:
> i saved the image as an isv file.. in itools i went to save as and
> saved the file. If lie_which is a scalar, how do I get an array from
> it of the numbers that are in the image?
Oh, dear. You must be confusing FILE_WHICH with something
else you have used. Do you have on-line help anywhere
close by?
Wish I could help, but I don't know the first thing
about iTools. Sorry. :-)
Cheers,
David
--
David Fanning, Ph.D.
Coyote's Guide to IDL Programming (www.dfanning.com)
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|
Re: String Array to 'regular' array? [message #67615 is a reply to message #67614] |
Tue, 04 August 2009 11:12  |
Barbara
Messages: 17 Registered: July 2009
|
Junior Member |
|
|
On Aug 4, 11:07 am, pp <pp.pente...@gmail.com> wrote:
> On Aug 4, 2:51 pm, Barbara <med...@susqu.edu> wrote:
>
>
>
>> On Aug 4, 10:49 am, Barbara <med...@susqu.edu> wrote:
>
>>> Ok so here's the current issue. I created an average of a few images
>>> the other day, and saved the images as an .isv file. I went to use
>>> it, and realized I can't use half of the image because the numbers are
>>> zeros. So I tried to just take a few rows of the image, and I get an
>>> error every time. The image is a 1024x1024 image. But I get an error
>>> that says:
>
>>> % Attempt to subscript MF with <INT ( 123)> is out of range.
>>> % Execution halted at: $MAIN$
>
>>> (after I had input IDL> read2=mf[123,123] )
>
>>> Is there a way to fix this or do I have to re-average the images? And
>>> if that's the case, how do I save it next time so I can use it after
>>> having closed and reopened IDL?
>
>> I should also add that mf is a string array, I had done mf=file_which
>> (blah blah blah))
>
> From that I do not understand what you did. What do you mean by "went
> to use it"? How did you make the isv files?
>
> Also, what is about string arrays that makes you call them not
> regular?
>
> file_which always returns a string scalar, which is why the indexes
> you use (123,123) do not exist. It is just the path for the first file
> found matching the conditions of its arguments.
i saved the image as an isv file.. in itools i went to save as and
saved the file. If lie_which is a scalar, how do I get an array from
it of the numbers that are in the image?
|
|
|
Re: String Array to 'regular' array? [message #67616 is a reply to message #67615] |
Tue, 04 August 2009 11:07  |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
On Aug 4, 2:51 pm, Barbara <med...@susqu.edu> wrote:
> On Aug 4, 10:49 am, Barbara <med...@susqu.edu> wrote:
>
>> Ok so here's the current issue. I created an average of a few images
>> the other day, and saved the images as an .isv file. I went to use
>> it, and realized I can't use half of the image because the numbers are
>> zeros. So I tried to just take a few rows of the image, and I get an
>> error every time. The image is a 1024x1024 image. But I get an error
>> that says:
>
>> % Attempt to subscript MF with <INT ( 123)> is out of range.
>> % Execution halted at: $MAIN$
>
>> (after I had input IDL> read2=mf[123,123] )
>
>> Is there a way to fix this or do I have to re-average the images? And
>> if that's the case, how do I save it next time so I can use it after
>> having closed and reopened IDL?
>
> I should also add that mf is a string array, I had done mf=file_which
> (blah blah blah))
From that I do not understand what you did. What do you mean by "went
to use it"? How did you make the isv files?
Also, what is about string arrays that makes you call them not
regular?
file_which always returns a string scalar, which is why the indexes
you use (123,123) do not exist. It is just the path for the first file
found matching the conditions of its arguments.
|
|
|
Re: String Array to 'regular' array? [message #67617 is a reply to message #67616] |
Tue, 04 August 2009 10:51  |
Barbara
Messages: 17 Registered: July 2009
|
Junior Member |
|
|
On Aug 4, 10:49 am, Barbara <med...@susqu.edu> wrote:
> Ok so here's the current issue. I created an average of a few images
> the other day, and saved the images as an .isv file. I went to use
> it, and realized I can't use half of the image because the numbers are
> zeros. So I tried to just take a few rows of the image, and I get an
> error every time. The image is a 1024x1024 image. But I get an error
> that says:
>
> % Attempt to subscript MF with <INT ( 123)> is out of range.
> % Execution halted at: $MAIN$
>
> (after I had input IDL> read2=mf[123,123] )
>
> Is there a way to fix this or do I have to re-average the images? And
> if that's the case, how do I save it next time so I can use it after
> having closed and reopened IDL?
I should also add that mf is a string array, I had done mf=file_which
(blah blah blah))
|
|
|