read and convert datas .bin

From: Vanúcia Schumacher <vanucia-schumacher_at_nyahnyahspammersnyahnyah>
Date: Mon Jul 14 2014 - 12:08:04 MDT

Hi users,
I would like to know how to read the data .bin and to convert to .nc. I tes=
ted this example of the page of the NCL, but returns errors, and how no=
t know how to see the metadata can not find solution, can someone help me=
?

fatal:Coordinate variables must be the same dimension as their dimensionfat=
al:["Execute.c":7743]:Execute: Error occurred at or near line 29 in file re=
ad.convert.bin.ncl
; read_bin_2.ncl;; Concepts illustrated:; - Using fbindirread to =
read data from record 0 off several binary files; - Writing data to a N=
etCDF file using the easy but inefficient method; - Adding meta data (a=
ttributes and coordinates) to a variable;--------------------------------=
--------------------------------------begin nlat = 90 nlon = 180 fil=
s = systemfunc("ls *.bin")
;---Predefine array for one year of daily data finarr = new((/dimsizes=
(fils),nlat,nlon/),"float")
;---Loop through each file and read rec_num = 0 ; record number =
 do gg = 0,dimsizes(fils)-1 finarr(gg,:,:) = fbindirread(fils=
(gg),rec_num,(/nlat,nlon/),"float") end do
  print("Assigning coordinate variable information") finarr!0 = "time" =
finarr!1 = "lat" finarr!2 = "lon" finarr&time = ispan(1,dimsizes(=
fils),1)printVarSummary(finarr) finarr&lat = ispan(-40,-90,nlat) =
                        ->>>>>>>>>>>> error this line ! finarr&lon = is=
pan(-180,180,nlon) finarr&lat@units = "degrees_north" finarr&lon@un=
its = "degrees_east"
;----------------------------------------------------------------------=
; Section to write data to netCDF file;--------------------------------=
--------------------------------------
;---Make sure file doesn't exist. nc_filename = "sample.nc" system("r=
m -f " + nc_filename)
;---Open file and write global attributes a = addfile("sample.nc","c=
") a@title = "1 year of daily data" a@source = "Your program name/loc=
ation"
;---Make time an UNLIMITED dimension, always recommended filedimdef(a=
,"time",-1,True)
;---Write "SLP" data to file a->SLP = finarrb =
 ->>>>>>>>>>>> I don't know the name of variable!end ---Vanúcia Schum=
acherMestranda em Meteorologia - UFVMeteorologista -UFPel
Departamento de Meteorologia Agrícola - DEACel: (31) 9978 2522 DEA: (31) =
3899 1890 =


_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk


Received on Mon Jul 14 06:08:11 2014

This archive was generated by hypermail 2.1.8 : Fri Aug 01 2014 - 15:10:55 MDT