Be notified of new releases
Create your free GitHub account today to subscribe to this repository for new releases and build software alongside 28 million developers.Sign up
New Gravity and Magnetic field classes
- Added gravity classes
- Added magnetic field classes
- Added new fortran subroutine
MakeMagGradGridDH, which is analogous to
- Reorded the arguments of
CilmPlusRhoHDHto be consistent with
- The python routine
MakeMagGridDHnow also outputs the magnetic potential as a grid.
- Addition of the function
pyshtools.utils.figstyle(), that sets several matplotlib parameters for better figures. This function takes as optional parmeters the maximum useable width of a journal page, the relative width of the figure with respect to this value, and the screen resolution in dpi.
- Most plotting routines have optional parameters to set minor tick intervals, grids, label font size, and tick font size.
- Degree symbols are plotted on tick labels for maps.
examples/python/Common/FigStyle.pywas removed from the examples.
- Added the options
vmaxto the plotting methods
SHCoeffs.plot_spectrum2d()in order to specify the limits of the color scale.
- Added the option to plot colorbars on
SHGridplots, along with the option to specify their orientation and a text label.
- All notebooks have been updated.
New constant subpackage
constantsubpackage has been completely rewritten and now makes use of the astropy
Constantclass. This class has attributes
reference. The naming of the constants has changed in some cases for consistency. A few constants that are not necessary were removed. Many of the constants were updated with more recent values.
Constantscan be used in arithmetic operations with either other
Constantsor with objects of the astropy class
- Constants are organized into modules for each of the planets (
Mars), and for convenience, these are all added to the main namespace. The fundamental constants
mu0from the astropy constants package were added (as taken from CODATA 2014).
- Fixed a bug in how the random coeffcients were determined for unnormalized coeffcients in SHCoeffs.
- Optional parameter
SHCoeffs.from_random()to allow for reproducibility.
- One can now specify colat instead of lat for the method SHCoeffs.expand().
__repr__methods to all pyshtools classes.
- Changed the mathematical operators of
SHCoeffssuch that addition and subtraction of a constant only affects the degree 0 term.
- Added the optional parameter
- Fixed a bug in
SHCoeffs.pad()where the attribute
maskwas not similarly padded.
- For mathematical operations with
SHCoeffsgrids, it is now required that the
two class instances have the same
- Clarified the documentation of
SHRotateCoefto point out that this is only valid for intrinsically real functions that are expressed in complex harmonics.
- Added the method
volume()to the class SHCoeffs, that calculates the volume of the object.
- Added the attributes
SHWindow, which provides the area of the concentration domain and the shannon number.
- Removed python installation support from Makefile: use pip instead.
M. A. Wieczorek, M. Meschede, E. Sales de Andrade, I. Oshchepkov, B. Xu, and A. Walker (2018). SHTOOLS: Version 4.3, Zenodo, doi:10.5281/zenodo.1345510
- Full support added for the use of unnormalized harmonics in the classes
SHGrid. To make use of this normalization, just specify
- Added a new python native routine
mag_spectrum()in the subpackage
gravmagthat replaces the original fortran wrapped routines. The old python wrapped functions have been removed from pyshtools. This new routine is nearly the same as
spectrum(), and further allows one to compute the spectrum of the potential or magnetic intensity.
- The old fortran based
SHReadfunction has been replaced with a python native version
shread(). The functionality is nearly identical as before, and combines the previous routines
SHReadHinto one. Differences include: (1) It is no longer necessary to specify the lmax of the file: This is determined automatically by reading the file from the end, (2) both real and complex coefficients are supported, (3) a header line can be output, but it is a simple list of type str that will need to be converted to the correct format by the user, and (4) "comment" lines are read and ignored: A valid line is one where there are 4 or more words, and where the first two words are integers.
- A new python native function
convert()was added in the subpackage
shiothat converts between arrays of spherical harmonic coefficients with different normalizations. The class
SHCoeffswas then simplified by using this external function for all conversions involving
- The optional parameter lmax was added to
- When plotting grids from the class
SHGrid, one can now specify the label to use for the x and y axes with
ylabel, as well as the interval to use when plotting ticks on both axes using
- The pyshtools rotation routines now allow you to specify the optional parameter
conventionto treat Euler angles in either the
yconventions (i.e., which axes to use for the second rotation). Furthermore, the optional argument
bodyallows you to specify if you want to rotate the body (True), or coordinate system (False, default). The tutorial number 3 was updated to clear up some inconsistencies in how the angles were defined.
- New optional parameters added to
ylimfor the limits when plotting spectra,
maxcolumnsfor the number of columns to use when plotting several windows, and
lmaxwhich controls the grid spacing when plotting the windows.
- Added the optional argument
SHCoeffs.from_random()that allows you to create coefficients with maximum bandwidths that are either greater or less than the bandwidth of the input power spectrum.
- Added a warning message when using
SHCoeffs.rotate()with degrees greater than 1200, as the routine is not accurate beyond this value.
- Added an optional argument
SHWindow.plot_windows()to control whether the legend is plotted or not.
- Fixed a minor bug in ClassExample.py file concerning the use of
- Added support for plotting to an already existing figure by allowing the user to specify an existing matplotlib axes.
- Removed some non-standard ascii dashes in the documentation files, and forced all doc files to be opened as
- HTML documentation was completely redone using Jekyll. The markdown source files are now located in
pages/mydoc. A static html web site is built using
jekyll, whose files are located in
doc. Github will automatically create the static pages and serve them on shtools.github.io/SHTOOLS. To build the static pages yourself, it is only necessary to execute
bundle exec jekyll buildin the directory
doc, which will build the site into
_sitein the same directory. Alternatively,
make wwwin the main directory will create a static site in the top-level directory
wwwthat could be used to deploy on a different web server. The site is based on the template Jekyll documentation theme by @tomjoht.
M. A. Wieczorek, M. Meschede, E. Sales de Andrade, I. Oshchepkov, B. Xu, and A. Walker (2018). SHTOOLS: Version 4.2, Zenodo, doi:10.5281/zenodo.1250054
This version adds improved functionality to SHTOOLS and fixes a couple of minor bugs. In addition, this release will be the first where pre-built wheels for unix/macOS/windows will be distributed via PYPI.
- Added an optional argument
- Coefficients are zero-padded when
lmaxis greater than the maximum degree in
- The method
pad()was added to the
SHCoeffsclass that zero pads or truncates the coefficients to a different
- Fixed the method
SHCoeffs.from_file()such that the maximum spherical harmonic degree of the class is the maximum spherical harmonic degree of the coeffs (and not
- Fixed formatting issues with error messages in
- Removed print statements from the fortran code in
BAtoHilmRohHthat served no purpose.
- Fixed a bug in the argument order of the python wrappers of
- Fixed the makefile to remove the
distdirectory during clean.
- Fixed a bug in the python routine
cross_spectrum(), where the numpy arange function was incorrectly called.
- Fixed the
SHWindowplotting methods to work when the number of rows is equal to 1.
- Conditional tests in the routine
Wigner3jwere reordered to avoid a division by zero.
- Numpy's auto-configuration is now used to detect the LAPACK libraries.
- Many minor updates to the python documentation and unix man pages.
M. A. Wieczorek, M. Meschede, E. Sales de Andrade, I. Oshchepkov, B. Xu, and A. Walker (2017). SHTOOLS: Version 4.1, Zenodo, doi:10.5281/zenodo.1067108
This is a major update that fixes bugs, adds new functionality, and improves Python error handing. All users are requested to upgrade to 4.0.
- Instead of executing a Fortran STOP, which kills the Python kernel, the Fortran subroutines now return an
exitstatusthat allows Python to raise an exception. This technique does not work with the few Fortran functions that pyshtools calls, but these functions are relatively benign, and will soon be phased out for Python native functions.
- The Fortran
powerspectrumroutines have been removed from pyshtools, and have been replaced with Python native routines
cross_spectrum. The Python routines allow to specify the normalization, whether the output should be power, energy or l2norm, and whether the spectrum is per degree, per coefficient, or per log bandwidth.
- The method
plot_spectrum2d()was added to the class
SHCoeffsto plot the power as a function of degree and order.
- All pyshtools modules have been converted into proper Python subpackages. The subpackage
localizedpsectralanalysishas been merged into
spectralanalysis, and the subpackage
otherhas been renamed
- The Python class method
SHCoeffs.expand()now can evaluate the function either on an SHGrid or for a list of latitude and longitude points. As part of this change, a new fortran function
MakeGridPointCwas created for complex coefficients.
- The majority of the methods for the classes
SHWindowhave been rename for consistency (see documentation!). Also, the classes now give the option of reading or saving to files as numpy arrays.
- Added new Python function
read_icgen_gfcfor reading ICGEM-format gravity coefficient files.
- The operator
powwas added to the class
- All methods in the pyshtools classes now return copies by default, which can be modified by the optional argument
potas a mandatory return argument for the Python routine
- Several minor modifications and bug fixes were made to the makefiles to improve compatibility and to allow the use of make -j.
- The routines
other.PreGLQwere removed from pyshtools, as these can be found in other scipy packages.
- The SHTOOLS routine
DHajwas added to the pyshtools subpackage
- Python docstrings have been streamlined and standardized.
- ...plus, many minor changes and optimizations...
M. A. Wieczorek, M. Meschede, I. Oshchepkov, E. Sales de Andrade, and heroxbd (2016). SHTOOLS: Version 4.0. Zenodo. doi:10.5281/zenodo.206114
This release adds missing functionality to the SHGrids, SHCoeffs, and SHWindow classes, and adds support for PyPI.
- Add pyshtools to PyPI repository. Can now be installed using
pip install pyshtools.
- Add new function
SHBiasKMaskwhich is the arbitrary window counterpart to the spherical cap window
SHWindowsfor arbitrary windows.
copy()method to all classes, which returns a deep copy of the instance.
__pow__operators for two sets of coefficient or grid classes, or one coefficient or grid class and a scalar.
nwinrotoption when rotating spherical cap windows in
SHWindowthat will rotate only the first
- Add degrees option to
- Add the constructor
from_file()to initialize an
SHGridwith a numpy formatted data file. Add option to read coeffs and grids from a numpy formatted binary file. Add
tofile()methods to output raw grid and coefficient data as either text or binary formatted files.
- Update Intro 1 notebook and add example to Intro notebook 2 showing how to use arbitrary localization windows.
- Convert notebooks to html and add links to web documentation.
- Add option
SHCoeffs.from_random()method to generate random coefficients that fit exactly the expected power spectrum.
- Add Earth topography coefficients referenced to mean sea level to the example files, expanded to degree 300:
M. A. Wieczorek, M. Meschede, I. Oshchepkov, E. Sales de Andrade (2016). SHTOOLS: Version 3.4. Zenodo. doi:10.5281/zenodo.61180
This is a major upgrade to SHTOOLS. Full support for Python 3 has been added, a
setup.py file has been added for easy installation, Python notebook tutorials have been created, and full support for three major Python classes has been provided (
SHWindow). One bug in the Fortran code has been fixed, as well as several minor issues with the Python wrapper functions.
- Added full support for Python 3.
- Fixed a critical, but rare, bug in
MakeGravGradGridDH. In these routines, the rows of the output grid are calculated by inverse Fourier transmforming a vector that depends upon the spherical harmonic coefficients. This vector, when using the complex-to-real FFTW routines, includes one element that corresponds to the coefficients with
m=lmax+1. This element of the array was not properly initialized to zero in the Fortran code, and if the Fortran compiler did not explicitly zero all new arrays, this could have resulted in incorrect output. Given that this term is 1 index above the Nyquist frequency (
m=lmax), if this element were not zero, each column of the grid would contain a component that oscillates from -1 to +1 (scaled by the magnitude of the element). Even when this element was not initialized, a subsequent spherical harmonic expansion of the grid would usually give correct results.
- Added a
setup.pyfile for easy installation.
- Makefiles were extensively modified to simplify the Fortran and Python builds:
make all3were removed and replaced by flags that make use of the precompiler to resolve underscore problems; make install now places compiled module files in /usr/local/includes.
- Makefiles were improved to minimize problems when installing both fortran and fortran-mp components. When making the latter, all object and module files in the directory
srcare first deleted.
- The namespace of pyshtools was reorganized to list the routines by submodule name. A list of all routines is given in the submodule shtools.
- Add full support for the Python classes
- Added an
info()method to shtools constants that prints an info string.
- Changed the Python wrapper so that the output arrays in the SHExpand routines correspond to the optional input variable
lmax_calc. Modified the dimensions by 1 for the output power spectrum in the wrapper functions for
- Changed the primary input parameter of
SHMTCouplingMatrixto be a matrix of power spectra of the localization windows instead of a matrix of spherical-harmonic coefficients of spherical-cap localization windows. Furthermore, the output dimensions of the matrix have been switched.
- Added two fortran routines for performing multitaper spectral analyses when using windows generated from a mask,
- Minor modifications to the Python example scripts.
- Minor bug fix to the scripts that create the unix man documentation.
- Added Python notebook tutorials.
- Created an SHTOOLS development fund, funded by bitcoin donations.
Mark Wieczorek et al. (2016). SHTOOLS: Version 3.3. Zenodo. doi:10.5281/zenodo.60010
Version 3.2 release notes
This release contains the following improvements:
- Added the optional argument
Curve2Maskthat accounts for cases where the curve makes a complete circle in longitude about the planet.
- Fixed in bug in the python implementation where the outputs
- Added OpenMP support. When compiling with
make fortran2-mp, or
make fortran3-mp, saved variables in the subroutines are defined as being
- Optimized performance of the routines
- Minor documentation fixes.
Mark Wieczorek et al.. (2016). SHTOOLS: Version 3.2. Zenodo. doi:10.5281/zenodo.55790