[ncl-talk] Table data and loop
Dennis Shea
shea at ucar.edu
Thu Feb 13 22:07:43 MST 2020
Hi Melanie,
I am not sure what was used to "tabulate the data". The '*npp_edited.csv*"
file is inconsistent in structure.
The following comments are extracted from the attached NCL script:
*npp_read2nc.ncl*
---
; The csv file is rather 'odd' from a USA point of view.
; It uses the European' approach to represent numbers.
; Specifically, a comma is used to separate the integral part of a number
; from the decimal part.
;
; There are three issues:
; [1] A comma [ , ] is used as BOTH a value/fiel separator AND a decimal
point.
; [2] There is a lack of consistency in the csv file.
; Most values are enclosed with double-quotes [ " ].
; Unfortunately, some are not !!!
; [3] A string ["#VALOR!"] is used to denote a missing (_FillValue).
;
; Sample CSV:
; "Month","Latitude","Longitude","NPP"
; "3","38,78","-72,27","321,3" <=== 7 fields separated by a ,
and enclosed within "
; "3","38,78","-72,27","335,4372"
; "3","38,78","-72,27","698,908"
; "6","21,2","-158","#VALOR!" <=== ?missing value?
; "5","-9",-25,"-15,3542161160713" <=== 5 fields integer -25 has
no "
; "10","41,17","-66,17",-318 <=== 6 fields integer -318 has
no "
; "4","40","-71,96","-777,25" <=== 6 fields integer 40 has
no "
; "7","39,84","-72","92,5764" <=== 6 fields
; "11",-11,-25,"23,7089369952225" <=== 5 fields integer -11 and
-25 have no "
;
; The CSV file must be edited the address the above issues. ;
=========
A number of edits were performed and the file was recreated as a netCDF
file.
%> ncl *npp_read2nc.ncl*
This creates the *NPP_EDITED.nc *file
---
The following reads the *NPP_EDITED.nc *file and calculates the averages.
%> ncl *npp_stats.ncl*
This creates the *NPP_AVG.nc *file
Good luck
On Wed, Feb 12, 2020 at 12:01 PM Melanie O' hanoly via ncl-talk <
ncl-talk at ucar.edu> wrote:
> Hi Guys
>
> I have this tabulated data (.csv) and I have a question how do I calculate
> the average in the same months, lat and lon for the variable (NPP)?
>
> Many Thanks in advance
> Melanie
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200213/2135e78b/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: npp_read2nc.ncl
Type: application/octet-stream
Size: 3662 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200213/2135e78b/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NPP_EDITED.nc
Type: application/octet-stream
Size: 801364 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200213/2135e78b/attachment-0005.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: npp_stats.ncl
Type: application/octet-stream
Size: 3415 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200213/2135e78b/attachment-0006.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NPP_AVG.nc
Type: application/octet-stream
Size: 465004 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200213/2135e78b/attachment-0007.obj>
More information about the ncl-talk
mailing list