Found a bug? Contact me at huang dot andrew12 at gmail dot com!
Functions that I can easily reference, and maybe you too!
Docstrings here: https://github.com/ahuang11/ahh/blob/master/docstrings.py
In-depth example here: https://github.com/ahuang11/ahh/blob/master/examples/example.py
DISCLAIMER: This repo is still in its infancy; I tried to debug as best I could within a couple days, but may still return errors or do something unwanted. Basically don't hold me accountable if something goes wrong; go read the license!
- Type "git clone https://github.com/ahuang11/ahh.git"
- Go into ahh folder (where setup.py is)
- Type "pip install -e ." (may need to be in bash first!)
- In a Python script, type "from ahh import vis, sci, ext"
- Check out example.py in the examples folder for example usage!
from ahh import vis
x = [1, 2, 3, 4]
y = [5, 6, 7, 8]
vis.plot(x, y, show=True)
- wget_fi: downloads multiple files with a common pattern name
- option to put in username and password
- option to select directory for files to be downloaded in
- ncdump: prints out netCDF4 metadata
- concat_nc: combines multiple netCDF4 files with a common pattern name
- capability to append/reference record dimension properly
- option to select directory for files to be read from
- get_uac: get the uncentered anomaly correlation of grid
- get_cac: get the centered anomaly correlation of grid
- get_rmse: get root mean square error of grid
- convert: does some common conversions ** UNTESTED
- millmeters to inches
- Celsius to Fahrenheit
- Celsius to Kelvin
- Fahrenheit to Kelvin
- meters per second to miles per hour
- All that in reverse
- get_norm_anom: get the normalized anomaly of array
- get_avg: get average over specified indices and axis
- ahh: prints out a variable summary
- prints type, unnested type, length, and shape of a variable.
- prints max and min of the variable
- option to control how many numbers are printed
- option to print the center of the array
- option to title the print output
- p: prints a mark in the terminal to help debug
- option to differentiate marks
- lonw2e: converts west longitudes to east longitudes
- option to do reverse
- get_idc: get the indices for bounding latitudes and longitudes
- option return only the max and min
- option to convert input west longitudes to east or vice versa
- get_lvl_idc: get the indices for bounding levels
- get_time_idc: get the indices for bounding times
- get_closest: get closest value and index
- read_nc: read netCDF4 file
- grabs the opened dataset, time, latitude, and longitude arrays
-export_nc: export netCDF file
- supports up to four dimensions
- supports unlimited variables
- create_dt_arr: from a Julian day array, create a datetime array
- dt2jul: convert datetime to Kulian day
- jul2dt: convert Julian day to datetime
- dtnow: get the utc datetime now
- clockit: input the earlier time and return time since
- plot: effortlessly make beautiful plots
- supports up to two arrays,
- extra y-axis available,
- up to two subplots,
- can share x/y-axis,
- can limit x/y-axis
- datetimes supported for x-axis
- global_map: make a map
- prettify_plot: effortlessly make your own plot pretty
- set_labels: set and prettify x and y labels
- may also set title
- set_legend: create a legend
- Enhanced ext.ahh() to handle 0 length variables
- Lessened the inputs in ext.lonw2e()
- Added ext.get_lvl_idc(), ext.get_time_idc(), ext.get_closest()
- Fixed bug in ext.export_nc()
- Added ext.clockit() to time your code easily!
- Added sci.get_avg() to handle all your averaging needs
- Replaced vis.global_map() with vis.plot_map() that uses Cartopy
- Modified in_depth_example.py and added map_example.py
- Exception handling for ext.ahh()
- Added input to only read extras for ahh.read_nc()
- Updated ext.ahh() to work with multidimension arrays
- Added new ext.export_nc function!
- Convert between Julian day to datetime effortlessly!
- Quickly get datetime now with ext.dtnow()!
- Overhauled ext.ahh() to produce more info
- Renamed ext.ahh(name='old') to ext.ahh(n='new')
- Can add pretty labels and legends separately
- If ext.get_idc() is empty, print warning message
- Added datetime to Julian day conversion function
- Debug your code easier with ext.p()!
- Bug fix with xlim not working properly in vis.plot()
- Cleaned up example.py
- In-depth example usage is now available!
- Completely revamped ext.ahh()
- Fixed sci.convert()
- Latitude and longitude optional in ext.read_nc
- New pre.ncdump() which dumps netCDF4 metadata
- pre.concat_nc() now supports other directories
- Removed sci.get_atavg and ext.locate_valid_start
- Renamed lon360 to lonw2e
- Added ability to convert longitudes from east to west
- Aesthetic improvements and more error messages
- Added ext.lon360() which converts west longitudes to east
- Added "maxmin" and "w2e" inputs to ext.get_idc()
- Added "directory" input to pre.wget_fi()
- Added "interval" input to vis.plot()
- Fixed bug where xlabel and ylabel wasn't set for single plot
- Added easily accessible docstrings.py for easier referencing
- Linked the docstrings.py in README.md
- Reorganized README.md for better logical progression
- Added requirements to setup.py
- Added new package: pre.py
- New functions pre.py: wget_fi() and concat_nc()
- Renamed ext.eval() to ext.ahh()
- Function ext.ahh() no longer has unnest=True as default
- Added "bare" input to ext.ahh
- Enhanced ext.read_nc() to include more options
- Enhanced vis.plot() to include exception handling notices
- Removed "name" input in vis.plot() and changed "save" input
- New function in vis.py: global_map
- New function in sci.py: get_norm_anom
- Aesthetic changes all over
- Complies with Flake8 and Codacy
- Creation of ahh with vis, sci, and ext packages.
- Exception handling and display!
- More conversions!
- More scientific/statistical functions!
- Add scalability in vis.plot()
- Remove clutter (if, else) from vis.plot()
- Add more plots functionality in vis.plot()
- Input latitudes and longitudes and locate those values into ahh
- Possibly add read csv capabilities?
- Update sci functions to be more flexible and reflect new changes
- Fix the known issues listed below!
- Write new example usage for new functions
- Export netcdf to specific directory
- Optimize functions
- Improve visual of vis.plot_map()
- vis.plot() "minor" input is useable, but returns inconsistent font and color