sourcefinder.accessors.lofarcasaimage ===================================== .. py:module:: sourcefinder.accessors.lofarcasaimage .. autoapi-nested-parse:: This module implements the CASA LOFAR data container format, described in this document: http://www.lofar.org/operations/lib/exe/fetch.php?media=:public:documents :casa_image_for_lofar_0.03.00.pdf .. !! processed by numpydoc !! Attributes ---------- .. autoapisummary:: sourcefinder.accessors.lofarcasaimage.logger sourcefinder.accessors.lofarcasaimage.subtable_names Classes ------- .. autoapisummary:: sourcefinder.accessors.lofarcasaimage.LofarCasaImage Module Contents --------------- .. py:class:: LofarCasaImage(url, plane=0, beam=None) Bases: :py:obj:`sourcefinder.accessors.casaimage.CasaImage`, :py:obj:`sourcefinder.accessors.lofaraccessor.LofarAccessor` Use casacore to pull image data out of a CASA table. This accessor assumes the casatable contains the values described in the CASA Image description for LOFAR. 0.03.00. :Parameters: **url** : str Location of the CASA table. **plane** : int, default: 0 If the data is a datacube, specifies which plane to use. **beam** : tuple, default: None Beam parameters in degrees, in the form (bmaj, bmin, bpa). If not supplied, the method will attempt to read these from the header. .. !! processed by numpydoc !! .. py:method:: non_overlapping_time(series) :staticmethod: Calculate the sum of total time ranges without overlap. :Parameters: **series** : list of tuple A list of 2-item tuples representing time ranges, where each tuple contains the start and end time of a range. :Returns: float The total length of all time ranges without overlap, most likely in seconds. .. !! processed by numpydoc !! .. py:method:: open_subtables(table) :staticmethod: Open all subtables defined in the LOFAR format. :Parameters: **table** : casacore.tables.table A casacore table handler to a LOFAR CASA table. :Returns: dict A dictionary containing all LOFAR CASA subtables .. !! processed by numpydoc !! .. py:method:: parse_antennaset(subtables) :staticmethod: Extract the antenna set used in the observation. This method retrieves the unique antenna set from the LOFAR_OBSERVATION subtable. :Parameters: **subtables** : dict A dictionary containing all LOFAR CASA subtables. :Returns: numpy.ndarray An array containing the unique antenna set used in the observation. :Raises: Exception if multiple antenna sets are found. .. .. rubric:: Notes The method uses the `unique_column_values` function from the `CasaImage` class to extract unique values from the "ANTENNA_SET" column. .. !! processed by numpydoc !! .. py:method:: parse_stations(subtables) :staticmethod: Extract the number of specific LOFAR stations used in the observation. This method calculates the number of core, remote, and international LOFAR stations used based on the observation and antenna subtables. :Parameters: **subtables** : dict A dictionary containing all LOFAR CASA subtables. :Returns: tuple A tuple containing the number of core stations, remote stations, and international stations in the format (ncore, nremote, nintl). .. rubric:: Notes The method uses the "NVIS_USED" column from the LOFAR_OBSERVATION subtable and the "NAME" column from the LOFAR_ANTENNA subtable to determine which stations were used. Stations are categorized based on their names: - Core stations start with "CS". - Remote stations start with "RS". - International stations have other prefixes. .. !! processed by numpydoc !! .. py:method:: parse_subbands(subtables) :staticmethod: Extract the number of subbands used in the observation. This method retrieves the unique number of subbands from the LOFAR_ORIGIN subtable. If multiple values are found, an exception is raised. :Parameters: **subtables** : dict A dictionary containing all LOFAR CASA subtables. :Returns: int The number of subbands used in the observation. :Raises: Exception If varying numbers of channels are found in the subtable. .. rubric:: Notes The method uses the `unique_column_values` function from the `CasaImage` class to extract unique values from the "NUM_CHAN" column. .. !! processed by numpydoc !! .. py:method:: parse_subbandwidth(subtables) :staticmethod: Calculate the subband width for the observation. This method determines the subband width based on the clock frequency retrieved from the LOFAR_OBSERVATION subtable. :Parameters: **subtables** : dict A dictionary containing all LOFAR CASA subtables. :Returns: float The subband width in Hz. :Raises: Exception If multiple clock frequencies are found in the subtable. .. rubric:: Notes The method uses the clock frequency and its unit to calculate the subband width. The clock frequency is divided by 1024 to determine the subband width. For more details, see: https://www.astron.nl/lofarwiki/doku.php?id=public:documents: raw_olap_data_formats&s[]=subband 'base_subband_hz = clock_hz / 1024' .. !! processed by numpydoc !! .. py:method:: parse_taustartts(subtables) :staticmethod: Extract the image start time from the CASA table header. :Parameters: **subtables** : dict A dictionary containing all LOFAR CASA subtables. :Returns: datetime.datetime The earliest observation start time as a datetime object. .. rubric:: Notes We sort the table in order of ascending start time then choose the first value to ensure we get the earliest possible starting time. .. !! processed by numpydoc !! .. py:method:: parse_tautime(subtables) :staticmethod: Returns the total on-sky time for this image. :Parameters: **subtables** : dict A dictionary containing all LOFAR CASA subtables. :Returns: float The total on-sky time, most likely in seconds. .. !! processed by numpydoc !! .. py:attribute:: antenna_set .. py:attribute:: subbands .. py:attribute:: subbandwidth .. py:attribute:: tau_time :value: 0 .. py:attribute:: taustart_ts .. py:data:: logger .. py:data:: subtable_names :value: ('LOFAR_FIELD', 'LOFAR_ANTENNA', 'LOFAR_HISTORY', 'LOFAR_ORIGIN', 'LOFAR_QUALITY',...