[gradsusr] a good sea ice data set for GrADS

Furtado, Jason jfurtado at aer.com
Thu Aug 28 09:03:27 EDT 2014


Kyle -

I have successfully read in these files in both MATLAB and Python. I have given a snippet below of the Python code, so you can adapt it to make your .ctl file. You will need the lon and lat binary files (25x25 km) to go with it (did you grab those?) as well as possibly the grid area if you are doing areal coverage calculations. The data are on an irregular grid. I can send those files to you in a separate e-mail (or you can get them off of the ftp site).

- Jason

         import numpy as np
    # Get the latitude, longitude, and grid_area files.
    COLS=304; ROWS=448 #Number of columns and rows for the data matrices.

    lonfile = open('psn25lons_v3.dat','rb')
    latfile = open('psn25lats_v3.dat','rb')
    areafile = open('psn25area_v3.dat','rb')

    lons = np.fromfile(lonfile,dtype='int32'); lons[lons<=0]=lons[lons<=0]+360
    lats = np.fromfile(latfile,dtype='int32')
    area = np.fromfile(areafile,dtype='int32')

    # Numpy reads in the data into a 1-D array. Reshape into 2-D arrays.
    lons = lons.reshape((COLS,ROWS),order='F').astype('float')/1e5
    lats = lats.reshape((COLS,ROWS),order='F').astype('float')/1e5
    area = area.reshape((COLS,ROWS),order='F').astype('float')/1e9

    lonfile.close()
    latfile.close()
    areafile.close()

    # Sample read-in for one daily file.
    icefile = open('nt_20070916_f13_v01_n.bin','rb')

    hdr1 = icefile.read(300)
    c = np.fromfile(icefile,dtype='uint8')

    # Numpy reads in the data into a 1-D array. Reshape into 2-D arrays.

    c = c.reshape((COLS,ROWS),order='F').astype('float')
    icefile.close()

    # Values 0-250 represent fractional ice coverage scaled by 250.
    # 251: hole around pole due to orbital inclination
    # 253: coastlines
    # 254: land mask
    # 255: missing data
    c[c==251]=250; # treat hole as 100% concentration
    c[(c==253) | (c==254) | (c==255)]=np.nan; # treat coast, land, or missing as NaN
    c = c/250. # ice concentration (0 to 1)




--
Jason C. Furtado, Ph.D.
Staff Scientist
Atmospheric and Environmental Research (AER), a Verisk Analytics company
131 Hartwell Ave.
Lexington, MA 02421

E-mail:  jfurtado at aer.com<mailto:jfurtado at aer.com>
Phone:  781-761-2384



From: Kyle Clem <Kyle.Clem at vuw.ac.nz<mailto:Kyle.Clem at vuw.ac.nz>>
Reply-To: GrADS Users Forum <gradsusr at gradsusr.org<mailto:gradsusr at gradsusr.org>>
Date: Tuesday, August 26, 2014 9:48 PM
To: "gradsusr at gradsusr.org<mailto:gradsusr at gradsusr.org>" <gradsusr at gradsusr.org<mailto:gradsusr at gradsusr.org>>
Subject: [gradsusr] a good sea ice data set for GrADS

Hello,

I am trying to use sea ice concentration data from http://nsidc.org/data/docs/daac/nsidc0051_gsfc_seaice.gd.html, but am unable to plot it in GrADS because I don't understand how to find the PDEF Syntax information. Can anyone provide advice on how to obtain the PDEF Syntax information? Or, does anyone have any other sea ice data recommendations for using in GrADS?

Thanks,
Kyle


----------------------
Kyle Clem, M.Sc.
PhD Student
School of Geography, Environment and Earth Sciences
Victoria University of Wellington
Cotton Building, Room 222
kyle.clem at vuw.ac.nz<mailto:kyle.clem at vuw.ac.nz>

________________________________

This email is intended solely for the recipient. It may contain privileged, proprietary or confidential information or material. If you are not the intended recipient, please delete this email and any attachments and notify the sender of the error.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20140828/0edbf8e9/attachment.html 


More information about the gradsusr mailing list