Skip to main content

A python translation of the Grad2Surf software provided by Harker & O'Leary

Project description

pyGrad2Surf
===========

Software that effectively integrates two vector fields to obtain a scalar field. Example usage can be seen at [cthulhu](https://github.com/cjordan/cthulhu). This repo merely reflects a python translation of the MATLAB code supplied by Harker & O'Leary: [paper](https://arxiv.org/abs/1308.4292) and [code](http://www.mathworks.com/matlabcentral/fileexchange/43149-surface-reconstruction-from-gradient-fields--grad2surf-version-1-0).

Usage
-----
An excerpt from [cthulhu](https://github.com/cjordan/cthulhu):

grid_x, grid_y = np.meshgrid(np.linspace(-self.radius, self.radius, resolution),
np.linspace(-self.radius, self.radius, resolution))
self.grid_dra = np.flipud(np.fliplr(griddata(np.vstack((ra, dec)).T, ra_shifts,
(grid_x, grid_y), method=interp_method, fill_value=0)))
self.grid_ddec = np.flipud(np.fliplr(griddata(np.vstack((ra, dec)).T, dec_shifts,
(grid_x, grid_y), method=interp_method, fill_value=0)))
self.tec = np.flipud(g2s_method(grid_x[0, :], grid_y[:, 0], self.grid_dra, self.grid_ddec))

where ```grid_dra``` and ```grid_ddec``` are generated from griddata from scipy.interpolate. Put simply, the gradient values (```ra_shifts``` and ```dec_shifts```) at the spatial positions (```ra``` and ```dec```) are gridded to form vector fields, which are then integrated by pyGrad2Surf.

Limitations
-----------
A number of g2s methods are detailed by Harker & O'Leary, however, only the basic g2s method is available here. The other methods require some work to translate, thanks to syntactic and functional differences between python and MATLAB. These may or may not be completed in the future, but pull requests are welcome.

Contact
-------
christopherjordan87 -at- gmail.com

Dependencies
------------
- python 2.7.x
- numpy
- scipy


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pyGrad2Surf-0.1.0-py2.py3-none-any.whl (9.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pyGrad2Surf-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pyGrad2Surf-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 13159db4f4a4f41db35e8ffa302f32c247704ef659f9b65577962402c610203b
MD5 f827ca8835dcc12d998f377dfc5065c9
BLAKE2b-256 fc00b29a2eb3ecbcab16f36fd0f24ca31cd8a8920bd48a5a55d57bd9e61d5876

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page