Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to read netCDF file from directly path ? #48

Open
mintheinwin opened this issue Feb 27, 2024 · 0 comments
Open

How to read netCDF file from directly path ? #48

mintheinwin opened this issue Feb 27, 2024 · 0 comments

Comments

@mintheinwin
Copy link

I'm using sdslite library for C# window application.

  using (Microsoft.Research.Science.Data.DataSet ds = Microsoft.Research.Science.Data.DataSet.Open("msds:nc?file=C:/Users/Min Thein Win/Downloads/myfile.nc&openMode=readOnly"))
        {
            Console.WriteLine(ds);
           // Console.WriteLine(ds.Metadata["comment"]);
          //  var lat = ds.GetData<float[]>("lat");
          //  Console.WriteLine($"latitude: len={lat.Length}, min={lat.Min()}, max={lat.Max()}");
        }

Error Log

Unhandled Exception: Microsoft.Research.Science.Data.DataSetCreateException: Failed to create DataSet instance from uri msds:nc?file=C:/Users/Min Thein Win/Downloads/myfile.nc&openMode=readOnly: Unable to load DLL 'netcdf': The specified module could not be found. (Exception from HRESULT: 0x8007007E) ---> System.DllNotFoundException: Unable to load DLL 'netcdf': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at NetCDFInterop.NetCDFNative.nc_set_chunk_cache(IntPtr size, IntPtr nelems, Single preemption)
at NetCDFInterop.NetCDF.nc_open_chunked(String path, CreateMode mode, Int32& ncidp, IntPtr size, IntPtr nelems, Single preemption)
at Microsoft.Research.Science.Data.NetCDF4.NetCDFDataSet.InitializeFromFile(String fileName, ResourceOpenMode openMode)
at Microsoft.Research.Science.Data.NetCDF4.NetCDFDataSet..ctor(String uri)
--- End of inner exception stack trace ---
at Microsoft.Research.Science.Data.Factory.DataSetFactoryEntry.CreateDataSet(String uri)
at Microsoft.Research.Science.Data.Factory.DataSetFactory.Create(DataSetUri uri)
at Microsoft.Research.Science.Data.Factory.DataSetFactory.Create(String uri)
at Microsoft.Research.Science.Data.DataSet.Open(String uri)
at ControlConsoleApp.Program.Main(String[] args) in D:\WindowFormTest_workspace\sampleFormApp\ControlConsoleApp\ControlConsoleApp\Program.cs:line 49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant