[gradsusr] a good sea ice data set for GrADS

Kyle Clem Kyle.Clem at vuw.ac.nz
Thu Aug 28 19:05:00 EDT 2014


Hi Jason,

Thank you so much for your help! Unfortunately, I was given a NetCDF file, I converted it to an SRV file, and I am now trying to convert it to a .des descriptor file for GrADS. I am able to plot the data, but it is wrong. I don't know how to give it the proper PDEF arguments in the .ctl file. In fact, I don't even know what several of those arguments mean. Below is my .ctl file, with the incorrect portion highlighted. Any ideas on how the information in your .ctl file could be used in mine? I am using a 25x25km grid resolution, and the polar stereo projection is true at 70 degrees. Thanks again for your help, Jason!

cat > seaice_con_${seas}.des <<EOF
DSET ^seaice_con_${seas}.bin
PDEF 316 332 PSE -70 0 158 166 25 25 -1 <-- I'm don't know if this is even the correct PDEF grid interpretation
TITLE ${seas} Sea Ice Con
options sequential
UNDEF 255
XDEF 316 LINEAR 0 1.138089297
YDEF 332 LINEAR -90 0.1520239364
ZDEF 1 LEVELS 1000
TDEF 34 LINEAR Dec1980 1yr
VARS 1
ice_con 1 99 ice_con
ENDVARS
EOF

----------------------
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
________________________________
From: gradsusr-bounces at gradsusr.org [gradsusr-bounces at gradsusr.org] on behalf of Furtado, Jason [jfurtado at aer.com]
Sent: Friday, August 29, 2014 1:03 AM
To: GrADS Users Forum
Subject: Re: [gradsusr] a good sea ice data set for GrADS

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/eb54a96d/attachment.html 


More information about the gradsusr mailing list