Skip to content

Commit

Permalink
Merge pull request #1733 from rlwastro/rlwastro-first
Browse files Browse the repository at this point in the history
Add FIRST survey images
  • Loading branch information
bsipocz authored Jun 18, 2020
2 parents 483fcc5 + 9e6aced commit 25cf360
Show file tree
Hide file tree
Showing 13 changed files with 303 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ noirlab

- Module added to access the NOIRLab (formally NOAO) archive. [#1638]

first
^^^^^

- Module added to access FIRST survey radio images. [#1733]


Service fixes and enhancements
------------------------------
Expand Down
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ The following modules have been completed using a common API:
* `CADC <https://astroquery.readthedocs.io/en/latest/cadc/cadc.html>`_: Canadian Astronomy Data Centre.
* `ESASky <http://astroquery.readthedocs.io/en/latest/esasky/esasky.html>`_: ESASky is a science driven discovery portal providing easy visualizations and full access to the entire sky as observed with ESA Space astronomy missions.
* `ESO Archive <http://astroquery.readthedocs.io/en/latest/eso/eso.html>`_
* `FIRST <http://astroquery.readthedocs.io/en/latest/image_cutouts/first/first.html>`_: Faint Images of the Radio Sky at Twenty-cm. 20-cm radio images of the extragalactic sky from the VLA.
* `Gaia <http://astroquery.readthedocs.io/en/latest/gaia/gaia.html>`_: European Space Agency Gaia Archive.
* `ESA XMM <https://astroquery.readthedocs.io/en/latest/esa/xmm_newton.html>`_: European Space Agency XMM-Newton Science Archive.
* `ESA Hubble <https://astroquery.readthedocs.io/en/latest/esa/hubble.html>`_: European Space Agency Hubble Science Archive.
Expand Down
Empty file.
33 changes: 33 additions & 0 deletions astroquery/image_cutouts/first/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
FIRST Image Query Tool
----------------------
.. topic:: Revision History
:Originally contributed by:
Rick White ([email protected])
"""
from astropy import config as _config


class Conf(_config.ConfigNamespace):
"""
Configuration parameters for `astroquery.image_cutouts.first`.
"""
server = _config.ConfigItem(
['https://third.ucllnl.org/cgi-bin/firstcutout'],
'Name of the FIRST server.')
timeout = _config.ConfigItem(
60,
'Time limit for connecting to FIRST server.')


conf = Conf()

from .core import First, FirstClass

__all__ = ['First', 'FirstClass',
'Conf', 'conf',
]
95 changes: 95 additions & 0 deletions astroquery/image_cutouts/first/core.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from io import BytesIO
import astropy.units as u
import astropy.coordinates as coord
from astropy.io import fits
from ...query import BaseQuery
from ...utils import commons, prepend_docstr_nosections
from . import conf
from ...exceptions import InvalidQueryError

__all__ = ['First', 'FirstClass']


class FirstClass(BaseQuery):
URL = conf.server
TIMEOUT = conf.timeout
maximsize = 1024

def _args_to_payload(self, coordinates, image_size=1 * u.arcmin,
maximsize=None):
"""
Fetches image cutouts from FIRST survey.
Parameters
----------
coordinates : str or `astropy.coordinates` object
The target around which to search. It may be specified as a
string in which case it is resolved using online services or as
the appropriate `astropy.coordinates` object. ICRS coordinates
may also be entered as strings as specified in the
`astropy.coordinates` module.
image_size : str or `~astropy.units.Quantity` object, optional
The string must be parsable by `astropy.coordinates.Angle`. The
appropriate `~astropy.units.Quantity` object from `astropy.units`
may also be used. Specifies the symmetric size of the
image. Defaults to 1 arcmin.
maximsize : int, optional
Specify the maximum image size (in pixels on each dimension) that
will be returned. Max is 2048.
"""
request_payload = {}
c = commons.parse_coordinates(coordinates).transform_to('icrs')
ra_dec_str = str(c.ra.hour) + ' ' + str(c.dec.degree)
request_payload["RA"] = ra_dec_str
request_payload["Equinox"] = "J2000"
request_payload["ImageSize"] = coord.Angle(image_size).arcmin
request_payload["ImageType"] = "FITS File"
request_payload["MaxImSize"] = self.maximsize if maximsize is None else maximsize
return request_payload

@prepend_docstr_nosections("\n" + _args_to_payload.__doc__)
def get_images(self, coordinates, image_size=1 * u.arcmin,
get_query_payload=False):
"""
get_query_payload : bool, optional
if set to `True` then returns the dictionary sent as the HTTP
request. Defaults to `False`
Returns
-------
A list of `~astropy.io.fits.HDUList` objects
"""
response = self.get_images_async(coordinates, image_size=image_size,
get_query_payload=get_query_payload)
if get_query_payload:
return response
S = BytesIO(response.content)
try:
return fits.open(S, ignore_missing_end=True)
except IOError:
raise InvalidQueryError(response.content)

@prepend_docstr_nosections("\n" + _args_to_payload.__doc__)
def get_images_async(self, coordinates, image_size=1 * u.arcmin,
get_query_payload=False):
"""
get_query_payload : bool, optional
if set to `True` then returns the dictionary sent as the HTTP
request. Defaults to `False`
Returns
-------
response : `requests.Response`
The HTTP response returned from the service
"""
request_payload = self._args_to_payload(
coordinates, image_size=image_size)
if get_query_payload:
return request_payload
response = self._request("POST", url=self.URL, data=request_payload,
timeout=self.TIMEOUT, verify=False)
return response


First = FirstClass()
Empty file.
13 changes: 13 additions & 0 deletions astroquery/image_cutouts/first/tests/data/image.fits
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
SIMPLE = T / FIRST Cutout Server: Wed Jun 3 12:46:13 2020 BITPIX = -32 / 4-byte Floating Point NAXIS = 2 / Number of data axes NAXIS1 = 33 / NAXIS2 = 33 / DATATYPE= 'REAL*4 ' / Floating Point DATE = '2020-06-03' / Creation UTC (CCCC-MM-DD) date of FITS header COMMENT FITS (Flexible Image Transport System) format is defined in 'Astronomy COMMENT and Astrophysics', volume 376, page 359; bibcode 2001A&A...376..359H FIELDNAM= '10510+30456E' / FIRST coadded image name OBJECT = 'J105007+304037' / Object name (Ehhmmss+ddmmss, E=J or B) OBJCTRA = '10 50 07.200' / Object Right Ascension (J2000) OBJCTDEC= '+30 40 37.20' / Object Declination OBJCTX = 1151.69 / Object X in image (pixels) OBJCTY = 409.162 / Object Y in image XCORN = 1136 / X corner in image (pixels) YCORN = 393 / Y corner in image TELESCOP= 'VLA ' / INSTRUME= 'VLA ' / OBSERVER= 'AB628 ' / DATE-OBS= '19930417' / DATE-MAP= '19990820' / BUNIT = 'JY/BEAM ' / EPOCH = 2000.00 / EQUINOX = 2000.00 / DATAMAX = 0.0390592 / DATAMIN = -0.000806942 / CTYPE1 = 'RA---SIN' / CRVAL1 = 162.750000000 / CDELT1 = -0.000500000 / CRPIX1 = -361.737 / CROTA1 = 0.00000 / CTYPE2 = 'DEC--SIN' / CRVAL2 = 30.7600000000 / CDELT2 = 0.000500000 / CRPIX2 = 182.790 / CROTA2 = 0.00000 / CTYPE3 = 'FREQ ' / CRVAL3 = 1364900000.00 / CDELT3 = 2.18750E+07 / CRPIX3 = 1.00000 / CROTA3 = 0.00000 / CTYPE4 = 'STOKES ' / CRVAL4 = 1.00000000000 / CDELT4 = 1.00000 / CRPIX4 = 1.00000 / CROTA4 = 0.00000 / BMAJ = 1.5000E-03 / Beam major axis (deg) BMIN = 1.5000E-03 / Beam minor axis (deg) BPA = 0.00 / Beam position angle (deg) HISTORY AIPS CLEAN BMAJ= 1.5000E-03 BMIN= 1.5000E-03 BPA= 0.00 HISTORY AIPS CLEAN NITER= 3 PRODUCT=1 / NORMAL HISTORY AIPS IMNAME='10510+30456E' IMCLASS='COADD' IMSEQ= 1 / HISTORY AIPS USERNO= 111 / HISTORY HISTORY The FIRST VLA Survey: Copyright 1997 University of California HISTORY Permission is granted for publication and reproduction of this HISTORY material for scholarly, educational, and private non-commercial HISTORY use. Inquiries for potential commercial uses should be HISTORY addressed to: HISTORY Robert Becker HISTORY Physics Dept HISTORY University of California HISTORY Davis, CA 95616 HISTORY HISTORY ----------------------------------------------------------- HISTORY The VLA FIRST Survey HISTORY HISTORY R.H. Becker R.L. White D.J. Helfand HISTORY UC Davis and IGPP, LLNL STScI Columbia University HISTORY HISTORY The FIRST survey (Faint Images of the Radio Sky at Twenty-cm) is a HISTORY high angular resolution survey of the North Galactic Cap intended to HISTORY match the 10,000 deg**2 survey area of the Sloan Digital Sky Survey HISTORY (Gunn and Knapp 1992 PASP 43, 267). Observations are made in the HISTORY VLA's B configuration operating at frequencies of 1365 and 1435 MHz in HISTORY the bandwidth synthesis mode. The synthesized beam has a FWHM of 5.4". HISTORY Each field is observed for 3 minutes, resulting in a typical image rms HISTORY of <0.15 mJy/beam. The raw UV data from the observations are archived HISTORY at the VLA and are available on the day they are taken without the HISTORY standard proprietary period. The fully self-calibrated UV datasets HISTORY for each pointing are also archived at the NRAO. HISTORY HISTORY Source positions derived from FIRST images have an error of 0.5" rms HISTORY for the weakest discernible point sources (~0.75 mJy) and HISTORY substantially smaller uncertainties for brighter sources. The source HISTORY surface density is ~100 per square degree. The grid of images on the HISTORY sky is sufficiently dense that considerable improvement in sensitivity HISTORY can be obtained by coadding adjacent fields. These coadded images HISTORY are named HHMMM+-DDMMM (with implied decimal points before the final HISTORY M's) corresponding to the J2000 coordinates of the field center to the HISTORY nearest 6"; e.g., the field centered at 07 42 00 +30 45 36 is named HISTORY 07420+30456. The images have 1.8" x 1.8" pixels, and vary in size HISTORY depending on declination. HISTORY HISTORY Details of the survey design, pipeline processing algorithms, and HISTORY catalog generation may be found in Becker et al. 1995 and White et al. HISTORY 1997; these papers, along with further information on FIRST, are HISTORY retrievable via the FIRST WWW home page: http://sundog.stsci.edu/ . HISTORY Users interested in deriving quantitative information from the maps for HISTORY scientific purposes are advised to read the FIRST papers first. HISTORY Questions or comments on the FIRST survey should be addressed to HISTORY Bob Becker at [email protected] or 510-423-0664. END 9:"8�ʸ�x^���=*5�@���N�I��{����L��
����7u�8_E(�a8��98���8�R���׿�4�i��-��L]�78�z��k׸��V��M���*�������й�����๞����7�d8�7�»�E�X7�-7�E�7lCU7�Z��-?����๨B16��o8�e�7�k�8�E�9��8�+�8.���/ѹ+�����l�9|����le�44z�Yz����5tS��M�������!}��A!�8G���nƸx������k�I�ս�7H.7��j�6���7˹��?�-��8��8�-8��C9&��9b�,9k?�8�����f�{�Ѹ�r�9g�M8�,�7���Ź�@e��48\x4�����й*��I���@?���~ȸ����ҹq�޹sv����LP8�k����#��������8�d�8[G�8L��8�j9�8#�m6>�8e�(�ɸ_?,9�9��8��@91k�9�9��8�B�7�I�98O|7��d�7e8��Ƕ�1��#/蹋cS�z6���i������z���,���w��#�;�QK8y?�G�ไ��F�a8�Y8�g8�l�9V�q9T\�9���:!��: ��9o��9M�9c�9�Z#9HE� gc9xj�9GD-��ԹoN��0Z�����񕊹��[�ݢ0��F��t]��\�C�|��U�Ѐu���9��<����9�k9�{s9���:��:]H:^��:�:Wwn:
s�9˛�94Y�8�B�8��q���]9���9 [\�aH繡("�@븖 �Z(������:��߸��^�����=*Ըj�T��-���R8�99O�?9o�E:��:fA�:�V�:���:�\:�G�:�$:��H:o�.:/''9�}7�fT���J}�9+�@8�Ǧ�W����lK��8��w��^��n�|18��S�5�����9y�9.p8�GT8� |9�j�9��:U�:|[:��-; �Q;,�Y;Da;7��;RE:��:�D�:5��9� �94�*8��^� LP9> ?8������6���8�+�8� ø�~
���8α�9TЬ8��9��9���9 �9�9#WK9~�U9�[+:OΈ:���;*�h;yY�;�+�;�=$;��<;D}�:�'�:�Sm::: -9¶�9*}8��)9?ꎶ>ϸ���8���9��89�Ap9C�8[]�7���96�9)�79���9�V�9"N6,�Q�8V��9���:�S;- ;�� ;���;ּ�;�|�;�0;f]�;��:��:SZ�:6�5:ˇ9Q퉸:U�9 �θ��Y�
lN9798B�9;��9�\�8���<���7��9��9��~8����Rf>�So>���r:1�:�4!;Kg�;�ڗ;��;�jU;���;�';f��:�V�:���:F�a:'�9�92<o8{�{9ٺ8���8��h9�7�-�8@�G9`:8}�q��Ϲ�Z=�n{渢�9^F�8H�0������9�:�!�; b];d@�;���;��;�]�;��0;��h;O�*:�ݓ:,�:9ʟ�9���9=u�7�8(��8���9�X8���8�,88��8�wE9[�z9�g��V��V ��b��� 9*��9H�+8�͒:
� :��;��;A3�;s��;~T;eC�;k(;�g2;|k�;3�=:� �:O.95�������_�eO����7�^7j�����8���9y�9ފ8�pK8��v8�~�9�.9'�8�D]9�`�:.::���:�s�;4�;`nW;{ss;t��;K�;�;��;��;$)�;Q�:Ѩ�:S��9��h7�:��'#ѹw���������ӷ�B���܅8���9�F~9[�8�?�8~��8�:�9�9ɲ*9�p�:'�_:��;?h�;y�;��;���;�Ei;G�;(�:�"�:�`:��!:ўE:�'M:ıM:Z�`9��x92Z7�C���[�q����8�/�8�@j9 E29��'9��\9�_#9Z��9K_�9���9���9�x�:���;80C;��;��;�\;�v;Jt�:��W:|�:�^9��:0':�!f:�X~:�C�:B�y9�ĭ8"�ָ&e0�ߋw���g�Ie�8_��9AwC9� +9��V9�Z9��9y�39"�9a�:9�rr: ��:� l;Op;���;� ;�U�;S�;�d:i�9�s
9��"9���:zn:=��:�;:�ʜ:p.89�_%8ؓy��,�0,�%�湆q񸺜8��K9Zg9�S�9ظp9�H}8ڒ��\,9��9���:"�:�:�;;��;��T;��q;��P;�T:��9�Q18}:%9��e:�&:%��:��:�ȥ:�� :��O9�g�9_�p9"�9 0�8fKI�Yo���8?��9��9H�9 9~7�����9��9΋9̹�:nۙ; ��;�@�;��8;m=�:���:[þ9�y�9Dt�9�I :t��:��i;��;&��;�:�ou9���9O�;9���9Ly>9C֪��a۹?�r�ċ�8ʏ�9~ �8�6,�+�M�^�7Q�x9�cE9/�9�?:`��;e�;}4;��";:& :�b�:�z=:���:�d:�<�;I�;Fl;k ;VIM;�:Q�91z9g9:��8 ��9: !���M��7�������\�9���9;}C7��8��9*y�8��P�m�D7� �:\� ;�8;eEw;k<};%t�:��:ٞS;��;�;"�;T7�;��;{ͷ;:��:��;:��9P
94�8�-M�9�9��!�۸���D� ��b�9"'8Dž�8��?9}�e9�Q"9>��8��\8��H:T_:�F�;8�;D�&;'&;��;`�;.Oy;5�D;+�!;4{�;=�;$�:��N:�?9L�8�TK8RC8N^�sy��E|��.޸��۸d���9K��8ԍ��9)� 9��9��9:�F9���:d�/:�nQ:��t;g;@;�%;�};vV;��:�1:��B:�E�:K�9�� 5R~b�\(��$ø�8p��U���H�A���,��4C�����94�R9/8|a89�[9ӵN9NY9A�&9��:O�L:�/:��a:�Z�:���:��:�&�:�y:��,:2
9��9rO�8 H"��Y�t����͸ڳ����6�u�� X�ɳ�w�A���H9WY8P�88�w�8�9��9�nL9��9nR9�$:�5:N:%6: }m: �9��9�ح9�o�9��Y9��|9/�8�0F9L!�8rc���k��p���O8��a��_7�#����Z�,4⹙��7��`9�209�`9ES�9#�8�ߠ9J�9��39�+r9��19�C�9��q9Ӎ�9}ѐ9o
�ϳ��?�7������o�鸾���\*9djV8M�7�aL�v@���8��ж)�8S�|��9�3��^ �ۓ9��(8Hv�7,ܣ�T���_c�J�z91�9 or�\˸��q6��9mN9/Sr93��8�h7$��8�8^;���r@�O��7���9 o��2IǹlBX�#���I��Մ"���׸��#���6��0���nָ��(6����l<ܹ�Iع�������`�1��t{�|߮�&�X�,I����8��9`�R9��p9���9*-29�8�y�9j=�9�[f9��*9��W8Μ��Z�߸�Rи�-��Q���a��1�����p�[��}���<�(��ѹ�j��e:�M/`�(�
�zkȺX2��%�zs7��9F��9��)9��9���9��9]g8�3}9P*�9��Q9��G9ŀ�9��9~L߸^�B8�B�9K�l8ϙ$8��޶�&�7w.��ߛ���C�Q3q��H�AvX�� n�}�[|���go�]�ѹ�R9m�9��9�8�:��9Զ9 �69g�9�qN9���:JV9�Q|9�1�9��l9D4?9)NY85f@9J�X9���9�z9<�!8�ѥ7��Ƹ���E�ٹQ'?��Z��OV���7̫嶚JV8���8�z�8��9�9Ξ�:��:�9�f8�0�9%49��4:(O):!�|: kV:9��8�"U90�73�Ըy,8�82l�9�A}9\��7�Mm� �w8�ɸ�/u�D>/�
����m9d9�� 9Z$9%�@8�| 9���9J�19�79���9��9he9���9׍:9��d9ع�:˼9�f�9)T9�69���8�u&��@��U7�k9�]�9��y9mM�mE�9� �9j�����垷���9���9w"�8�H"9f�9G�9}��9
��9%q 9Z8�9Y��9���9W��8��48Ó�9f@9~j8��&�]"B9�39wF8��V�/��999�9�)29̧�9�980�8^
Expand Down
Loading

0 comments on commit 25cf360

Please sign in to comment.