[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[THREDDS #HEL-720643]: NEXRAD 'Radial Velocity'
- Subject: [THREDDS #HEL-720643]: NEXRAD 'Radial Velocity'
- Date: Fri, 22 Feb 2013 09:27:21 -0700
Bruce,
Looking at the variable attribute, you will see the _Unsigned = "true"
attribute. You'll want to convert the unsigned byte to a short. Note that
when converting, you cannot take absolute value, as this mapping shows:
byte short
...
125 = 125
126 = 126
127 = 127
-128 = 128
-127 = 129
-126 = 130
-125 = 131
-124 = 132
...
Here's the java code to make the conversion:
static public short unsignedByteToShort(byte b) {
return (short) (b & 0xff);
}
The scale factor and offset are exactly what you would expect - scale by 0.5
and subract 64.5, respectively.
Hope this helps!
-Lansing Madry
Unidata
Boulder, Colorado
> Tech/Help,
>
> I am trying to work with NEXRAD II data files to extract radial velocity.
> I have been able to convert the files I have to a NETCDF format (using
> your 'java' utility) to more easily access the data I need.
>
> Within the NEXRAD files the 'RadialVelocity' field is labeled as in
> units of 'm/s', but the actual data are in a 'byte' format (ranging in
> value from -127 to +127). Could you direct me to where I find out how
> to convert the 'byte' data into a floating point velocity in 'm/s' (the
> header also lists an 'scale_factor' of 0.5, and an 'offset' of -64.5)?
>
> Peace,
>
> BJ
>
> --
> o o \ ! \| \ / |/ ! / o / o
> -|- -/- --o \- | -/ o-- -\ -|-
> /_\_____|\_____/__\____ /_o_____/o\_____o_\_____/__\____/_\____/_\
> Bruce Jackson
> Air Resources Board/Technical Support Division
> Sacramento, California 95812
> address@hidden<mailto:address@hidden>
> (916)324-6916
>
>
>
Ticket Details
===================
Ticket ID: HEL-720643
Department: Support THREDDS
Priority: Normal
Status: Open