Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/RadioAstronomySoftwareGroup/pyuvdata
16 July 2025, 16:28:19 UTC
  • Code
  • Branches (71)
  • Releases (1)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/add_bitshuffle
    • refs/heads/add_concat_use_axis
    • refs/heads/add_feko_read
    • refs/heads/allow-extrap-in-beam
    • refs/heads/allow_exclude_ants
    • refs/heads/allow_power_units
    • refs/heads/bitshuffle_v2
    • refs/heads/combine_uvdata_func
    • refs/heads/double_prec_uvws
    • refs/heads/faster-interp
    • refs/heads/faster-uvh5-indexing
    • refs/heads/fits_speedup
    • refs/heads/fix-cst-beam-read
    • refs/heads/fix_uvbeam_constructor
    • refs/heads/frame_attr
    • refs/heads/indexIng_tools
    • refs/heads/main
    • refs/heads/miriad_tweaks_v3
    • refs/heads/ms_history_fix
    • refs/heads/mwa_van_vleck_2
    • refs/heads/ovro-lwa
    • refs/heads/py03
    • refs/heads/simple-set-antdiam
    • refs/heads/sma_dev
    • refs/heads/snap_convert
    • refs/heads/use_gh_cache
    • refs/tags/V2.1.5
    • refs/tags/v1.1
    • refs/tags/v1.2
    • refs/tags/v1.3
    • refs/tags/v1.4
    • refs/tags/v1.5
    • refs/tags/v2.0.0
    • refs/tags/v2.0.1
    • refs/tags/v2.0.2
    • refs/tags/v2.1.0
    • refs/tags/v2.1.1
    • refs/tags/v2.1.2
    • refs/tags/v2.1.3
    • refs/tags/v2.1.4
    • refs/tags/v2.2.0
    • refs/tags/v2.2.1
    • refs/tags/v2.2.10
    • refs/tags/v2.2.11
    • refs/tags/v2.2.12
    • refs/tags/v2.2.2
    • refs/tags/v2.2.3
    • refs/tags/v2.2.4
    • refs/tags/v2.2.5
    • refs/tags/v2.2.6
    • refs/tags/v2.2.7
    • refs/tags/v2.2.8
    • refs/tags/v2.2.9
    • refs/tags/v2.3.0
    • refs/tags/v2.3.1
    • refs/tags/v2.3.2
    • refs/tags/v2.3.3
    • refs/tags/v2.4.0
    • refs/tags/v2.4.1
    • refs/tags/v2.4.2
    • refs/tags/v2.4.3
    • refs/tags/v2.4.4
    • refs/tags/v2.4.5
    • refs/tags/v3.0.0
    • refs/tags/v3.1.0
    • refs/tags/v3.1.1
    • refs/tags/v3.1.2
    • refs/tags/v3.1.3
    • refs/tags/v3.2.0
    • refs/tags/v3.2.1
    • refs/tags/v3.2.2
    • v1.0
  • f2b02da
  • /
  • docs
  • /
  • make_telescope.py
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge Iframe embedding
swh:1:cnt:8eea001cf82a0a44c4e613879549d7a44e701c6a
origin badgedirectory badge Iframe embedding
swh:1:dir:b9489ee4e5d0077cb35ced0e3a5d46268fc05aa5
origin badgerevision badge
swh:1:rev:3aaaaf5d52b884bc54615fb6a4827987f49592bf
origin badgesnapshot badge
swh:1:snp:fd833260fdd82130a3ab086ae7c75b2c342ec04d
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: 3aaaaf5d52b884bc54615fb6a4827987f49592bf authored by pre-commit-ci[bot] on 05 May 2025, 20:11:07 UTC
[pre-commit.ci] pre-commit autoupdate
Tip revision: 3aaaaf5
make_telescope.py
"""
Format the Telescope object parameters into a sphinx rst file.

"""

import copy
import inspect
import json
import os

from astropy.time import Time

from pyuvdata import Telescope
from pyuvdata.telescopes import KNOWN_TELESCOPES


