[Numpy-discussion] Sea Ice Concentrations from Nimbus-7 SMMR and DMSP SSM/I Passive Microwave Data

David Huard david.huard@gmail....
Fri Feb 26 15:08:50 CST 2010


Nicolas,

I've attached a script I used to load the files, metadata and coordinates.

You owe me a donut.

David

On Fri, Feb 26, 2010 at 8:11 AM, Dag Sverre Seljebotn
<dagss@student.matnat.uio.no> wrote:
> Nicolas wrote:
>> Hello
>>
>> a VERY specific question, but I thought someone in the list might have
>> used this dataset before and could give me some advice
>>
>> I am trying to read the daily Antarctic Sea Ice Concentrations from
>> Nimbus-7 SMMR and DMSP SSM/I Passive Microwave Data, as provided by
>> the national snow and ice data center (http://nsidc.org), more
>> specifically, these are the files as downloaded from their ftp site
>> (ftp://sidads.colorado.edu/pub/DATASETS/seaice/polar-stereo/nasateam/final-gsfc/south/daily)
>>
>> they are provided in binary files (e.g. nt_19980101_f13_v01_s.bin for
>> the 1st of Jan. 1998)
>>
>> the metadata information
>> (http://nsidc.org/cgi-bin/get_metadata.pl?id=nsidc-0051) gives the
>> following information (for the polar stereographic projection):
>> """
>> Data are scaled and stored as one-byte integers in flat binary arrays
>>
>> geographical coordinates
>> N: 90°     S: 30.98°     E: 180°     W: -180°
>>
>> Latitude Resolution: 25 km
>> Longitude Resolution: 25 km
>>
>> Distribution Size: 105212 bytes per southern file
>> """
>>
>> I am unfamiliar with non self-documented files (used to hdf and netcdf
>> !) and struggle to make sense of how to read these files and plot the
>> corresponding maps, I've tried using the array module and the
>> fromstring function
>>
>> file=open(filename,'rb')
>> a=array.array('B',file.read())
>> var=numpy.fromstring(a,dtype=np.int)
>>
> Try
>
> numpy.fromfile(f, dtype=np.int8)
>
> or uint8, depending on whether the data is signed or not. What you did
> is also correct except that the final dtype must be np.int8.
>
> (You can always do var = var.astype(np.int) *afterwards* to convert to a
> bigger integer type.)
>
> Dag Sverre
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: showice.py
Type: text/x-python
Size: 3240 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/numpy-discussion/attachments/20100226/efeb57f6/attachment-0001.py 


More information about the NumPy-Discussion mailing list