GithubHelp home page GithubHelp logo

blazk / fuse-netcdf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dvalters/fuse-netcdf

0.0 1.0 0.0 12.34 MB

ESoWC project to develop a utility to mount netCDF files as a files system in user space. (FUSE)

License: Other

Python 99.83% Shell 0.17%

fuse-netcdf's Introduction

Build Status Codacy Badge

Python 3.6 Python 2.7

fuse-netcdf

ESoWC project for the netcdf-fusepy utility. (Work in progress)

See the wiki for proposal, workplan, other notes etc. https://github.com/dvalters/fuse-netcdf/wiki

This readme contains a brief overview of how to use fuse-netcdf and some example output.

Usage

This is currently a work in progress, but the basic usage at the testing stage is as follows:

python fusenetcdf.py <NetCDF_File.nc> <mountpoint>
  • The fusenetcdf.py is in the fusenetcdf directory.

  • The <NetCDF_File.nc> should be the path to your netcdf file.

  • You should create an empty folder which will be your mountpoint at <mountpoint>

To unmount the netCDF directory, use:

fusermount -u mntpoint/

Example usage:

From the linux terminal:

(A sample netcdf file is provided in the trial folder)

(fusepy27) [dav@localhost fuse-netcdf]$ python fuse-netcdf/fusenetcdf.py trial/ECMWF_ERA-40_subset.nc trial/mntpoint/

Your netCDF file should now be mounted at /trial/mntpoint (Or wherever you created the mountpoint folder).

What does the mounted netCDF file look like? (note: this is subject to change during development)

If we run the tree command in the top level directory, we get a structure like this:

mntpoint/
├── netCDF_variable_name
│   ├── DATA_REPR        # The representation of the Variable's data array (placeholder)
│   ├── variable_attr1    # A file representing each attribute
│   ├── variable_attr2    # More attributes for this variable etc.
(and so on for each variable)

So to see it with the example file, we get:

[dav@localhost trial]$ tree mntpoint/
mntpoint/
├── blh
│   ├── add_offset
│   ├── DATA_REPR
│   ├── _FillValue
│   ├── long_name
│   ├── missing_value
│   ├── scale_factor
│   └── units
├── cp
│   ├── add_offset
│   ├── DATA_REPR
│   ├── _FillValue
│   ├── long_name
│   ├── missing_value
│   ├── scale_factor
│   └── units
├── e
│   ├── add_offset
│   ├── DATA_REPR
│   ├── _FillValue
│   ├── long_name
│   ├── missing_value
│   ├── scale_factor
│   └── units
├── hcc
│   ├── add_offset
│   ├── DATA_REPR
│   ├── _FillValue
# etc etc.....

If you are using a graphical file browser, the output is similar. Here is an example of what it should look like:

variable dirs

var_attrs

Development resources

Example of the fusepy module in use here (w/o netCDF) https://github.com/dvalters/Python-miscellany/blob/master/fusepy.ipynb

Blogpost example: https://medium.com/the-python-corner/writing-a-fuse-filesystem-in-python-5e0f2de3a813

Which is based on this example... https://github.com/skorokithakis/python-fuse-sample

fusepy is not that well documented, but these resources have been useful (they mostly refer to the FUSE C-library)

https://engineering.facile.it/blog/eng/write-filesystem-fuse/

https://www.cs.hmc.edu/~geoff/classes/hmc.cs135.201001/homework/fuse/fuse_doc.html

https://www.cs.nmsu.edu/~pfeiffer/fuse-tutorial/html/unclear.html

http://www.maastaar.net/fuse/linux/filesystem/c/2016/05/21/writing-a-simple-filesystem-using-fuse/

This is a nice overview of what happens when various filesytem operations are called: https://www.slideshare.net/matteobertozzi/pythonfuse-pycon4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.