SDSlite
SDSlite copied to clipboard
Reading nc4
Tried reading a netcdf-4 file with netcdf 4.9.0 and SDS 2.0.3 in VS2022. Kept getting the error message Extension not registered. i tried running
var uri = NetCDF4.NetCDFUri(){ FileName = "filename.nc4", OpenMode = ResourceOpenMode.ReadOnly};
var sds = DataSet.Open(uri);
tried the solution offered in #32
protected bool Register_Extension(string extension)
{
Type dType = NetCDFDataSet.GetType("Microsoft.Research.Science.Data.NetCDF4.NetCDFDataSet");
return DataSetFactory.RegisterExtension(extension, dType);
}
var uri = NetCDF4.NetCDFUri(){FileName="filename.nc4", OpenMode=ResourceOpenMode.ReadOnly};
var sds = DataSet.Open(uri);
var sds = DataSet.Open("msds:netcdf?fileName=filename.nc4&openMode=readOnly");
After trying this i got the error message "Failed to create DataSet instance from uri msds:nc?file=filename&openMode=readOnly NetCDFInterop.NetCDFDynamic called for exception"