Source code for irfpy.jdc.fov1
''' JDC fov module (16 azim 4 elev version)
It is not yet clear the exact FOV of JDC.
However, we need some model for it.
Here we assume 90x360 (half-hemisphere) for full view,
with 4x16 bin separations.
This will give you 22.5 degrees resolution.
FWHM of 22.5 deg is also assumed.
'''
import numpy as np
[docs]def elev_pix_center(nel):
r''' Elevation pixel center in degrees.
The JDC has two units. Number definition is
0 as the zenith looking, and 3 as horizontal looking.
The definition of angle, :math:`\theta` is 0 for zenith looking
and 90 is horizontal looking.
.. note::
The numbering definition is opposite from :mod:`irfpy.jdc.fov0`.
Thus, the expression is
.. math::
\theta = 22.5 * nel + 11.25
:param nel: Number of elevation. 0 to 3 (or more in general from -0.5 to 3.5).
:type nel: ``int``, ``float`` or ``np.array``.
:return: The elevation angle in degrees.
:rtype: ``np.array``
Note that the ``nel`` is usually ``int`` or ``np.array`` with
``dtype=np.int``, but ``float`` may also be allowed for special use.
>>> print(elev_pix_center(0))
11.25
>>> print(elev_pix_center(2))
56.25
>>> print(elev_pix_center([-0.5, 3.5]))
[ 0. 90.]
Note also that the returned type is np.array object, even
the given parameter is a scalar. In this case, np.array object
with shape ``()`` is returned.
>>> print(elev_pix_center(3.5).shape)
()
'''
return 11.25 + 22.5 * np.array(nel)
[docs]def elev_pix_fwhm(nel):
''' Return the FWHM
Always 22.5
'''
return 22.5 + np.zeros_like(nel)
[docs]def azim_pix_center(naz):
r''' Return the azimuthal angle for the given channel number(s).
Similar to :meth:`elev_pix_center`, the azimuthal angle,
:math:`\phi` is returned.
.. math::
\phi = naz * 22.5 + 11.25
>>> print(azim_pix_center(0))
11.25
>>> print(azim_pix_center(15))
348.75
>>> print(azim_pix_center([6, 7, 8]))
[146.25 168.75 191.25]
'''
return np.array(naz) * 22.5 + 11.25
[docs]def azim_pix_fwhm(naz):
''' Return the FWHM
For draft, I just return 19.5 for simplicity.
'''
return 22.5 + np.zeros_like(naz)