Skip to content

knaidoo29/knpy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

knpy

Personal python utility functions.

Dependencies

  • python 3
  • numpy
  • matplotlib
  • healpy
  • h5py
  • george

Installation

git clone https://github.com/knaidoo29/knpy.git
cd knpy
python setup.py build
python setup.py install

Uses

  • Binning functions:

    • bins.bin_data: Bins data.
    • bins.edges2centers: Bin edges to centers.
    • bins.centers2edges: Bin centers to edges.
    • bins.rebin: Rebins binned data.
    • bins.divide_1D: Divide data along 1 axis.
    • bins.divide_ND: Divide data along N axes.
    • bins.bin_by_index: Bins data by index.
  • File utility:

    • files.create_folder: To create folders.
    • Functions for opening and outputting info on hdf5 files:
      • files.get_hdf5_keys to print the hdf5 keys and file structure.
      • files.get_hdf5_data retrieves the data of interest which is specified by the hdf5 keys.
  • Gaussian Processes:

    • gp.GaussianProcesses: Class wrapping george's Gaussian Process fitting function for a 1D function.
  • Masking functions:

    • mask.get_binmask: Returns a binary mask from a float mask.
    • mask.binmask2index: Returns index in a binary mask.
    • mask.index2binmask: Returns a binary mask from the mask index.
    • mask.remove_masked: Removes areas of the data vector that are masked.
    • mask.fill_masked: Fills in values outside of the mask.
  • Plotting utility:

    • plot.FigureSize: Class for ensuring figures and colorbars are the correct size so that all size definitions (fonts, etc) have a definitive rather than arbitrary meaning.
    • plot.Healpy2Cartopy: Converting Healpix map to 2D logitude and latitude grid. This allowing one to plot using cartopy's transformation routines.
    • plot.set_matplotlib_default: Set default to latex fonts.
  • Progress bar:

    • utils.progress_bar: Print's a changing progress bar to give visual updates of for-loop progression.
  • Statistics:

    • stats.Jackknife: A jackknife resampling class.
    • stats.round_up: Rounding a number to a given significant figure.

About

Personal python utility functions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published