Showing posts with label netcdf. Show all posts
Showing posts with label netcdf. Show all posts

Tuesday, October 18, 2011

The iGlobe project - Globe + N-d data + Intelligence

Patrick at NASA is amazing at putting people together, he put CSIRO Marine and Atmospheric Research ( who provide my daily bread currently ) , ORNL , NOAA and NASA itself. This project aims to visualise space-time resolved datasets in the globe context. With proper planetary projections on any object.

We had internally started building blocks of a large modular data visualisation framework called TrikeND, this was a natural choice to attach it to the globe context via worldwind. Even though scientists often prefer to see the data in pure form without being attached to the globe, so we have alternative renderers such as VTK and Jzy3D in the sights in addition to iGlobe. The primary data source is NetCDF, but we also provision GIS formats via Geotools, I put in sometime experimenting with OSGification of Geotools, with lots of help from Mathieu and Jody. This is designed to carry on from our legacy product DIVE.
DIVE Use cases

iGlobe focuses on addressing the following issues:

Vector field rendered in iGlobe

1: Streaming large datasets from where they sit to where they are viewed. We would like to use standard protocols where possible, especially WCS NetCDF profile and OPeNDAP.
2: Providing heuristics to identify the right fields to be visualised as scalars, vectors and tensors.
3: Different display techniques for rendering scalar and vector fields, including volume visualisation with voxel and slice based techniques, display lists, vertex array, VBO , true impostors and other usual suspects.
4: Coherent time-locked animations keeping all the layers in sync in real/model time domain.
5: Transparent analysis techniques running on small problems on the client side and calling on server resources for large problems. Varun has been implementing various data mining techniques including FFT, change detection and anomaly detection.

There is lot more to come including an opportunity run iGlobe as part of an experiment on the ISS.

Sunday, September 4, 2011

Making NetCDF Faster, microbenchmarks on macro .nc

We have several very large NetCDF datasets with lots of variables to visualise. I have a gut feeling that file sizes are an issue and there is a bottleneck at the disk to RAM stage, but how do I prove it ? By writing a set of micro-benchmarks to test the various storage and access options. The options are:

1) Storage pattern - NetCDF allows vanilla NetCDF3, Lossy Packing, Lossless Deflation, Chunking and combinations of the aforementioned schemes for storage. If data fidelity is not an issue (as in the case of materialised overviews) , my benchmarks indicate that Lossy Packing is the best way to go.

2) Access pattern - The beast under scrutiny was 27GB RAMS Atmospheric model with 50+ variables. The biggest variable chews up 2GB of RAM if you load it all at once. Full data load takes 1000s, while 1/16th load in all dimensions takes 600ms. If just edges are read to perform a bounding box style render that is quicker as well. The exact access pattern used will depend on the volume rendering technique chosen. There are also asymmetries in accessing the beginning and ending of the variables. This indicates linear seeks across files.

3) Access Path - Still need to compare access via the C-library+JNA/JNI rather than pure Java. John Caron seems to have done it a while ago, but I am still agonising over how to activate this experimental code in the current version of the library.

PS: I have got the JNA code working with NetCDF-Java and started a dialog with John.

Saturday, February 19, 2011

Raster to Vector - and things in between

Coming from the remote sensing world, your day revolves around processing datasets from raster to vector and back. Grab a stereo satellite image of Melbourne, trawl through all the buildings in Leica Stereo view and digitize ground footprint, save to shapefile/kml/whatever vector format is the flavour of the day, render back to raster in 2.5D/3D. There is always information between the cracks of every pixel and delineated polygons and lines that is important but gets mangled in the constant transformation.

Spending some time in the NetCDF world I have become aware of the variety in scientific data and how the rigid Raster/Vector mentality of the GIS world does not really fit with it. Last year I went to the ARSPC Conference in Alice Springs and a Chris Tweedie (Technical Sales from Erdas) gave a talk on the joys of JPEG2000 and how all sorts of data can be stored in this format. There was somebody in the back of the room form IMOS/TERN projects disapproving at the disparity between the expectation of the GIS world and the scientific datasets he is used to hosting.
Regular vs Unstructured Grid
NetCDF has nice and fast access to gridded data sets with co-ordinate conventions allowing storage of data not only using cartesian grids but also with curvilinear grids as long as the parameters producing the grid are properly defined. Now there is move towards making this rather rasterlike approach more vectorlike with the idea of unstructured grids. Then NetCDF will become an even more general (and more complex) representation of all possible data - raster, vectors and everything in-between. There is real need for generalised (non vector/raster) representation of geographic information. Something that emphasizes on utility rather than conformance. The software to handle this data and ultimately the memory models need to think differently (in parallel) to stay in touch with reality. It does not help at all when there is a nomenclature clash, vector mean winds and currents in CMAR and mean points and polygons in GIS.

That aside recently I have spent a fair bit of time migrating from SVN to Mercurial. The OTB project made me fall in love with Mercurial. Afterwards Google code has fostered the obsession with working offline while making commits - aeroplane mode. There are myriads of ways for migrating from SVN to Hg - the stock convert extension, hgsvn or hgsubversion. You can even stay attached to your beloved subversion using subrepository techniques. Not everything however is smooth and some strange empty merging takes place along the way due to the repeated rebasing needed to stay in sync with SVN, hopefully the limbo will be over soon.