read binary files

From: Xiaoyan Ma <xiaoyan.ma_at_nyahnyahspammersnyahnyah>
Date: Mon Jan 16 2012 - 08:47:09 MST
Dear NCl community,

I read quite a few binary files, e.g. 12 files, I read them as below,

var1=fbindirread("1.bin",0, (/46,72/), "float")
var2=fbindirread("2.bin",0, (/46,72/), "float")
...
var12=fbindirread("12.bin",0, (/46,72/), "float")

in which there are some grid cells with missing data, i.e.

var1@FillValue = -999.9
var2@FillValue = -999.9
...
var12@FillValue = -999.9

Now I want to calculate the average from these 12 files, for those grid points without missing data. For those points with missing data, I set them as

var@FillValue = -999.9

if I use the way below, it will calculate the average for all the grid points.
var =(var1+var2+...+var12)/12

Any simple way to calculate the average ONLY for the grid points without missing data?

Thank you very much,

Xiaoyan

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jan 16 08:47:20 2012

This archive was generated by hypermail 2.1.8 : Wed Jan 18 2012 - 09:21:55 MST