Re: Is there no NULL in IDL?? [message #30835 is a reply to message #30829] |
Mon, 20 May 2002 23:10   |
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
============================================================ =======
|
|
|