Re: ISO: NCL script to convert PRISM binary files to NetCDF

From: Michael Notaro <mnotaro_at_nyahnyahspammersnyahnyah>
Date: Fri Oct 30 2009 - 14:31:39 MDT

Assuming you are using the data off the prism website,
I've used this before to read the data.

On the 3rd line, I skip the header by only using the
6th value onward.

Definitely not the neatest method, but it works to read
the data in at least. Converting to annual would be
the easy part.

a=asciiread("us_ppt_1982.01",-1,"integer")
a@_FillValue=-999
b=int2flt(a(6:872510))/100.
b=mask(b,b.lt.0.,False)

lat=fspan(24.0625,49.9375,621)
lon=fspan(-125.0208,-66.4792,1405)
lat!0="lat"
lat@units="degrees_north"
lat&lat=lat
lon!0="lon"
lon@units="degrees_east"
lon&lon=lon

data=onedtond(b,(/621,1405/))
data=data(::-1,:)
data!0="lat"
data!1="lon"
data&lat=lat
data&lon=lon

On Oct 30, 2009, at 3:15 PM, Bridget Thrasher wrote:

> Before I go about possibly re-inventing the wheel, I thought I'd
> see if anyone out there has a script that will convert the monthly
> binary PRISM data files to yearly NetCDF files. I asked the project
> contact person at NACSE/OSU, but he doesn't have anything.
>
> -Bridget
>
> --
> Bridget Thrasher, PhD
> Postdoctoral Researcher
> Climate Central
> www.climatecentral.org
>
>
> _______________________________________________
> 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 Fri Oct 30 14:28:35 2009

This archive was generated by hypermail 2.1.8 : Mon Nov 02 2009 - 08:49:47 MST