Skip to content

Commit

Permalink
add lots of cross-references
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Alan Weaver committed Sep 22, 2015
1 parent 60965a2 commit 9c19b4e
Show file tree
Hide file tree
Showing 37 changed files with 229 additions and 181 deletions.
1 change: 1 addition & 0 deletions docs/pydl/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pydl Changelog
* Removed some code that is 100% redundant with astropy (*e.g.* ``angles_to_xyz()``).
* Fixed bug in :func:`~pydl.pydlutils.mangle.set_use_caps` that was discovered on the IDL side.
* Updated documentation of :func:`~pydl.pydlutils.mangle.read_fits_polygons`.
* Added cross-references to classes, functions, etc.

0.3.0 (2015-02-20)
------------------
Expand Down
3 changes: 3 additions & 0 deletions docs/pydl/pydlutils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ API
.. automodapi:: pydl.pydlutils.mangle
:no-inheritance-diagram:

.. automodapi:: pydl.pydlutils.math
:no-inheritance-diagram:

.. automodapi:: pydl.pydlutils.misc
:no-inheritance-diagram:

Expand Down
6 changes: 3 additions & 3 deletions pydl/file_lines.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ def file_lines(path,compress=False):
Parameters
----------
path : str or list of str
path : :class:`str` or :class:`list` of :class:`str`
Path to a file. Can be a list of paths.
compress : bool, optional
compress : :class:`bool`, optional
If set to ``True``, assumes that all files in `path` are GZIP compressed.
Returns
-------
file_lines : int or list of int
file_lines : :class:`int` or :class:`list` of :class:`int`
The number of lines in `path`. Returns a list of lengths if a list of
files is supplied.
Expand Down
6 changes: 3 additions & 3 deletions pydl/pcomp.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ class pcomp(object):
Parameters
----------
x : array_like
x : array-like
A 2-D array with N rows and M columns.
standardize : bool, optional
standardize : :class:`bool`, optional
If set to ``True``, the input data will have its mean subtracted off
and will be scaled to unit variance.
covariance : bool, optional.
covariance : :class:`bool`, optional.
If set to ``True``, the covariance matrix of the data will be used for
the computation. Otherwise the correlation matrix will be used.
Expand Down
75 changes: 47 additions & 28 deletions pydl/pydlutils/bspline/bspline.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,39 @@ class bspline(object):
Parameters
----------
x
nord
npoly
bkpt
bkspread
verbose
x : :class:`numpy.ndarray`
The data.
nord : :class:`int`, optional
To be documented.
npoly : :class:`int`, optional
To be documented.
bkpt : :class:`numpy.ndarray`, optional
To be documented.
bkspread : :class:`float`, optional
To be documented.
verbose : :class:`bool`, optional.
If ``True`` print extra information.
Attributes
----------
breakpoints
To be documented.
nord
To be documented.
npoly
To be documented.
mask
To be documented.
coeff
To be documented.
icoeff
To be documented.
xmin
To be documented.
xmax
To be documented.
funcname
To be documented.
"""
def __init__(self,x,nord=4,npoly=1,bkpt=None,bkspread=1.0,verbose=False,**kwargs):
"""Init creates an object whose attributes are similar to the
Expand Down Expand Up @@ -118,18 +133,18 @@ def fit(self,xdata,ydata,invvar,x2=None):
Parameters
----------
xdata : ndarray
xdata : :class:`numpy.ndarray`
Independent variable.
ydata : ndarray
ydata : :class:`numpy.ndarray`
Dependent variable.
invvar : ndarray
invvar : :class:`numpy.ndarray`
Inverse variance of `ydata`.
x2 : ndarray, optional
x2 : :class:`numpy.ndarray`, optional
Orthogonal dependent variable for 2d fits.
Returns
-------
fit : tuple
fit : :func:`tuple`
A tuple containing an integer error code, and the evaluation of the
b-spline at the input values. An error code of -2 is a failure,
-1 indicates dropped breakpoints, 0 is success, and positive
Expand Down Expand Up @@ -196,14 +211,14 @@ def action(self,x,x2=None):
Parameters
----------
x : ndarray
x : :class:`numpy.ndarray`
Independent variable.
x2 : ndarray, optional
x2 : :class:`numpy.ndarray`, optional
Orthogonal dependent variable for 2d fits.
Returns
-------
action : tuple
action : :func:`tuple`
A tuple containing the b-spline action matrix; the 'lower' parameter,
a list of pixel positions, each corresponding to the first
occurence of position greater than breakpoint indx; and 'upper',
Expand Down Expand Up @@ -265,12 +280,12 @@ def intrv(self,x):
Parameters
----------
x : ndarray
x : :class:`numpy.ndarray`
Data values, assumed to be monotonically increasing.
Returns
-------
intrv : ndarray
intrv : :class:`numpy.ndarray`
Position of array elements with respect to breakpoints.
"""
gb = self.breakpoints[self.mask]
Expand All @@ -286,15 +301,19 @@ def intrv(self,x):
#
#
def bsplvn(self,x,ileft):
"""
"""To be documented.
Parameters
----------
x
ileft
x : :class:`numpy.ndarray`
To be documented.
ileft : :class:`int`
To be documented
Returns
-------
bsplvn
bsplvn : :class:`numpy.ndarray`
To be documented.
"""
bkpt = self.breakpoints[self.mask]
vnikx = np.zeros((x.size,self.nord),dtype=x.dtype)
Expand Down Expand Up @@ -323,22 +342,22 @@ def value(self,x,x2=None,action=None,lower=None,upper=None):
Parameters
----------
x : ndarray
x : :class:`numpy.ndarray`
Independent variable.
x2 : ndarray, optional
x2 : :class:`numpy.ndarray`, optional
Orthogonal dependent variable for 2d fits.
action : ndarray, optional
action : :class:`numpy.ndarray`, optional
Action matrix to use. If not supplied it is calculated.
lower : ndarray, optional
lower : :class:`numpy.ndarray`, optional
If the action parameter is supplied, this parameter must also
be supplied.
upper : ndarray, optional
upper : :class:`numpy.ndarray`, optional
If the action parameter is supplied, this parameter must also
be supplied.
Returns
-------
value : tuple
value : :func:`tuple`
A tuple containing the results of the bspline evaluation and a
mask indicating where the evaluation was good.
"""
Expand Down Expand Up @@ -392,12 +411,12 @@ def maskpoints(self,err):
Parameters
----------
err : ndarray
err : :class:`numpy.ndarray`
The list of indexes returned by the cholesky routines.
Returns
-------
maskpoints : int
maskpoints : :class:`int`
An integer indicating the results of the masking. -1 indicates
that the error points were successfully masked. -2 indicates
failure; the calculation should be aborted.
Expand Down
8 changes: 4 additions & 4 deletions pydl/pydlutils/bspline/cholesky_band.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ def cholesky_band(l,mininf=0.0,verbose=False):
Parameters
----------
l : ndarray
l : :class:`numpy.ndarray`
A matrix on which to perform the Cholesky decomposition.
mininf : float, optional
mininf : :class:`float`, optional
Entries in the `l` matrix are considered negative if they are less
than this value (default 0.0).
verbose : bool, optional
verbose : :class:`bool`, optional
If set to ``True``, print some debugging information.
Returns
-------
cholesky_band : tuple
cholesky_band : :func:`tuple`
If problems were detected, the first item will be the index or
indexes where the problem was detected, and the second item will simply
be the input matrix. If no problems were detected, the first item
Expand Down
10 changes: 5 additions & 5 deletions pydl/pydlutils/bspline/cholesky_solve.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ def cholesky_solve(a,bb):
Parameters
----------
a : ndarray
A in Ax=b.
bb : ndarray
b in Ax=b
a : :class:`numpy.ndarray`
:math:`A` in :math:`A x = b`.
bb : :class:`numpy.ndarray`
:math:`b` in :math:`A x = b`.
Returns
-------
cholesky_solve : tuple
cholesky_solve : :func:`tuple`
A tuple containing the status and the result of the solution. The
status is always -1.
"""
Expand Down
16 changes: 8 additions & 8 deletions pydl/pydlutils/bspline/iterfit.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@ def iterfit(xdata,ydata,invvar=None,upper=5,lower=5,x2=None,maxiter=10,**kwargs)
Parameters
----------
xdata : ndarray
xdata : :class:`numpy.ndarray`
Independent variable.
ydata : ndarray
ydata : :class:`numpy.ndarray`
Dependent variable.
invvar : ndarray
invvar : :class:`numpy.ndarray`
Inverse variance of `ydata`. If not set, it will be calculated based
on the standard deviation.
upper : int or float
upper : :class:`int` or :class:`float`
Upper rejection threshold in units of sigma, defaults to 5 sigma.
lower : int or float
lower : :class:`int` or :class:`float`
Lower rejection threshold in units of sigma, defaults to 5 sigma.
x2 : ndarray, optional
x2 : :class:`numpy.ndarray`, optional
Orthogonal dependent variable for 2d fits.
maxiter : int, optional
maxiter : :class:`int`, optional
Maximum number of rejection iterations, default 10. Set this to
zero to disable rejection.
Returns
-------
iterfit : tuple
iterfit : :func:`tuple`
A tuple containing the fitted bspline object and an output mask.
"""
import numpy as np
Expand Down
4 changes: 2 additions & 2 deletions pydl/pydlutils/cooling/read_ds_cooling.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ def read_ds_cooling(fname,logT=None):
----------
fname : { 'm-00.cie', 'm-05.cie', 'm+05.cie', 'm-10.cie', 'm-15.cie', 'm-20.cie', 'm-30.cie', 'mzero.cie' }
Name of the data file to read.
logT : ndarray, optional
logT : :class:`numpy.ndarray`, optional
If provided, values will be interpolated to the provided values. If
not provided, the values in the data files will be returned.
Returns
-------
read_ds_cooling : tuple
read_ds_cooling : :func:`tuple`
A tuple containing `logT` and `loglambda`, respectively.
Raises
Expand Down
4 changes: 2 additions & 2 deletions pydl/pydlutils/coord/SDSSMuNu.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ class SDSSMuNu(BaseCoordinateFrame):
Parameters
----------
mu : Angle
mu : :class:`~astropy.coordinates.Angle`
Angle corresponding to longitude measured along a stripe.
nu : Angle
nu : :class:`~astropy.coordinates.Angle`
Angle corresponding to latitude measured perpendicular to a stripe.
Notes
Expand Down
10 changes: 10 additions & 0 deletions pydl/pydlutils/coord/munu_to_radec.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@
@frame_transform_graph.transform(FunctionTransform, SDSSMuNu, ICRS)
def munu_to_radec(munu,icrs_frame):
"""Convert from SDSS great circle coordinates to equatorial coordinates.
Parameters
----------
munu : :class:`~pydl.pydlutils.coord.SDSSMuNu`
SDSS great circle coordinates (mu, nu).
Returns
-------
munu_to_radec : :class:`~astropy.coordinates.ICRS`
Equatorial coordinates (RA, Dec).
"""
from astropy import units as u
import numpy as np
Expand Down
10 changes: 10 additions & 0 deletions pydl/pydlutils/coord/radec_to_munu.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@
@frame_transform_graph.transform(FunctionTransform, ICRS, SDSSMuNu)
def radec_to_munu(icrs_frame,munu):
"""Convert from equatorial coordinates to SDSS great circle coordinates.
Parameters
----------
icrs_frame : :class:`~astropy.coordinates.ICRS`
Equatorial coordinates (RA, Dec).
Returns
-------
radec_to_munu : :class:`~pydl.pydlutils.coord.SDSSMuNu`
SDSS great circle coordinates (mu, nu).
"""
from astropy import units as u
import numpy as np
Expand Down
4 changes: 2 additions & 2 deletions pydl/pydlutils/coord/stripe_to_eta.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ def stripe_to_eta(stripe):
Parameters
----------
stripe : int or numpy.ndarray
stripe : :class:`int` or :class:`numpy.ndarray`
SDSS Stripe number.
Returns
-------
stripe_to_eta : float or numpy.ndarray
stripe_to_eta : :class:`float` or :class:`numpy.ndarray`
The eta value in the SDSS (lambda,eta) coordinate system.
"""
stripe_sep = 2.5
Expand Down
4 changes: 2 additions & 2 deletions pydl/pydlutils/coord/stripe_to_incl.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ def stripe_to_incl(stripe):
Parameters
----------
stripe : int or numpy.ndarray
stripe : :class:`int` or :class:`numpy.ndarray`
SDSS Stripe number.
Returns
-------
stripe_to_incl : float or numpy.ndarray
stripe_to_incl : :class:`float` or :class:`numpy.ndarray`
Inclination of the stripe relative to the equator (Dec = 0).
"""
from . import stripe_to_eta
Expand Down
Loading

0 comments on commit 9c19b4e

Please sign in to comment.