Re: how to read binary file and covert to netcdf with new named variabe

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu Feb 04 2010 - 06:46:52 MST

Are you sure that "cfsSSTmonthly200904.gr" is
a flat binary file? The ".gr" extension is generally
attached to a Grib file

%> ncl_filedump cfsSSTmonthly200904.gr

To convert to netCDF

%> ncl_convert2nc cfsSSTmonthly200904.gr

Possibly, wgrib or wgrib2 has a -netcdf option that you can use.

Good luck

Ammu Priya wrote:
> Sir,
> 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"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
> load "/home//ncl/lib/scripts/my_scripts.ncl"
> begin
>
> f1 = "sst.ltm.1971-2000.nc"
> setfileoption("gr","ReadByteOrder","littleEndian")
> data = cbinread("cfsSSTmonthly200904.gr",(/9,139,180/),"float")
> data!0 = "time"
> data!1 = "lat"
> data!2 = "lon"
> data@_FillValue = 0
> data@_FillValue = -99999.00
> ;print(data)
> printVarSummary(data)
> printMinMax(data,0)
> return
> 2,cfsSSTmonthly200904.ctl
> 3.,cfsSSTmonthly200904.gr
>
> 3.,also want to know about this file
> 4.,my output is min=-3.40271e+38 max=3.40027e+38
>
> please can anyone help me to read datas .
> thankyou,
> ammu
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Feb 4 06:46:58 2010

This archive was generated by hypermail 2.1.8 : Sun Feb 07 2010 - 15:37:25 MST