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

Home » Public Forums » archive » NCDF_ATTCOPY and typecasting
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: NCDF_ATTCOPY and typecasting [message #49866 is a reply to message #49798] Mon, 21 August 2006 10:11 Go to previous messageGo to previous message
alexzcervantes@gmail. is currently offline  alexzcervantes@gmail.
Messages: 7
Registered: July 2006
Junior Member
Okay, after doing more researching, I read that ncdump translates byte
data into readable string whenever it can. How come it won't do it in
my case?

I keep getting:

solar_irradiance:long_name = 115b, 111b, 108b, 97b, 114b, 32b, 105b,
114b, 114b, 97b, 100b, 105b, 97b, 110b, 99b, 101b ;

-Alex
David Fanning wrote:
> alexzcervantes@gmail.com writes:
>
>> Here is a chunk of my code:
>>
>> if(natts gt 0) then begin
>> FOR index = 0L, natts - 1L DO BEGIN
>> ;----Load the attribute name in attribute name array
>> maf_attname = ncdf_attname(mafncid, mafvarid, index)
>> ncdf_attget, mafncid, mafvarid, maf_attname, attval
>> ncdf_attput, cdfid, l2pvarid, maf_attname, attval, /byte
>> ENDFOR
>> endif
>>
>> Everything seems to work except when I have to copy over strings. When
>> I typecast a string to byte, I get output like this:
>>
>> solar_irradiance:_FillValue = -1b ;
>> solar_irradiance:scale_factor = 1b ;
>> solar_irradiance:add_offset = 0b ;
>> solar_irradiance:valid_min = 0b ;
>> solar_irradiance:valid_max = 0b ;
>> solar_irradiance:long_name = 115b, 111b, 108b, 97b, 114b, 32b, 105b,
>> 114b, 114b, 97b, 100b, 105b, 97b, 110b, 99b, 101b ;
>
> So, what do you think is wrong?
>
> IDL> long_name = [115b, 111b, 108b, 97b, 114b, 32b, 105b, 114b, $
> 114b, 97b, 100b, 105b, 97b, 110b, 99b, 101b]
> IDL> print, string(long_name)
> solar irradiance
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Sepore ma de ni thui. (Opata Indian saying, meaning "Perhaps thou
> speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: large 3D array plot
Next Topic: VECTOR_FIELD trouble

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

Current Time: Sat Oct 11 17:20:50 PDT 2025

Total time taken to generate the page: 0.00174 seconds