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 
Return to the default flat view Create a new topic Submit Reply
Re: Is there no NULL in IDL?? [message #30839 is a reply to message #30835] Mon, 20 May 2002 17:36 Go to previous messageGo 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>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
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 11:07:47 PDT 2025

Total time taken to generate the page: 0.00446 seconds