{"id":15009160,"url":"https://github.com/suizer98/nefis2nc","last_synced_at":"2026-01-30T01:38:36.773Z","repository":{"id":189893780,"uuid":"677694540","full_name":"Suizer98/nefis2nc","owner":"Suizer98","description":"Convert Delft3D-FLOW output trih \u0026 trim files into netcdf format using python (NEFIS to NetCDF)","archived":false,"fork":false,"pushed_at":"2024-06-11T07:58:37.000Z","size":54811,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-13T13:53:03.127Z","etag":null,"topics":["delft3d","docker","docker-compose","linux","nefis","nefis2nc","nefis2netcdf","nefistonetcdf","netcdf","python","python27","trih","trim","window"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Suizer98.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-12T10:19:50.000Z","updated_at":"2024-06-24T14:52:36.000Z","dependencies_parsed_at":"2023-10-01T00:15:23.837Z","dependency_job_id":"a53e2c09-99f6-41ba-9b9a-c7e8eec67859","html_url":"https://github.com/Suizer98/nefis2nc","commit_stats":{"total_commits":24,"total_committers":3,"mean_commits":8.0,"dds":"0.33333333333333337","last_synced_commit":"834921c08dc6c44ac212c87e1893cc4e18ffb57b"},"previous_names":["suizer98/nefis2nc"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Suizer98%2Fnefis2nc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Suizer98%2Fnefis2nc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Suizer98%2Fnefis2nc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Suizer98%2Fnefis2nc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Suizer98","download_url":"https://codeload.github.com/Suizer98/nefis2nc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247640493,"owners_count":20971563,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["delft3d","docker","docker-compose","linux","nefis","nefis2nc","nefis2netcdf","nefistonetcdf","netcdf","python","python27","trih","trim","window"],"created_at":"2024-09-24T19:23:18.193Z","updated_at":"2026-01-30T01:38:36.768Z","avatar_url":"https://github.com/Suizer98.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nefis2nc\n\n## Description\n\nHere is a working nefis2nc repo that based on rustychirs' works:\nhttps://github.com/rustychris/stompy/tree/master that aims to replace \nvs_trih2nc.m and vs_trim2nc.m using Python.\n\nThis project is mainly focused on converting Delft3D-FLOW trih and trim output\ninto more organised netcdf files. The trih2nc.py aims to create a netcdf file \nas close as possible to the output of vs_trih2nc.m, while the trim2nc do the same\nfor vs_trim2nc.m.\n\nTech stacks:\n\n![Tech stacks](https://skillicons.dev/icons?i=python,docker,ubuntu,bash,anaconda,matlab)\n\nFor now the working codes are:\n1. trih2nc.py\n2. trim2nc.py\n3. listener.py\n\n## Running conversion scripts\n1. Install every dependencies needed inside Conda environment, see [conda method](#conda-method).\n2. Go to listener.py, make sure your folder contain Delft3D output, then edit variable as you wishes:\n```\nfolder_path = \"D:/Sample setup and simulation\"\noutput_path = os.path.join(os.getcwd(), \"tests/testdata/\")\n```\n3. In your terminal or any possible executable ways, run \n```\npython listener.py\n```\n\n## Setting up Docker Ubuntu environment\n\n- Dockerfile and docker-compose.yml are created in such a way that you don't need to build environment by yourself, all you need is to run docker's command.\n- After cloning this repo, in your terminal simply run:\n\n```\ndocker-compose up -d  # Start the containers in the background\ndocker exec -it nefis2nc /bin/bash  # Attach to the container's terminal\n```\n\n- After entering docker container:\n```\nroot@7e8c9bfe1c7a:/app# ls\nDockerfile         docker-compose.yml  stompy2   trih2nc.py             trim_matplot_class.py\nDockerfile-window  libs                test.py   trih_matplot_class.py  whls\nREADME.md          requirements.txt    testdata  trim2nc.py\n\nroot@7e8c9bfe1c7a:/app# python trih2nc.py datfile deffile outputfile\nNo handlers could be found for logger \"utils\"\n/app/stompy2/stompy/model/delft/nefis_nc.py:93: FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.\n  value=value[val_slices]\nNetCDF file has been created.\n```\n\n## Preparing Conda environment on Window machine\n\n### Prerequisites\n\n- python 2.7 installed on window machine/linux machine\n- conda installed\n\nThe original stompy repo only supports 'libnefis.so' which works on linux machines,\nIf you are using window machine, you can attach the nefis.dll file so it works on your end.\nWe can modify the load_nef_lib function in stompy repo to create magics.\n\n### conda method\n\nBest to run this script in conda environment if without Docker, to setup the env run 'nefis2nc.bat' on your window machine:\n\n```\nnefis2nc.bat\n```\n\nYou may open the batch script with editor to see the manual steps to setup conda env, you need to open cmd.exe for 'nefis2nc' directory:\n```\nconda create --name nefis2nc python=2.7\nconda activate nefis2nc\ncd stompy\n\ncall pip install -e .\n\ncd ..\nfor %%I in (whls\\*.whl) do (\n    pip install %%I\n)\n\nconda install --yes scipy\nconda install --yes autopep8\n```\n\n### Disclaimer\nThe results might still differ a bit when comparing to the original output from MATLAB scripts. I guess maybe this is because the python one doesn't involve some computation like coordinate system or other factors.\nI suggest can checkout to this [repo](https://github.com/Suizer98/delft3d_octave]) instead. This one runs native MATLAB scripts without relying to use MATLAB software.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuizer98%2Fnefis2nc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuizer98%2Fnefis2nc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuizer98%2Fnefis2nc/lists"}