Skip to content

Units

This module contains functions for converting between different units.

rad2arcsec

Converts the inputs values from radians to arcseconds.

Parameters:

Name Type Description Default
values (Array, radians)

The input values in units of radians to be converted into arcseconds.

required

Returns:

Name Type Description
values (Array, arcseconds)

The input values converted into arcseconds.

Source code in src/dLux/utils/units.py
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def rad2arcsec(values: Array) -> Array:
    """
    Converts the inputs values from radians to arcseconds.

    Parameters
    ----------
    values : Array, radians
        The input values in units of radians to be converted into arcseconds.

    Returns
    -------
    values : Array, arcseconds
        The input values converted into arcseconds.
    """
    return values * 3600 * 180 / np.pi
rad2deg

Converts the inputs values from radians to degrees.

Parameters:

Name Type Description Default
values (Array, radians)

The input values in units of radians to be converted into degrees.

required

Returns:

Name Type Description
values (Array, degrees)

The input values converted into degrees.

Source code in src/dLux/utils/units.py
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
def rad2deg(values: Array) -> Array:
    """
    Converts the inputs values from radians to degrees.

    Parameters
    ----------
    values : Array, radians
        The input values in units of radians to be converted into degrees.

    Returns
    -------
    values : Array, degrees
        The input values converted into degrees.
    """
    return values * 180 / np.pi
rad2arcmin

Converts the inputs values from radians to arcminutes.

Parameters:

Name Type Description Default
values (Array, radians)

The input values in units of radians to be converted into arcminutes.

required

Returns:

Name Type Description
values (Array, arcminutes)

The input values converted into arcminutes.

Source code in src/dLux/utils/units.py
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
def rad2arcmin(values: Array) -> Array:
    """
    Converts the inputs values from radians to arcminutes.

    Parameters
    ----------
    values : Array, radians
        The input values in units of radians to be converted into arcminutes.

    Returns
    -------
    values : Array, arcminutes
        The input values converted into arcminutes.
    """
    return values * 60 * 180 / np.pi
deg2rad

Converts the inputs values from degrees to radians.

Parameters:

Name Type Description Default
values (Array, degrees)

The input values in units of degrees to be converted into radians.

required

Returns:

Name Type Description
values (Array, radians)

The input values converted into radians.

Source code in src/dLux/utils/units.py
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
def deg2rad(values: Array) -> Array:
    """
    Converts the inputs values from degrees to radians.

    Parameters
    ----------
    values : Array, degrees
        The input values in units of degrees to be converted into radians.

    Returns
    -------
    values : Array, radians
        The input values converted into radians.
    """
    return values * np.pi / 180
deg2arcmin

Converts the inputs values from degrees to arcminutes.

Parameters:

Name Type Description Default
values (Array, degrees)

The input values in units of degrees to be converted into arcminutes.

required

Returns:

Name Type Description
values (Array, arcminutes)

The input values converted into arcminutes.

Source code in src/dLux/utils/units.py
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
def deg2arcmin(values: Array) -> Array:
    """
    Converts the inputs values from degrees to arcminutes.

    Parameters
    ----------
    values : Array, degrees
        The input values in units of degrees to be converted into arcminutes.

    Returns
    -------
    values : Array, arcminutes
        The input values converted into arcminutes.
    """
    return values * 60
deg2arcsec

Converts the inputs values from degrees to arcseconds.

Parameters:

Name Type Description Default
values (Array, degrees)

The input values in units of degrees to be converted into arcseconds.

required

Returns:

Name Type Description
values (Array, arcseconds)

The input values converted into arcseconds.

Source code in src/dLux/utils/units.py
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
def deg2arcsec(values: Array) -> Array:
    """
    Converts the inputs values from degrees to arcseconds.

    Parameters
    ----------
    values : Array, degrees
        The input values in units of degrees to be converted into arcseconds.

    Returns
    -------
    values : Array, arcseconds
        The input values converted into arcseconds.
    """
    return values * 3600
arcmin2rad

Converts the inputs values from arcminutes to radians.

