Microsoft.Research.Science.Data.NetCDF4.NetCDFDataSet.WriteNetCdfAttribute(int, string, object, Microsoft.Research.Science.Data.NetCDF4.AttributeTypeMap)

Here are the examples of the csharp api class Microsoft.Research.Science.Data.NetCDF4.NetCDFDataSet.WriteNetCdfAttribute(int, string, object, Microsoft.Research.Science.Data.NetCDF4.AttributeTypeMap) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Example 7

1. Example

Project: SDSlite
Source File: NetCDFDataSet.cs
protected override void OnPrecommit(DataSet.Changes changes)
        {
            if (initializing) return;

            // Saving proposed coordinate systems as global attributes
            var proposedCS = GetCoordinateSystems(SchemaVersion.Proposed);
            if (proposedCS.Count > 0)
            {
                // saving global attribute: csname axis1.ID axis2.ID etc
                for (int i = 0; i < proposedCS.Count; i++)
                {
                    CoordinateSystem cs = proposedCS[i];
                    if (Array.Exists(cs.AxesArray, a => !(a is INetCDFVariable)))
                        continue; // saving cs with native axes only

                    string attName = "coordinates" + (i + 1).ToString();
                    StringBuilder attValue = new StringBuilder(cs.Name);
                    foreach (var axis in cs.Axes)
                    {
                        attValue.Append(' ');
                        attValue.Append(axis.ID);
                    }

                    WriteNetCdfAttribute(NcConst.NC_GLOBAL, attName, attValue.ToString(), null);
                }
            }
        }