This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def to_primitive(arg): | |
| """Converts NumPy arrays, Pandas Dataframes or Pandas series to their primitive Python equivalent. | |
| to_primitive(np.array([1,2,3])) --> [1, 2, 3] | |
| to_primitive(np.array([[[1,3,4], [1.1,2.2,None], [0,0.1,0]],[[1,0,0],[0,1,0],[0,0,1]]])) --> [[[1, 3, 4], [1.1, 2.2, None], [0, 0.1, 0]], [[1, 0, 0], [0, 1, 0], [0, 0, 1]]] | |
| to_primitive(pd.Series([1,3.141592654,33])) --> [1.0, 3.141592654, 33.0] | |
| to_primitive(pd.DataFrame([[1,2,3], [3,3,3], [1.1,2.2,None]])) --> [[1.0, 2.0, 3.0], [3.0, 3.0, 3.0], [1.1, 2.2, nan]] | |
| """ | |
| val = arg | |
| if isinstance(arg, pd.Series) or isinstance(arg, pd.DataFrame): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """legacy.py - handles legacy National Climatic Data Center data (http://www7.ncdc.noaa.gov/CDO/cdo ) | |
| Chris Coughlin http://github.com/ccoughlin | |
| """ | |
| import pandas as pd | |
| import numpy as np | |
| # NCDC file format specification |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* HelmholtzCoils - demonstrating separation of analysis and toolkit interface in NDIToolbox by creating a | |
| simple magnetic field calculator | |
| Chris Coughlin (TRI/Austin, Inc.) | |
| */ | |
| #include "hhcoils.h" | |
| const double HelmholtzCoils::H(double position) const{ | |
| double lh_geometry_factor = geometry_correction(lhcoil_position,position); | |
| double rh_geometry_factor = geometry_correction(rhcoil_position,position); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| ''' HelmholtzCoils - simple magnetic field calculator (originally used to demo plugin development in NDIToolbox) | |
| Chris Coughlin (TRI/Austin, Inc.) | |
| ''' | |
| import math | |
| class HelmholtzCoils(object): |