def write_telescope_rst(write_file=None):
    tel = Telescope()
    out = ".. _Telescope:\n\nTelescope\n=========\n\n"
    out += (
        "Telescope is a helper class for telescope-related metadata.\n"
        "Several of the primary user classes need telescope metdata, so they "
        "have a Telescope object as an attribute.\n\n"
        "Attributes\n----------\n"
        "The attributes on Telescope hold all of the metadata required to\n"
        "describe interferometric telescopes. Under the hood, the attributes are\n"
        "implemented as properties based on :class:`pyuvdata.parameter.UVParameter`\n"
        "objects but this is fairly transparent to users.\n\n"
        "Most commonly, Telescope objects are found as the ``telescope`` attribute\n"
        "on UVData, UVCal and UVFlag objects and they are typically initialized\n"
        "when those objects are initialized.\n\n"
        "Stand-alone Telescope objects can be initialized in many ways: from\n"
        "arrays in memory using the :meth:`pyuvdata.Telescope.from_params`\n"
        "class method, from our known telescope information using the\n"
        ":meth:`pyuvdata.Telescope.from_known_telescopes` class method,\n"
        "from uvh5, calh5 or uvflag HDF5 files using the "
        ":meth:`pyuvdata.Telescope.from_hdf5` class method,\n"
        "or as an empty object (as ``tel = Telescope()``).\n"
        "When an empty Telescope object is initialized, it has all of these \n"
        "attributes defined but set to ``None``. The attributes\n"
        "can be set directly on the object. Some of these attributes\n"
        "are `required`_ to be set to have a fully defined object while others are\n"
        "`optional`_. The :meth:`pyuvdata.Telescope.check` method can be called\n"
        "on the object to verify that all of the required attributes have been\n"
        "set in a consistent way.\n\n"
    )
    out += "Required\n********\n"
    out += (
        "These parameters are required to have a basic well-defined Telescope object.\n"
    )
    out += "\n\n"
    for thing in tel.required():
        obj = getattr(tel, thing)
        out += f"**{obj.name}**\n"
        out += f"     {obj.description}\n"
        out += "\n"

    out += "Optional\n********\n"
    out += (
        "These parameters are needed by by one or of the primary user classes\n"
        "but are not always required. Some of them are required when attached to\n"
        "the primary classes."
    )
    out += "\n\n"

    for thing in tel.extra():
        obj = getattr(tel, thing)
        out += f"**{obj.name}**\n"
        out += f"     {obj.description}\n"
        out += "\n"

    out += "Methods\n-------\n.. autoclass:: pyuvdata.Telescope\n  :members:\n\n"

    out += (
        "Known Telescopes\n----------------\n\n"
        "pyuvdata uses `Astropy sites\n"
        "<https://docs.astropy.org/en/stable/api/astropy.coordinates."
        "EarthLocation.html#astropy.coordinates.EarthLocation.get_site_names>`_\n"
        "for telescope location information, in addition to the following\n"
        "telescope information that is tracked within pyuvdata. Note that the\n"
        "location entry is actually stored as an\n"
        ":class:`astropy.coordinates.EarthLocation` object, which\n"
        "is shown here using the Geodetic representation. Also note that for\n"
        "some telescopes we store csv files giving antenna layout information\n"
        "which can be used if data files are missing that information.\n"
        "We also provide a convenience function to get known telescope locations.\n\n"
    )

    known_tel_use = copy.deepcopy(KNOWN_TELESCOPES)
    for tel, tel_dict in KNOWN_TELESCOPES.items():
        if "location" in tel_dict:
            known_tel_use[tel]["location"] = (
                tel_dict["location"].to_geodetic().__repr__()
            )

    json_obj = json.dumps(known_tel_use, sort_keys=True, indent=4)
    json_obj = json_obj[:-1] + " }"
    out += f".. code-block:: JavaScript\n\n {json_obj}\n\n"

    out += ".. autofunction:: pyuvdata.telescopes.known_telescope_location\n\n"

    t = Time.now()
    t.format = "iso"
    t.out_subfmt = "date"
    out += f"last updated: {t.iso}"
    if write_file is None:
        write_path = os.path.dirname(os.path.abspath(inspect.stack()[0][1]))
        write_file = os.path.join(write_path, "telescope.rst")
    with open(write_file, "w") as F:
        F.write(out)
    print("wrote " + write_file)

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API