Re: reading remss binary data in ncl

From: samir pokhrel <samir_at_nyahnyahspammersnyahnyah>
Date: Fri Sep 20 2013 - 05:40:35 MDT

Dear Rick,

Many Thanks for the suggestion, Its working now.

ubyte was the right type for fortran character (1)

also function toint() is working instead of charactertointeger() or
chartoint() that is exactly mimicking the ichar function of fortran.

I think that my code can be put in the example section of binary reading as
it would be very useful for the future users if NCL adminstration agrees.
If yes then let me know to whom the code has to be sent.

Sincerely
Samir

On Thu, Sep 19, 2013 at 6:18 PM, <brownrig@ucar.edu> wrote:

> Hi Samir,
>
> In answer to your second question, there are the functions
> charactertoint()/**charactertointeger() which seem to do what ICHAR()
> does.
>
> I'm not familiar with SSMI data, but a quick look over the data format
> suggests that 'ubyte' would indeed be the right type. I don't think you'd
> need something like ichar in this case, unless you needed your variable
> wind to be explicitly 4-byte integer, in which case:
>
> tmp = fbinread(....)
> wind = toint(tmp)
>
> Hope that helps...
> Rick
>
>
> On Thu, 19 Sep 2013 16:14:27 +0530
> samir pokhrel <samir@tropmet.res.in> wrote:
>
>> Dear NCL users,
>>
>> I am trying to read binary SSMI data from REMSS site.
>>
>> The data is in written as a character in lat and lon array and read in
>> fortran90 as
>>
>> CHARACTER(1) abuf(1440,720,4)
>> READ(3,rec=1) abuf
>>
>>
>> then converted using ICHAR function of fortran as follows.
>>
>> ssmi_data(:,:)=ICHAR(abuf(:,:)**)
>>
>>
>> I am reading the first record of this data as
>>
>> wind = fbinrecread (dpath + infile,0,(/1440,720/),"ubyte")
>>
>> will "ubyte" be approprate type here?
>>
>> secondly
>>
>> Is there any NCL function similar to fortran ichar function.
>>
>> Any help will be highly appreciated
>>
>> Sincerely
>> Samir
>> --
>> Samir Pokhrel
>> Climate and Global Modelling Division
>> Indian Institute of Tropical Meteorology
>> NCL Post, Pashan
>> Pune-411008
>> INDIA
>>
>
>

-- 
Samir Pokhrel
Climate and Global Modelling Division
Indian Institute of Tropical Meteorology
NCL Post, Pashan
Pune-411008
INDIA

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Sep 20 05:40:47 2013

This archive was generated by hypermail 2.1.8 : Tue Oct 01 2013 - 14:41:43 MDT