Parameters:

Name Type Description Default
values (Array, arcminutes)

The input values in units of arcminutes to be converted into radians.

required

Returns:

Name Type Description
values (Array, radians)

The input values converted into radians.

Source code in src/dLux/utils/units.py
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
def arcmin2rad(values: Array) -> Array:
    """
    Converts the inputs values from arcminutes to radians.

    Parameters
    ----------
    values : Array, arcminutes
        The input values in units of arcminutes to be converted into radians.

    Returns
    -------
    values : Array, radians
        The input values converted into radians.
    """
    return values * np.pi / (60 * 180)
arcmin2deg

Converts the inputs values from arcminutes to degrees.

Parameters:

Name Type Description Default
values (Array, arcminutes)

The input values in units of arcminutes to be converted into degrees.

required

Returns:

Name Type Description
values (Array, degrees)

The input values converted into degrees.

Source code in src/dLux/utils/units.py
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
def arcmin2deg(values: Array) -> Array:
    """
    Converts the inputs values from arcminutes to degrees.

    Parameters
    ----------
    values : Array, arcminutes
        The input values in units of arcminutes to be converted into degrees.

    Returns
    -------
    values : Array, degrees
        The input values converted into degrees.
    """
    return values / 60
arcmin2arcsec

Converts the inputs values from arcminutes to arcseconds.

Parameters:

Name Type Description Default
values (Array, arcminutes)

The input values in units of arcminutes to be converted into arcseconds.

required

Returns:

Name Type Description
values (Array, arcseconds)

The input values converted into arcseconds.

Source code in src/dLux/utils/units.py
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
def arcmin2arcsec(values: Array) -> Array:
    """
    Converts the inputs values from arcminutes to arcseconds.

    Parameters
    ----------
    values : Array, arcminutes
        The input values in units of arcminutes to be converted into
        arcseconds.

    Returns
    -------
    values : Array, arcseconds
        The input values converted into arcseconds.
    """
    return values * 60
arcsec2rad

Converts the inputs values from arcseconds to radians.

Parameters:

Name Type Description Default
values (Array, arcseconds)

The input values in units of arcseconds to be converted into radians.

required

Returns:

Name Type Description
values (Array, radians)

The input values converted into radians.

Source code in src/dLux/utils/units.py
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
def arcsec2rad(values: Array) -> Array:
    """
    Converts the inputs values from arcseconds to radians.

    Parameters
    ----------
    values : Array, arcseconds
        The input values in units of arcseconds to be converted into radians.

    Returns
    -------
    values : Array, radians
        The input values converted into radians.
    """
    return values * np.pi / (3600 * 180)
arcsec2deg

Converts the inputs values from arcseconds to degrees.

Parameters:

Name Type Description Default
values (Array, arcseconds)

The input values in units of arcseconds to be converted into degrees.

required

Returns:

Name Type Description
values (Array, degrees)

The input values converted into degrees.

Source code in src/dLux/utils/units.py
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
def arcsec2deg(values: Array) -> Array:
    """
    Converts the inputs values from arcseconds to degrees.

    Parameters
    ----------
    values : Array, arcseconds
        The input values in units of arcseconds to be converted into degrees.

    Returns
    -------
    values : Array, degrees
        The input values converted into degrees.
    """
    return values / 3600
arcsec2arcmin

Converts the inputs values from arcseconds to arcminutes.

Parameters:

Name Type Description Default
values (Array, arcseconds)

The input values in units of arcseconds to be converted into arcminutes.

required

Returns:

Name Type Description
values (Array, arcminutes)

The input values converted into arcminutes.

Source code in src/dLux/utils/units.py
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
def arcsec2arcmin(values: Array) -> Array:
    """
    Converts the inputs values from arcseconds to arcminutes.

    Parameters
    ----------
    values : Array, arcseconds
        The input values in units of arcseconds to be converted into
        arcminutes.

    Returns
    -------
    values : Array, arcminutes
        The input values converted into arcminutes.
    """
    return values / 60