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

Home » Public Forums » archive » Re: Is there no NULL in IDL??
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
Re: Is there no NULL in IDL?? [message #30829] Tue, 21 May 2002 10:29
Sean Raffuse is currently offline  Sean Raffuse
Messages: 46
Registered: July 2001
Member
"Wayne Landsman" <landsman@mpb.gsfc.nasa.gov> wrote in message
news:3CE97BDF.A7A1070B@mpb.gsfc.nasa.gov...
> Sean Raffuse wrote:
>
>> Am I just blind? What can I use for a null value when my data type is
>> integer? Please don't tell me zero.
>
> I can think of 4 options, each of which might be best in particular
> situations:
>
> (1) Use a known "non-physical" value (e.g. -32767) to flag nulls. (But
> be careful when applying numeric operations on the data .)
>
I would like to visualize the data using ENVI as a spectral profile. A
large negative value will give the same problem as a zero, only worse.


> (2) Convert to floating point and use NAN values to represent nulls.
>
Don't to convert to floats because the data is so large. I need to stick
with integers.

> (3) Carry around an extra byte mask array indicating which pixels are
> null.
>
This is a possibility, thanks for the help.

> (4) Carry around a "null pixel list" vector , i.e. a vector of 1-d
> indicies indicating which pixels in the data are null.
>
> --Wayne Landsman landsman@mpb.gsfc.nasa.gov
>
Re: Is there no NULL in IDL?? [message #30835 is a reply to message #30829] Mon, 20 May 2002 23:10 Go to previous message
R.Bauer is currently offline  R.Bauer
Messages: 1424
Registered: November 1998
Senior Member
Ben Tupper wrote:
>
> On Mon, 20 May 2002 18:42:39 -0400, Wayne Landsman
> <landsman@mpb.gsfc.nasa.gov> wrote:
>
>> Sean Raffuse wrote:
>>
>>> Am I just blind? What can I use for a null value when my data type is
>>> integer? Please don't tell me zero.
>>
>> I can think of 4 options, each of which might be best in particular
>> situations:
>>
>> (1) Use a known "non-physical" value (e.g. -32767) to flag nulls. (But
>> be careful when applying numeric operations on the data .)
>>
>> (2) Convert to floating point and use NAN values to represent nulls.
>>
>> (3) Carry around an extra byte mask array indicating which pixels are
>> null.
>>
>> (4) Carry around a "null pixel list" vector , i.e. a vector of 1-d
>> indicies indicating which pixels in the data are null.
>>
>
> I wonder if a pointer could be added to this list? It can have a null
> value.


Dear Ben,

I believe in his case this won't help.
Because if you have dereferenced then 0 is a real value
and it will be plotted.


Reimar


>
> ;define x as a pointer to a null value
> IDL> x = ptr_new(/allocate_heap)
> IDL> help, *x
> <PtrHeapVar1> UNDEFINED = <Undefined>
> IDL> print, n_elements(*x)
> 0
>
> ;reassign the pointer to a non-null value
> IDL> *x = 12
> IDL> help, *x
> <PtrHeapVar1> INT = 12
>
> ;reassign the pointer to a null value
> ;this is how the UNDEFINE procedure
> ;works... www.dfanning.com
> IDL> temp = size(temporary(*x))
> IDL> help, *x
> <PtrHeapVar1> UNDEFINED = <Undefined>

--
Reimar Bauer

Institut fuer Stratosphaerische Chemie (ICG-I)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
------------------------------------------------------------ -------
a IDL library at ForschungsZentrum Juelich
http://www.fz-juelich.de/icg/icg1/idl_icglib/idl_lib_intro.h tml
============================================================ =======
Re: Is there no NULL in IDL?? [message #30839 is a reply to message #30835] Mon, 20 May 2002 17:36 Go to previous message
btupper is currently offline  btupper
Messages: 55
Registered: January 2002
Member
On Mon, 20 May 2002 18:42:39 -0400, Wayne Landsman
<landsman@mpb.gsfc.nasa.gov> wrote:

> Sean Raffuse wrote:
>
>> Am I just blind? What can I use for a null value when my data type is
>> integer? Please don't tell me zero.
>
> I can think of 4 options, each of which might be best in particular
> situations:
>
> (1) Use a known "non-physical" value (e.g. -32767) to flag nulls. (But
> be careful when applying numeric operations on the data .)
>
> (2) Convert to floating point and use NAN values to represent nulls.
>
> (3) Carry around an extra byte mask array indicating which pixels are
> null.
>
> (4) Carry around a "null pixel list" vector , i.e. a vector of 1-d
> indicies indicating which pixels in the data are null.
>

I wonder if a pointer could be added to this list? It can have a null
value.

;define x as a pointer to a null value
IDL> x = ptr_new(/allocate_heap)
IDL> help, *x
<PtrHeapVar1> UNDEFINED = <Undefined>
IDL> print, n_elements(*x)
0

;reassign the pointer to a non-null value
IDL> *x = 12
IDL> help, *x
<PtrHeapVar1> INT = 12

;reassign the pointer to a null value
;this is how the UNDEFINE procedure
;works... www.dfanning.com
IDL> temp = size(temporary(*x))
IDL> help, *x
<PtrHeapVar1> UNDEFINED = <Undefined>
Re: Is there no NULL in IDL?? [message #30842 is a reply to message #30839] Mon, 20 May 2002 15:42 Go to previous message
Wayne Landsman is currently offline  Wayne Landsman
Messages: 117
Registered: January 1997
Senior Member
Sean Raffuse wrote:

> Am I just blind? What can I use for a null value when my data type is
> integer? Please don't tell me zero.

I can think of 4 options, each of which might be best in particular
situations:

(1) Use a known "non-physical" value (e.g. -32767) to flag nulls. (But
be careful when applying numeric operations on the data .)

(2) Convert to floating point and use NAN values to represent nulls.

(3) Carry around an extra byte mask array indicating which pixels are
null.

(4) Carry around a "null pixel list" vector , i.e. a vector of 1-d
indicies indicating which pixels in the data are null.

--Wayne Landsman landsman@mpb.gsfc.nasa.gov
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Object Programming in IDL
Next Topic: Re: Inconsistent Mean Calculation

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

Current Time: Wed Oct 08 09:00:58 PDT 2025

Total time taken to generate the page: 0.00496 seconds