Re: Visualising categorical vegetation data

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Oct 29 2010 - 13:20:43 MDT

Dear Wil,

It doesn't look like anybody responded to this, so I'll give it a try.

I'm not sure what you mean by :

   subset = (/var1, var3, var5/)

But you could write the "lon_f", etc variables directly to a NetCDF file, subsetting as necessary.

For example, if you wanted the output NetCDF file to be "output.nc", this would be the easy way:

  ...create the xxx_f variables...

;---Write variables to a NetCDF file
  foutname = "output.nc"
  system("/bin/rm " + foutname
  fout = addfile(foutname,"c")

  fout->lon = lon_f
  fout->lat = lat_f
  fout->potveg = potveg_f

If you want to subset them as you're writing them out, then you can do something like this:

  fout->lon = lon_f(ilon1:ilon2)
  fout->lat = lat_f(ilat1:ilat2)
  fout->potveg = potveg_f(ipot1:ipot2)

where the ilon1, ilon2, ilat1, etc, are the subscripts. If you're using coordinate subscripts to do the subsetting, that's fine.

For the visualization, please see this page:

http://www.ncl.ucar.edu/Applications/classification.shtml

--Mary

On Oct 25, 2010, at 2:58 PM, Willow S Hallgren wrote:

> Hi,
>
> I have some very large ascii (csv) files (approx 9.9 gb each) and I'm trying to write an NCL script to (a) create a subset of them, and output this to a netcdf file, and (b) visualise them.
>
> I've done (a) via the code:
>
> filename = "/dir/XYZ_dataset.csv"
> lines = asciiread(filename,-1,"string")
> delim = ","
> lon = str_get_field(lines,1,delim)
> lat = str_get_field(lines,2,delim)
> varname = str_get_field(lines,3,delim)
> year = str_get_field(lines,4,delim)
> potveg =str_get_field(lines,9,delim)
>
> I then convert data types from string to whatever they're supposed to be using the NCL type converter functions
>
> e.g. lon_f = stringtofloat(lon)
>
> I then create a subset using the onedtond function; subset = (/var 1,var 3, var 5/) etc...
>
> When I print this subset, it gives me a long list of values with their column and row numbers.
>
> My questions are:
>
> - Is there an easy way I can write this subset of ascii data to netcdf format?
>
> - how would I visualise this data? basically I want to be able to draw a map of vegetation classes on a global grid. - how would I go about doing this - none of the plot types I've come across seem to do what I want...
>
> Thanks in advance if anyone can give me some pointers....
>
> Regards,
> Wil
> _______________________________________________
> 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 29 13:20:48 2010

This archive was generated by hypermail 2.1.8 : Fri Oct 29 2010 - 13:25:49 MDT