{ "info": { "author": "Nicolas Munnich", "author_email": "nmdm20@bath.ac.uk", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: C", "Programming Language :: Python :: 3.7", "Topic :: Scientific/Engineering", "Typing :: Typed" ], "description": "# ROMSPY: Regional Ocean Modelling Systems preprocessing and tools\nThis package is used to interpolate and make adjustments to input data so that it is suitable as input to ROMS. \n##Quick Start:\n1. ```pip install romspy``` to install romspy into your environment. Note that this requires you to have a C compiler which accepts CMake. Alternative approaches can be found under **Limitations**.\n\n2. Create a script file and save this in whichever directory you desire. Guidelines found under **Options file**, examples can be found [here](https://www.github.com/saixos/romspy) under the tests folder.\n\n3. Run the script file either from your IDE or by typing ```python options.py``` into your terminal.\n\n4. Head out for a coffee - This could take a few minutes!\n\n5. Navigate to your destination directory to find one or more output files.\n\n## Script file:\n The script file determines what inputs and settings should be used. The most basic example would be:\n ```python\nfrom romspy import PreProcessor\nfrom romspy.settings import Settings\n\ntarget_grid = \"target_grid.nc\"\noutfile = \"outfile.nc\"\nsources = [\n { \n 'variables': [\n {'out': 'my_variable', 'in': 'my_variable'},\n ],\n 'files': ['my_input_file.nc'],\n 'interpolation_method': 'bil',\n }\n]\n\nmy_preprocessor = PreProcessor(target_grid, outfile, sources, Settings([]))\nmy_preprocessor.make()\n```\nTo explain this line by line:\n\n```PreProcessor``` performs all interpolation, renaming, etc. automatically based on the inputs provided.\n\n```Settings``` runs adjustments made to variables. To give an example of an adjustment, say that the desired variable is variable a which is equal to the sum of variables a1 and a2. To produce variable a, variables a1 and a2 are first interpolated onto the desired grid, then a function in Settings is called which produces a by summing a1 and a2.\n\n```target_grid``` is a ROMS standard grid file which is the grid that will be interpolated onto. Ensure the filepath is included if necessary.\n\n```outfile``` is the name given to the output files. If ```outfile``` is ```\"my_dir/outfile.nc\"``` as in the example, then the output files will be put in the directory 'my_dir' and be named 'outfile_#_#.nc' with the #'s replaced by integers.\n\n```sources``` contains information on which variables to interpolate and how they should be interpolated. ```sources``` is a list of dictionaries, where each dictionary is called a *group*. Each group must have three keys: ```'variables'```, ```'files'```, ```'interpolation_method'```. \n * ```'variables'``` is a list of dictionaries, where each dictionary corresponds to a single variable. The dictionary of a single variable must have the keys ```'in'``` which is the name of the variable in the input files, and ```'out'``` which is the desired name of the variable in the output files. If a variable is to be edited by ```Settings```, then the name in ```'out'``` should correspond to the input accepted by ```Settings```. The dictionary of a single variable can also include the key ```'vertical'``` with the value ```True``` if the variable has a depth dimension and should be vertically interpolated onto an s_rho grid.\n * ```'files''``` is a list of input files where the variables can be found. Only the variables in ```'variables'``` will be extracted from the input files. The list can have multiple files if the files are separated by timesteps. If a variable is in ```'variables''``` which is not present in one of the files in ```'files'```, an error will be thrown.\n * ```'interpolation_method'``` is the horizontal interpolation method used. Vertical interpolation is always done linearly. Options are: ```'bil'```,```'bic'```,```'nn'```,```'dis'```,```'con'```,```'con2'```,```'laf'```.\n \n```PreProcessor``` accepts a number of arguments detailed in **Class Overview**, but the 4 mandatory inputs are the grid to use, the output, the sources, and which Settings to use. The settings input in this example are empty, so no changes would be made. Some default settings exist and can be used by importing them ```from romspy import forcing_settings``` or ```from romspy import clim_settings```. \n\n```my_preprocessor``` is the ```PreProcessor``` instance with the settings as input. To run the interpolation and adjustments, call the function ```make()```.\n\n## Settings:\n\nSettings are created by calling ```Settings(adjustments_list, flags_dict)```.\n\n####Adjustments:\nAn adjustment is a single change which should be made to the file. ```adjustments_list``` is a list of all the changes which will be made. An element of ```adjustments_list``` is a dictionary with the following keys:\n * ```'out_var_names' : set(var_name_1, var_name_2)``` Out var names points to a set of variables which this adjustment produces as output. This is used to check if the adjustment is necessary. For example, if the adjustment produces the variable ```'dQdSST'``` but you've already listed ```'dQdSST'``` as one of your ```'out'``` variables in ```sources```, then the program will not attempt to \n 'out_var_names': set(), 'in_var_names': {'sustr', 'svstr'},\n 'func': str_adjustment\n },\n## Customisation:\n\n## Limitations:\n\n###### Author information:\n\n\nThis is a simple example package. You can use\n[Github-flavored Markdown](https://guides.github.com/features/mastering-markdown/)\nto write your content.", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://https://github.com/Saixos/romspy", "keywords": "preprocessing ROMS roms Regional Ocean Modelling System cdo Climate Data Operators netcdf4", "license": "", "maintainer": "", "maintainer_email": "", "name": "romspy", "package_url": "https://pypi.org/project/romspy/", "platform": "", "project_url": "https://pypi.org/project/romspy/", "project_urls": { "Homepage": "https://https://github.com/Saixos/romspy" }, "release_url": "https://pypi.org/project/romspy/0.9.0/", "requires_dist": null, "requires_python": ">=3.6", "summary": "Preprocessing files for use in ROMS", "version": "0.9.0" }, "last_serial": 5800251, "releases": { "0.9.0": [ { "comment_text": "", "digests": { "md5": "f6e9b78a5d2af335710bc968477b67dc", "sha256": "2965625fa211c87df53de3d9dbf1b280728db39bf7049d07ab404da4fc61e1c2" }, "downloads": -1, "filename": "romspy-0.9.0.tar.gz", "has_sig": false, "md5_digest": "f6e9b78a5d2af335710bc968477b67dc", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 59131, "upload_time": "2019-09-08T19:05:12", "url": "https://files.pythonhosted.org/packages/8e/7e/27b6b5d94ced6ac8ca081f4d6e26c92068b9bb8f3bc925f70e1b7ac645fc/romspy-0.9.0.tar.gz" } ], "0.9.0.dev1": [ { "comment_text": "", "digests": { "md5": "640102841d464e0d1ec7c33f140661b8", "sha256": "5d43c249c0ab667e7344380c401fe314884948797c3e9f22cf2aa2a0d0401dc0" }, "downloads": -1, "filename": "romspy-0.9.0.dev1.tar.gz", "has_sig": false, "md5_digest": "640102841d464e0d1ec7c33f140661b8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 35188, "upload_time": "2019-09-08T19:17:09", "url": "https://files.pythonhosted.org/packages/53/1b/3d4c16c992bc74a8c3463fd6e2d865776aac2d22e5c2ec9cff306ded588e/romspy-0.9.0.dev1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f6e9b78a5d2af335710bc968477b67dc", "sha256": "2965625fa211c87df53de3d9dbf1b280728db39bf7049d07ab404da4fc61e1c2" }, "downloads": -1, "filename": "romspy-0.9.0.tar.gz", "has_sig": false, "md5_digest": "f6e9b78a5d2af335710bc968477b67dc", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 59131, "upload_time": "2019-09-08T19:05:12", "url": "https://files.pythonhosted.org/packages/8e/7e/27b6b5d94ced6ac8ca081f4d6e26c92068b9bb8f3bc925f70e1b7ac645fc/romspy-0.9.0.tar.gz" } ] }