Re: How to read the Bootstrap SIC data from NSIDC correctly?

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue Aug 27 2013 - 08:43:39 MDT

As with any data set, you must read the documentation.

The documentation at:
     http://nsidc.org/data/docs/daac/nsidc0079_bootstrap_seaice.gd.html
states in three places:

(1) Flat binary 2-byte integer; little-endian byte order; scaled by 10

(2) Data files are stored in the original Goddard Space Flight Center
(GSFC) flat binary two-byte integer format, use the little-endian byte
order convention, and are scaled by a factor of 10. An individual image
of daily or monthly averaged data constitutes a granule in the Bootstrap
sea ice concentration time series.

(3) Parameter Range

Data are stored as two-byte integers representing sea ice concentration
values. The sea ice concentration data values are packed into integer
format by multiplying the original sea ice concentration values by 10
(divide stored value by 10 to get the percent). The sea ice
concentration values range from 0 to 1000. Land is registered as 1200
and the Northern Hemisphere hole (a region of the North Pole that is not
measured due to orbit inclination, see the Spatial Coverage section) is
registered as 1100.

===================

A '2-byte integer' is an NCL type short (16 bits).
In fact, the size of the 'bt_201212_f17_v02_n.bin' file is half
the size of the lat/lon files.

======================

Try the following. Also, the documentation states that
  the lat/lon are integer ... not float. They must be read
as such.

setfileoption("bin","ReadByteOrder","LittleEndian")
lat = fbindirread("psn25lats_v3.dat",0,(/nrows,ncols/), "integer") /100000.
lon = fbindirread("psn25lons_v3.dat",0,(/nrows,ncols/), "integer") /100000.

lat@units = "degrees_north"
lon@units = "degrees_east"
printVarSummary(lon)
printVarSummary(lat)
print(max(lon)+" " +min(lon))
print(max(lat)+" " +min(lat))

  data = fbindirread(data_path + data_filename, 0, (/nrows,ncols/),
"short") *0.1
  data = where(data.gt.100.0, 1e20, data)
  data@_FillValue = 1e20
  printVarSummary(data)
  print(max(data) + " " + min(data))

On 8/21/13 8:49 AM, gmail wrote:
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
>
> begin
>
> data_path = "/Data/NSIDC/nsidc0079_gsfc_bootstrap_seaice/final-gsfc/north/monthly/"
> data_filename = "bt_201212_f17_v02_n.bin"
> plot_filename = data_filename
>
> nrows = 448
> ncols = 304
>
> setfileoption("bin","ReadByteOrder","LittleEndian")
> lat = fbindirread("psn25lats_v3.dat",0,(/nrows,ncols/), "float") ; about the .dat , please refer tohttp://nsidc.org/data/polar_stereo/tools_geo_pixel.html#geolocate
> lon = fbindirread("psn25lons_v3.dat",0,(/nrows,ncols/), "float") ; I also try the other function such as fbinread, fbinrecread,
>
> lat = lat/100000.
> lon = lon/100000.
> lat@units = "degrees_north"
> lon@units = "degrees_east"
> printVarSummary(lon)
> printVarSummary(lat)
> print(max(lon)+" " +min(lon))
> print(max(lat)+" " +min(lat))
>
> data = fbindirread(data_path + data_filename, 0, (/nrows,ncols/), "float")
> printVarSummary(data)
> print(max(data) + " " + min(data))
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Aug 27 08:43:42 2013

This archive was generated by hypermail 2.1.8 : Fri Aug 30 2013 - 14:04:57 MDT