Skip to content

Commit

Permalink
update documentation in photoop
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Alan Weaver committed Sep 22, 2015
1 parent e56abf9 commit 09405a1
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 57 deletions.
4 changes: 2 additions & 2 deletions pydl/goddard/astro/airtovac.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def airtovac(air):
Notes
-----
* Formula from Ciddor 1996 Applied Optics , 35, 1566.
* Values of wavelength below 2000 A are not converted.
* Formula from `P. E. Ciddor, Applied Optics, 35, 1566 (1996) <http://adsabs.harvard.edu/abs/1996ApOpt..35.1566C>`_.
* Values of wavelength below 2000 Å are not converted.
"""
from numpy import zeros
try:
Expand Down
5 changes: 2 additions & 3 deletions pydl/goddard/astro/gcirc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def gcirc(ra1,dec1,ra2,dec2,units=2):
Parameters
----------
ra1, dec1, ra2, dec2 : float or array_like
ra1, dec1, ra2, dec2 : :class:`float` or array-like
RA and Dec of two points.
units : { 0, 1, 2 }, optional
* units = 0: everything is already in radians
Expand All @@ -14,7 +14,7 @@ def gcirc(ra1,dec1,ra2,dec2,units=2):
Returns
-------
gcirc : float or array_like
gcirc : :class:`float` or array-like
The angular distance. Units of the value returned depend on the
input value of `units`.
Expand Down Expand Up @@ -51,4 +51,3 @@ def gcirc(ra1,dec1,ra2,dec2,units=2):
return dis
else:
return rad2deg(dis)*3600.0

4 changes: 2 additions & 2 deletions pydl/goddard/astro/get_juldate.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ def get_juldate(seconds=None):
Parameters
----------
seconds : int or float, optional
seconds : :class:`int` or :class:`float`, optional
Time in seconds since the UNIX epoch. This should only be used
for testing.
Returns
-------
get_juldate : float
get_juldate : :class:`float`
The Julian Day number as a floating point number.
Notes
Expand Down
4 changes: 2 additions & 2 deletions pydl/goddard/astro/vactoair.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def vactoair(vacuum):
Notes
-----
* Formula from Ciddor 1996 Applied Optics , 35, 1566.
* Values of wavelength below 2000 A are not converted.
* Formula from `P. E. Ciddor, Applied Optics, 35, 1566 (1996) <http://adsabs.harvard.edu/abs/1996ApOpt..35.1566C>`_.
* Values of wavelength below 2000 Å are not converted.
"""
from numpy import zeros
try:
Expand Down
9 changes: 5 additions & 4 deletions pydl/goddard/math/flegendre.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ def flegendre(x,m):
Parameters
----------
x : array_like
m : int
x : array-like
Compute the Legendre polynomials at these abscissa values.
m : :class:`int`
The number of Legendre polynomials to compute. For example, if
``m = 3``, P_0(x), P_1(x) and P_2(x) will be computed.
:math:`m = 3`, :math:`P_0 (x)`, :math:`P_1 (x)` and :math:`P_2 (x)` will be computed.
Returns
-------
flegendre : array_like
flegendre : :class:`numpy.ndarray`
"""
import numpy as np
from scipy.special import legendre
Expand Down
10 changes: 5 additions & 5 deletions pydl/goddard/misc/cirrange.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ def cirrange(ang,radians=False):
Parameters
----------
ang : float or array_like
ang : :class:`float` or array-like
Angle to convert. If the angle is in radians, the `radians` argument should be set.
radians : bool
If true, the input angle is in radians, and the output will be between
zero and 2*pi.
radians : class:`bool`, optional
If ``True``, the input angle is in radians, and the output will be between
zero and .
Returns
-------
cirrange : float or array_like
cirrange : :class:`float` or array-like
Angle in the restricted range.
Examples
Expand Down
6 changes: 1 addition & 5 deletions pydl/photoop/photoobj/sdss_calibv.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@
def sdss_calibv():
"""Return calibration for velocities from pix/frame to deg/day.
Parameters
----------
None
Returns
-------
sdss_calibv : float
sdss_calibv : :class:`float`
The conversion from pixels per frame to degrees per day
Notes
Expand Down
6 changes: 3 additions & 3 deletions pydl/photoop/photoobj/unwrap_objid.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ def unwrap_objid(objid):
Parameters
----------
objid : numpy.ndarray
objid : :class:`numpy.ndarray`
An array containing 64-bit integers or strings. If strings are passed,
they will be converted to integers internally.
Returns
-------
unwrap_objid : numpy.recarray
unwrap_objid : :class:`numpy.recarray`
A record array with the same length as objid, with the columns
'run', 'camcol', 'frame', 'id', 'rerun', 'skyversion'.
Notes
-----
For historical reasons, the inverse of this function,
pydl.pydlutils.sdss.sdss_objid() is not in the same namespace as this
:func:`~pydl.pydlutils.sdss.sdss_objid` is not in the same namespace as this
function.
'frame' is used instead of 'field' because record arrays have a method
Expand Down
7 changes: 4 additions & 3 deletions pydl/photoop/sdssio/filtername.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@ def filtername(f):
Parameters
----------
f : int
f : :class:`int`
The filter number.
Returns
-------
filtername : str
filtername : :class:`str`
The corresponding filter name.
Examples
--------
>>> filtername(0)
'u'
"""
if isinstance(f,str):
from astropy.extern.six import string_types
if isinstance(f,string_types):
return f
fname = ('u','g','r','i','z')
return fname[f]
4 changes: 2 additions & 2 deletions pydl/photoop/sdssio/filternum.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ def filternum(filt='foo'):
Parameters
----------
filt : str
filt : :class:`str`
The filter name.
Returns
-------
filternum : int
filternum : :class:`int`
The corresponding filter number
Examples
Expand Down
10 changes: 5 additions & 5 deletions pydl/photoop/sdssio/sdss_calib.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ def sdss_calib(run,camcol,field,rerun='',**kwargs):
Parameters
----------
run : int
run : :class:`int`
Photo run number
camcol : int
camcol : :class:`int`
Camcol number
field : int
field : :class:`int`
Field number
rerun : str, optional
rerun : :class:`str`, optional
Photometric reduction number, as a string.
Returns
-------
sdss_calib : dict
sdss_calib : :class:`dict`
A dictionary containing the 'NMGYPERCOUNT' keyword.
Notes
Expand Down
17 changes: 8 additions & 9 deletions pydl/photoop/sdssio/sdss_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,31 @@ def sdss_name(ftype, run, camcol, field, rerun='', thisfilter='r',no_path=False)
Parameters
----------
ftype : str
ftype : :class:`str`
The general type of the file, for example ``'reObj'``
run : int
run : :class:`int`
The run number.
camcol : int
camcol : :class:`int`
The camcol number.
field : int
field : :class:`int`
The field number
rerun : str, optional
rerun : :class:`str`, optional
If necessary, set the rerun name using this argument.
thisfilter : int or str, optional
thisfilter : :class:`int` or :class:`str`, optional
If necessary, set the filter using this argument.
no_path : bool, optional
no_path : :class:`bool`, optional
Normally, sdss_name returns the full path. If `no_path` is ``True``, only
the basename of the file is returned.
Returns
-------
sdss_name : str
sdss_name : :class:`str`
The full file name, normally including the full path.
Raises
------
KeyError
If the file type is unknown.
"""
from os import getenv
from os.path import join
Expand Down
10 changes: 5 additions & 5 deletions pydl/photoop/sdssio/sdss_path.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ def sdss_path(ftype, run, camcol=0, rerun=''):
Parameters
----------
ftype : str
ftype : :class:`str`
The general type of the file, for example ``'reObj'``
run : int
run : :class:`int`
The run number.
camcol : int, optional
camcol : :class:`int`, optional
If necessary, set the camcol number using this argument.
rerun : str, optional
rerun : :class:`str`, optional
If necessary, set the rerun name using this argument.
Returns
-------
sdss_name : str
sdss_name : :class:`str`
The directory in which file `ftype` lives.
Raises
Expand Down
8 changes: 4 additions & 4 deletions pydl/photoop/sdssio/sdssflux2ab.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ def sdssflux2ab(flux,magnitude=False,ivar=False):
Parameters
----------
flux : ndarray
flux : :class:`numpy.ndarray`
Array of calibrated fluxes or SDSS magnitudes with 5 columns,
corresponding to the 5 filters u,g,r,i,z
magnitude : bool, optional
magnitude : :class:`bool`, optional
If set to ``True``, then assume `flux` are SDSS magnitudes instead of linear
flux units
ivar : ndarray, optional
ivar : :class:`numpy.ndarray`, optional
If set, the input fluxes are actually inverse variances.
Returns
-------
sdssflux2ab : ndarray
sdssflux2ab : :class:`numpy.ndarray`
Array of fluxes or magnitudes on the AB system.
Notes
Expand Down
5 changes: 2 additions & 3 deletions pydl/pydlutils/sdss/sdss_flagval.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
from astropy.extern import six

def sdss_flagval(flagname,bitname):
"""Convert bitmask names into values.
Expand Down Expand Up @@ -31,6 +29,7 @@ def sdss_flagval(flagname,bitname):
>>> sdss_flagval('ANCILLARY_TARGET1',['BLAZGX','ELG','BRIGHTGAL']) # doctest: +REMOTE_DATA
2310346608843161600
"""
from astropy.extern.six import string_types
from numpy import uint64
from . import maskbits
if maskbits is None: # pragma: no cover
Expand All @@ -39,7 +38,7 @@ def sdss_flagval(flagname,bitname):
#
# Make sure inlabel is a list
#
if isinstance(bitname,six.string_types):
if isinstance(bitname,string_types):
bitnames = [bitname.upper()]
else:
bitnames = [b.upper() for b in bitname]
Expand Down

0 comments on commit 09405a1

Please sign in to comment.