comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Orthorectifying Quickbird scenes with RPC files
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Orthorectifying Quickbird scenes with RPC files [message #67037] Thu, 25 June 2009 04:46 Go to next message
Muhammad is currently offline  Muhammad
Messages: 2
Registered: June 2009
Junior Member
Hi All:
How can I orthorectify Quicbird scenes with only .rpb files provided
uding ENVI. Quickbird scene is in geotiff format.
Regards,

Arshad
Re: OR [message #70728 is a reply to message #67037] Mon, 03 May 2010 16:06 Go to previous message
jeanh is currently offline  jeanh
Messages: 79
Registered: November 2009
Member
On 03/05/2010 5:55 PM, fgg wrote:
> Hello there,
>
> How can I summarize these two lines in just one line of code?
>
> if (line[0] eq 'i_rng_wf' and n_elements(line) ne 4002) then message,
> $
> 'The # of samples per shot is not valid.'
> if (line[0] eq 'i_rng_wf' and n_elements(line) ne 10882) then message,
> $
> 'The # of samples per shot is not valid.'
>
> ...I thought using OR would do the trick, but I guess I'm missing
> something here:
>
> if (line[0] eq 'i_rng_wf' and n_elements(line) ne (4002 or 10882))
> then message, ...
>
> Thanks

Don't you want to use "and" here (on top of what Mike Galloy said to
have the "or" working)?
If n_elements(line) IS 4002, the the other condition (10882) will be
caught!... in other words, you will always have your error message.
a = 8
if (a ne 1 or a ne 8) then print, "error" ===>error
if (a ne 1 and a ne 8) then print ,"error" ===> nothing.

a=100
if (a ne 1 or a ne 8) then print, "error" ===>error
if (a ne 1 and a ne 8) then print ,"error" ===> error.

Jean
Re: OR [message #70730 is a reply to message #67037] Mon, 03 May 2010 15:04 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 5/3/10 3:55 PM, fgg wrote:
> Hello there,
>
> How can I summarize these two lines in just one line of code?
>
> if (line[0] eq 'i_rng_wf' and n_elements(line) ne 4002) then message,
> $
> 'The # of samples per shot is not valid.'
> if (line[0] eq 'i_rng_wf' and n_elements(line) ne 10882) then message,
> $
> 'The # of samples per shot is not valid.'
>
> ...I thought using OR would do the trick, but I guess I'm missing
> something here:
>
> if (line[0] eq 'i_rng_wf' and n_elements(line) ne (4002 or 10882))
> then message, ...
>
> Thanks

Using the bitwise operators, it would be:

if (line[0] eq 'i_rng_wf' and (n_elements(line) ne 4002 or
n_elements(line) ne 10882) then ...

I would consider using logical operators if you only have to be IDL 6.0+
compatible:

if (line[0] eq 'i_rng_wf' && (n_elements(line) ne 4002 ||
n_elements(line) ne 10882) then ...

The logical operators will short-circuit.

-Mike
--
www.michaelgalloy.com
Research Mathematician
Tech-X Corporation
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Evaluate a string as a variable name
Next Topic: pointer to object confusion (C++ programmer, IDL n00b)

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:31:50 PDT 2025

Total time taken to generate the page: 0.00465 seconds