{ "info": { "author": "Stefan Codrescu", "author_email": "stefan.codrescu@noaa.gov", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Science/Research", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.6" ], "description": "# NetCDF Flag Wrapper (ncflag)\n\nSo... you want to inspect CF Compliant NetCDF flag variables?\n\nCF Compliant NetCDF Flag variables are integer flags associated with, or having:\n\n - flag_values\n - flag_meanings\n - flag_masks (optionally)\n\nRead the [CF Conventions on flags](http://cfconventions.org/Data/cf-conventions/cf-conventions-1.7/cf-conventions.html#flags) \nfor more information.\n\n## TL;DR\n\nInstall the utility with with pip:\n```\npip install ncflag\n```\n\nOn the command line, use `ncflag`:\n\n```\nUsage: ncflag [OPTIONS] NCFILE FLAG\n\nOptions:\n -v, --version Show the version and exit.\n --show_flags PATH Print the flags this tool can inspect.\n --use_time_var TEXT\n -l [DEBUG|INFO|WARNING|ERROR|CRITICAL]\n log level\n --help Show this message and exit.\n\n```\n\nNotes:\n\nUse --show_flags to discover what flags in a given file can be inspected.\n\nLimitation: can only inspect flags of at most one dimension. See details below for dealing with multidimensional flags.\n\n\nThe nominal output with --use_time_var specified is shown below. Without use_time_var, the index along the\ndimension will be printed instead of a iso 8601 timestamp.\n```text\n2017-11-27T21:07:41.543778: [u'data_quality_error']\n2017-11-27T21:07:42.543812: [u'good_data']\n2017-11-27T21:07:43.543807: [u'good_data']\n2017-11-27T21:07:44.543802: [u'good_data']\n```\n\n## Multidimensional Flags\n\nOccasionally, by some poor misfortune, you may encounter multidimensional flag variables. These are currently not\nsupported by the Command Line Interface (CLI), however, the FlagWrap class can still be used in code, or through an\ninteractive (IPython) session. The `FlagWrap.get_flags_set_at_index` can be passed a tuple of indicies to get the \nflags set in a multidimensional flag variable. Below is an example. \n\n```python\nfrom ncflag import FlagWrap\nimport netCDF4 as nc\n\nwith nc.Dataset(\"somenetcdf.nc\") as nc_in:\n v = nc_in.variables[\"mutidim_variable\"]\n print(v.shape) # --> (2, 10), is multidim.\n w = FlagWrap.init_from_netcdf(v)\n print(w.get_flags_set_at_index((0, 0))) # --> [\"good_quality_qf\"]\n```\n\n## API and Documentation\n\nTo use the FlagWrap in your own code, see the example\nabove for multidimensional flags.\n\nFor documentation, please read `flag_wrapper.py`. It is one file\nand is documented with comprehensive docstrings. The functions are\nnamed descriptively. A following functions are available from a FlagWrap instance.\n\n - get_flag(self, flag_meaning)\n - reduce(self, exclude_mask, axis=-1)\n - get_flag_at_index(self, flag_meaning, i)\n - get_flags_set_at_index(self, i, exit_on_good=False)\n - find_flag(self, options)\n - set_flag(self, flag_meaning, should_be_set, zero_if_unset=True)\n - set_flag_at_index(self, flag_meaning, i)\n - get_value_for_meaning(self, flag_meaning)\n - get_mask_for_meaning(self, flag_meaning)\n\n\n## Testing\n\nThere are tests, using both synthetic flags, as well as some more serious tests\nfor some fairly complex \"in the wild\" flags taken from a sample GOES-16 EXIS-L1b-SFXR product file.\n\n`test/test_theoretical.py` is actually a very thourough read to help anyone really understand\nwhat's possible and what's going on with these flags.\n\n---------------------\n\nDeploy to pip, after testing with python2 and python3:\n\n```bash\nrm -r dist/\npython setup.py bdist_wheel --universal\ntwine upload dist/*\n```\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/5tefan/ncflag", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "ncflag", "package_url": "https://pypi.org/project/ncflag/", "platform": "", "project_url": "https://pypi.org/project/ncflag/", "project_urls": { "Homepage": "https://github.com/5tefan/ncflag" }, "release_url": "https://pypi.org/project/ncflag/0.2.3/", "requires_dist": [ "Click", "numpy", "netCDF4" ], "requires_python": "", "summary": "Utility and library to interface with CF-Compliant NetCDF flag variables.", "version": "0.2.3" }, "last_serial": 4582998, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "dba7fc12cadebeb30b03fc9b102442f9", "sha256": "ac5a6926f431224d969931b2ded5818f18a7a0d2d4fcf9444dcc2033f58a2169" }, "downloads": -1, "filename": "ncflag-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "dba7fc12cadebeb30b03fc9b102442f9", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8464, "upload_time": "2017-11-28T21:55:28", "url": "https://files.pythonhosted.org/packages/fe/ef/3c4c733138f4a756bf136fe0e037e6d3396e781b5e180a2d056b9ee3c80d/ncflag-0.0.1-py2.py3-none-any.whl" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "00ed2fa748dc12e294a6d973316fb157", "sha256": "adc289fccdfa08624a3a1708de3a90fc8d17e111ca5d497f1749fed3173a2439" }, "downloads": -1, "filename": "ncflag-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "00ed2fa748dc12e294a6d973316fb157", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9801, "upload_time": "2018-05-31T21:41:19", "url": "https://files.pythonhosted.org/packages/1f/b6/841d0977e7691cc5ed681f6a39af4d610674e8bfbd5bf785554ae4da137c/ncflag-0.0.3-py2.py3-none-any.whl" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "87df473c479d6ed08ae7c967b916a0f5", "sha256": "7d8916f8068e02434df46ca8c325126b1626523152f3ac3117c15925b4ca3959" }, "downloads": -1, "filename": "ncflag-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "87df473c479d6ed08ae7c967b916a0f5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10156, "upload_time": "2018-06-05T18:19:31", "url": "https://files.pythonhosted.org/packages/b1/e0/610e5babdd57d747edc0fb802c4180a3bd7407abee80c449d76e8b02db5e/ncflag-0.1.0-py2.py3-none-any.whl" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "351360ced6f07d673b6b7e723967d24f", "sha256": "f0a4061ea1810c3b08b91d2e5c35157c5323122881691a9ae5b1480570b0a51c" }, "downloads": -1, "filename": "ncflag-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "351360ced6f07d673b6b7e723967d24f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10287, "upload_time": "2018-06-05T20:51:39", "url": "https://files.pythonhosted.org/packages/ac/5e/3c4e264cd8e1e449757fe0cf345a88dfa1226ee3b6a33736b4b1914994b0/ncflag-0.1.1-py2.py3-none-any.whl" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "d76ee8a243da298c93a3dbc2e26245ea", "sha256": "7c095c8ab7e25d31e31c3f828576c4339aab581b631433c606aa8ab16f9c48f9" }, "downloads": -1, "filename": "ncflag-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d76ee8a243da298c93a3dbc2e26245ea", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 11068, "upload_time": "2018-09-26T23:21:19", "url": "https://files.pythonhosted.org/packages/95/72/0aac12abbfcbdc779716442b17b9900c95a6a60b6471c5bdec46cdd40156/ncflag-0.2.0-py2.py3-none-any.whl" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "7e2672885416969613fc1c617cd7e324", "sha256": "23a47ed15cae318062e7b996f10ac155c1bcf3b71b2f43eb2ec38499191b058b" }, "downloads": -1, "filename": "ncflag-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "7e2672885416969613fc1c617cd7e324", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8611, "upload_time": "2018-12-10T22:00:11", "url": "https://files.pythonhosted.org/packages/2b/9e/38e0a02508a85654323e13b808841567410fcd18299ec2ab942c145bc0a6/ncflag-0.2.1-py2.py3-none-any.whl" } ], "0.2.3": [ { "comment_text": "", "digests": { "md5": "97d8ef24d67e4f1596473fd29c07762f", "sha256": "9bf29c82d464788e89ec466ebee81353766763b5a77d574028e5a4b7b4e5b38a" }, "downloads": -1, "filename": "ncflag-0.2.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "97d8ef24d67e4f1596473fd29c07762f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8811, "upload_time": "2018-12-10T22:52:33", "url": "https://files.pythonhosted.org/packages/94/ab/0100a9dc5757ebd62597cda352588dceae6d8492f1a585af6272faa5759a/ncflag-0.2.3-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "97d8ef24d67e4f1596473fd29c07762f", "sha256": "9bf29c82d464788e89ec466ebee81353766763b5a77d574028e5a4b7b4e5b38a" }, "downloads": -1, "filename": "ncflag-0.2.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "97d8ef24d67e4f1596473fd29c07762f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8811, "upload_time": "2018-12-10T22:52:33", "url": "https://files.pythonhosted.org/packages/94/ab/0100a9dc5757ebd62597cda352588dceae6d8492f1a585af6272faa5759a/ncflag-0.2.3-py2.py3-none-any.whl" } ] }