diff --git a/.github/workflows/ci_devtests.yml b/.github/workflows/ci_devtests.yml index cfb68e4b1c..509fc3e7ea 100644 --- a/.github/workflows/ci_devtests.yml +++ b/.github/workflows/ci_devtests.yml @@ -5,11 +5,13 @@ on: push: branches: - main + - develop tags: - '*' pull_request: branches: - main + - develop schedule: # run every Monday at 5am UTC - cron: '0 5 * * 1' diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index d0db0f48cc..0135d90b1e 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -5,11 +5,13 @@ on: push: branches: - main + - develop tags: - '*' pull_request: branches: - main + - develop schedule: # run every Monday at 5am UTC - cron: '0 5 * * 1' diff --git a/.github/workflows/sync_fork.yml b/.github/workflows/sync_fork.yml new file mode 100644 index 0000000000..18abb115e6 --- /dev/null +++ b/.github/workflows/sync_fork.yml @@ -0,0 +1,45 @@ +name: Sync Fork +run-name: Sync Fork +on: + schedule: + - cron: '58 23 * * *' # run every day - two minutes to midnight + workflow_dispatch: # to enable manual runs of the workflow + +jobs: + Get-Timestamp: + runs-on: ubuntu-latest + steps: + - run: date + + Sync-With-Upstream: + runs-on: ubuntu-latest + steps: + - run: echo "The job was automatically triggered by a ${{ github.event_name }} event." + - run: echo "This job is now running on a ${{ runner.os }} server hosted by GitHub" + - run: echo "Running on branch ${{ github.ref }}, repository ${{ github.repository }}." + - name: Check out repository code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - run: echo "The ${{ github.repository }} repository has been cloned to the runner." + - name: List files in the repository + run: | + ls ${{ github.workspace }} + - name: Sync repository with upstream + run: | + cd ${{ github.workspace }} + git config --global user.email "jcarmona@eso.org" + git config --global user.name "Nightly Sync" + git remote add upstream https://github.com/astropy/astroquery.git + git remote -v + git fetch upstream main + echo "--- upstream log: " + git log upstream/main --oneline -10 + echo "--- current branch log before merge: " + git log --oneline -10 + git merge upstream/main + echo "--- current branch log after merge: " + git log --oneline -10 + echo "--- push force with lease" + git push --force-with-lease + - run: echo "The job finished with status ${{ job.status }}." diff --git a/astroquery/eso/core.py b/astroquery/eso/core.py index 30c473b60d..ebcd23c5ea 100644 --- a/astroquery/eso/core.py +++ b/astroquery/eso/core.py @@ -38,7 +38,7 @@ from ..utils import schema from .utils import _UserParams, raise_if_coords_not_valid, _reorder_columns, \ _raise_if_has_deprecated_keys, _build_adql_string, \ - DEFAULT_LEAD_COLS_PHASE3, DEFAULT_LEAD_COLS_RAW + _split_str_as_list_of_str, DEFAULT_LEAD_COLS_PHASE3, DEFAULT_LEAD_COLS_RAW __all__ = ['Eso', 'EsoClass'] @@ -71,6 +71,7 @@ class _EsoNames: phase3_table = "ivoa.ObsCore" raw_instruments_column = "instrument" phase3_surveys_column = "obs_collection" + asm_schema = "asm" @staticmethod def ist_table(instrument_name): @@ -79,6 +80,13 @@ def ist_table(instrument_name): """ return f"ist.{instrument_name}" + @staticmethod + def asm_table(asm_name): + """ + Returns the name of the ASM table + """ + return f"{_EsoNames.asm_schema}.{asm_name}" + apex_quicklooks_table = ist_table.__func__("apex_quicklooks") apex_quicklooks_pid_column = "project_id" @@ -348,6 +356,28 @@ def list_instruments(self, cache=True) -> List[str]: return l_res + @unlimited_maxrec + @deprecated_renamed_argument('cache', None, since='0.4.12') + def list_asm(self, cache=True) -> List[str]: + """ + List all the available ASM tables offered by the ESO archive. + + Returns + ------- + asm_list : list of strings + cache : bool + Deprecated - unused. + """ + _ = cache # We're aware about disregarding the argument + query_str = ("select table_name from TAP_SCHEMA.tables " + f"where schema_name='{_EsoNames.asm_schema}' order by table_name") + res = self.query_tap(query_str)["table_name"].data + + l_res = list(res) + l_res = list(map(lambda x: x.split(".", 1)[1], l_res)) + + return l_res + @unlimited_maxrec @deprecated_renamed_argument('cache', None, since='0.4.12') def list_surveys(self, *, cache=True) -> List[str]: @@ -368,17 +398,30 @@ def list_surveys(self, *, cache=True) -> List[str]: return res @unlimited_maxrec - def list_column(self, table_name: str) -> None: + def _get_table_columns(self, table_name: str, *, include_description: bool = False) -> Table: + columns = "column_name, datatype, xtype, unit" + if include_description: + columns = f"{columns}, description" + query_str = ( + f"select {columns} " + f"from TAP_SCHEMA.columns " + f"where table_name = '{table_name}'") + return self.query_tap(query_str) + + @unlimited_maxrec + def list_column(self, table_name: str, *, include_description: bool = False) -> None: """ Prints the columns contained in a given table + + Parameters + ---------- + table_name : str + Name of the table to inspect. + include_description : bool, optional + If ``True``, include column descriptions when available. """ - help_query = ( - f"select column_name, datatype, xtype, unit " - # TODO: The column description renders output unmanageable - # f", description " - f"from TAP_SCHEMA.columns " - f"where table_name = '{table_name}'") - available_cols = self.query_tap(help_query) + available_cols = self._get_table_columns( + table_name, include_description=include_description) count_query = f"select count(*) from {table_name}" num_records = list(self.query_tap(count_query)[0].values())[0] @@ -590,6 +633,146 @@ def query_main( t = _reorder_columns(t, DEFAULT_LEAD_COLS_RAW) return t + def query_asm( + self, + asm_table: str, *, + help: bool = False, + columns: Union[List, str] = None, + column_filters: Optional[dict] = None, + maxrec: int = None, + **kwargs, + ) -> Union[Table, int, str, None]: + """ + Query ASM (Astronomical Site Monitor) data contained in the ESO archive. + + Parameters + ---------- + asm_table : str + Name of the ASM table to query. Should be ONLY ONE of the + names returned by :meth:`~astroquery.eso.EsoClass.list_asm`. + The ``asm.`` prefix is accepted. + help : bool, optional + If ``True``, prints all the parameters accepted in ``column_filters`` + and ``columns``. Default is ``False``. + columns : str or list of str, optional + Name of the columns the query should return. If specified as a string, + it should be a comma-separated list of column names. + column_filters : dict or None, optional + Constraints applied to the query in ADQL syntax, + e.g., ``{"exp_start": "between '2024-12-31' and '2025-12-31'"}``. + Default is ``None``. + maxrec : int or None, optional + Overrides the configured row limit for this query only. + **kwargs + Additional optional parameters consistent with + :meth:`~astroquery.eso.EsoClass.query_instrument`, including: + ``top``, ``count_only``, ``get_query_payload``, ``authenticated``, + ``order_by``, and ``order_by_desc``. + + Returns + ------- + astropy.table.Table, str, int, or None + - By default, returns an :class:`~astropy.table.Table` containing records + based on the specified columns and constraints. Returns ``None`` if no results. + - When ``count_only`` is ``True``, returns an ``int`` representing the + record count for the specified filters. + - When ``get_query_payload`` is ``True``, returns the query string that + would be issued to the TAP service given the specified arguments. + """ + column_filters = column_filters if column_filters else {} + + if not isinstance(asm_table, str) or not asm_table.strip(): + raise ValueError("asm_table must be a non-empty string.") + + asm_table = asm_table.strip() + if asm_table.lower().startswith(f"{_EsoNames.asm_schema}."): + asm_table = asm_table.split(".", 1)[1] + + asm_names = self.list_asm() + asm_map = {name.lower(): name for name in asm_names} + asm_table_key = asm_table.lower() + if asm_table_key not in asm_map: + raise ValueError( + f"Unknown ASM table '{asm_table}'. " + "Use list_asm() to see available ASM tables." + ) + + asm_table = asm_map[asm_table_key] + table_name = _EsoNames.asm_table(asm_table) + + if help: + self.list_column(table_name, include_description=True) + return + + allowed_kwargs = { + "top", "count_only", "get_query_payload", "authenticated", + "order_by", "order_by_desc", + } + unknown_kwargs = set(kwargs) - allowed_kwargs + if unknown_kwargs: + unknown_str = ", ".join(sorted(unknown_kwargs)) + raise TypeError(f"Unexpected keyword argument(s): {unknown_str}") + + columns_list = None + if columns is not None: + if isinstance(columns, str): + columns_list = _split_str_as_list_of_str(columns) + else: + columns_list = list(columns) + + available_cols = self._get_table_columns(table_name)["column_name"].data + available_cols_map = {c.lower(): c for c in available_cols} + + if columns_list: + if not (len(columns_list) == 1 and columns_list[0] == '*'): + missing_cols = [ + c for c in columns_list if c.lower() not in available_cols_map + ] + if missing_cols: + missing_str = ", ".join(sorted(missing_cols)) + raise ValueError( + f"Unknown column(s) in columns for table {table_name}: {missing_str}" + ) + columns = [available_cols_map[c.lower()] for c in columns_list] + + if column_filters: + missing_filters = [ + k for k in column_filters.keys() if k.lower() not in available_cols_map + ] + if missing_filters: + missing_str = ", ".join(sorted(missing_filters)) + raise ValueError( + f"Unknown column(s) in column_filters for table {table_name}: {missing_str}" + ) + column_filters = { + available_cols_map[k.lower()]: v for k, v in column_filters.items() + } + + row_limit = None + if maxrec is not None: + row_limit = self.ROW_LIMIT + self.ROW_LIMIT = maxrec + + try: + user_params = _UserParams( + table_name=table_name, + column_name=None, + allowed_values=None, + columns=columns, + column_filters=column_filters, + top=kwargs.get("top"), + count_only=kwargs.get("count_only", False), + get_query_payload=kwargs.get("get_query_payload", False), + print_help=False, + authenticated=kwargs.get("authenticated", False), + order_by=kwargs.get("order_by", ''), + order_by_desc=kwargs.get("order_by_desc", True), + ) + return self._query_on_allowed_values(user_params) + finally: + if row_limit is not None: + self.ROW_LIMIT = row_limit + @deprecated_renamed_argument(('open_form', 'cache'), (None, None), since=['0.4.12', '0.4.12']) def query_instrument( diff --git a/astroquery/eso/testing/test_query_asm.ipynb b/astroquery/eso/testing/test_query_asm.ipynb new file mode 100644 index 0000000000..559cc6dcf7 --- /dev/null +++ b/astroquery/eso/testing/test_query_asm.ipynb @@ -0,0 +1,309 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "id": "e8e82756", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "astroquery version: 0.4.12.dev10525\n" + ] + } + ], + "source": [ + "import astroquery # import astroquery\n", + "from astroquery.eso import Eso # import the ESO module from astroquery\n", + "\n", + "print(f\"astroquery version: {astroquery.__version__}\") # check the version of astroquery\n", + "\n", + "eso = Eso() # create an instance of the ESO class " + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "d1d9309d", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "['ambient_lasilla',\n", + " 'dimm_paranal',\n", + " 'historical_ambient_paranal',\n", + " 'lhatpros_paranal',\n", + " 'lhatpros_paranal_irt',\n", + " 'lhatpros_paranal_profiles',\n", + " 'mass_paranal',\n", + " 'meteo_apex',\n", + " 'meteo_lasilla',\n", + " 'meteo_paranal',\n", + " 'meteo_vista',\n", + " 'slodar_paranal']" + ] + }, + "execution_count": 2, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "eso.list_asm()" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "2dad36eb", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "INFO: \n", + "Columns present in the table asm.meteo_paranal:\n", + " column_name datatype xtype unit description \n", + "--------------------- -------- --------- --------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n", + " integration short s Timebin [s] used for measurement of ambient data sample.\n", + " midpoint_date char timestamp Midpoint (time) of the measurement.\n", + " presqnh float hPa Air Pressure Normalised: 1 minute average pressure normalised to sea level [hPa]. (sci. param.)\n", + " presqnh_dev float hPa Air Pressure Normalised RMS: 1 minute RMS pressure normalized to sea level [hPa]. (eng. param.)\n", + " presqnh_inst float hPa Air Pressure Normalised instantaneous: Pressure normalized to sea level at the end of the averaging period [hPa]. (eng. param.)\n", + " presqnh_max float hPa Air Pressure Normalised max: 1 minute maximum pressure normalized to sea level [hPa]. (eng. param.)\n", + " presqnh_min float hPa Air Pressure Normalised min: 1 minute minimum pressure normalized to sea level [hPa]. (eng. param.)\n", + " press_0m float hPa Air Pressure: Temporal (1 minute) mean of observatory site ambient baromeric air pressure measured at 0m above the VLT platform during measurement period [hPa]. (sci. param.)\n", + " press_0m_dev float hPa Air Pressure RMS: 1 minute RMS surface pressure variation at 0m above the VLT platform [hPa]. (eng. param.)\n", + " press_0m_inst float hPa Air Pressure instantaneous: instant value measured at 0m above the VLT platform at the end of the averaging period [hPa]. (eng. param.)\n", + " press_0m_max float hPa Air Pressure max: 1 minute maximum surface pressure at 0m above the VLT platform [hPa]. (eng. param.)\n", + " press_0m_min float hPa Air Pressure min: 1 minute minimum surface pressure at 0m above the VLT platform [hPa]. (eng. param.)\n", + " prestrend_0m float hPa Air Pressure 3h trend: Surface pressure trend over 3 hours at 0m above the VLT platform [hPa]. (eng. param.)\n", + " rain_m20m short % Rain intensity: 1 minute average rain percentage measured 20m below the VLT platform [%]. (sci. param.)\n", + " rain_m20m_dev short % Rain Intensity RMS: 1 minute RMS rain percentage 20m below the VLT platform [%]. (eng. param.)\n", + " rain_m20m_inst short % Rain Intensity instantaneous : Rain percentage at 20m below the VLT platform at the end of the averaging period [%]. (eng. param.)\n", + " rain_m20m_max short % Rain Intensity max: 1 minute maximum rain percentage 20m below the VLT platform [%]. (eng. param.)\n", + " rain_m20m_min short % Rain Intensity min: 1 minute minimum rain percentage 20m below the VLT platform [%]. (eng. param.)\n", + " rhum_2m short % Relative Humidity: Temporal (1 minute) mean of observatory site ambient relative humidity measured at sensor position 2m above the VLT platform during measurement period [%]. (sci. param.)\n", + " rhum_2m_dev short % Humidity RMS: 1 minute RMS relative humidity measured at 2m above the VLT platform [%]. (eng. param.)\n", + " rhum_2m_inst short % Humidity instantaneous: instant value measured at 2m above the VLT platform at the end of the averaging period [%]. (eng. param.)\n", + " rhum_2m_max short % Humidity max: 1 minute maximum relative humidity measured at 2m above the VLT platform [%]. (eng. param.)\n", + " rhum_2m_min short % Humidity min: 1 minute minimum relative humidity measured at 2m above the VLT platform [%]. (eng. param.)\n", + " rhum_30m short % Relative Humidity: Temporal (1 minute) mean of observatory site ambient relative humidity measured at sensor position 30m above the VLT platform during measurement period [%]. (sci. param.)\n", + " rhum_30m_dev short % Humidity RMS: 1 minute RMS relative humidity measured at 30m above the VLT platform [%]. (eng. param.)\n", + " rhum_30m_inst short % Humidity instantaneous: instant value measured at 30m above the VLT platform at the end of the averaging period [%]. (eng. param.)\n", + " rhum_30m_max short % Humidity max: 1 minute maximum relative humidity measured at 30m above the VLT platform [%]. (eng. param.)\n", + " rhum_30m_min short % Humidity min: 1 minute minimum relative humidity measured at 30m above the VLT platform [%]. (eng. param.)\n", + " rhum_m20m short % Relative Humidity: Temporal (1 minute) mean of observatory site ambient relative humidity measured at sensor position 20m below the VLT platform during measurement period [%]. (sci. param.)\n", + " rhum_m20m_dev short % Humidity RMS: 1 minute RMS relative humidity measured at 20m below the VLT platform [%]. (eng. param.)\n", + " rhum_m20m_inst short % Humidity instantaneous: instant value measured at 20m below the VLT platform at the end of the averaging period [%]. (eng. param.)\n", + " rhum_m20m_max short % Humidity max: 1 minute maximum relative humidity measured at 20m below the VLT platform [%]. (eng. param.)\n", + " rhum_m20m_min short % Humidity min: 1 minute minimum relative humidity measured at 20m below the VLT platform [%]. (eng. param.)\n", + " start_date char timestamp The start time of the measurement.\n", + " temp_0m float Celsius Ambient Temperature: Temporal (1 minute) mean of site ambient temperature measured at 0m above the VLT platform [degC]. (sci. param.)\n", + " temp_0m_dev float Celsius Air Temperature RMS: 1 minute RMS air temperature variation at 0m above the VLT platform below VLT platform [degC]. (eng. param.)\n", + " temp_0m_inst float Celsius Air Temperature Instantaneous : instant value measured at 0m above the VLT platform measured at the end of the averaging period [degC]. (eng. param.)\n", + " temp_0m_max float Celsius Air Temperature max: 1 minute maximum air temperature at 0m above the VLT platform [degC]. (eng. param.)\n", + " temp_0m_min float Celsius Air Temperature min: 1 minute minimum air temperature at 0m above the VLT platform [degC]. (eng. param.)\n", + " temp_2m float Celsius Ambient Temperature: Temporal (1 minute) mean of site ambient temperature measured at 2m above the VLT platform [degC]. (sci. param.)\n", + " temp_2m_dev float Celsius Air Temperature RMS: 1 minute RMS air temperature variation at 2m above the VLT platform below VLT platform [degC]. (eng. param.)\n", + " temp_2m_inst float Celsius Air Temperature Instantaneous : instant value measured at 2m above the VLT platform measured at the end of the averaging period [degC]. (eng. param.)\n", + " temp_2m_max float Celsius Air Temperature max: 1 minute maximum air temperature at 2m above the VLT platform [degC]. (eng. param.)\n", + " temp_2m_min float Celsius Air Temperature min: 1 minute minimum air temperature at 2m above the VLT platform [degC]. (eng. param.)\n", + " temp_30m float Celsius Ambient Temperature: Temporal (1 minute) mean of site ambient temperature measured at 30m above the VLT platform [degC]. (sci. param.)\n", + " temp_30m_dev float Celsius Air Temperature RMS: 1 minute RMS air temperature variation at 30m above the VLT platform below VLT platform [degC]. (eng. param.)\n", + " temp_30m_inst float Celsius Air Temperature Instantaneous : instant value measured at 30m above the VLT platform measured at the end of the averaging period [degC]. (eng. param.)\n", + " temp_30m_max float Celsius Air Temperature max: 1 minute maximum air temperature at 30m above the VLT platform [degC]. (eng. param.)\n", + " temp_30m_min float Celsius Air Temperature min: 1 minute minimum air temperature at 30m above the VLT platform [degC]. (eng. param.)\n", + " temp_m20m float Celsius Ambient Temperature: Temporal (1 minute) mean of site ambient temperature measured at 20m below the VLT platform [degC]. (sci. param.)\n", + " temp_m20m_dev float Celsius Air Temperature RMS: 1 minute RMS air temperature variation 20m below the VLT platform [degC]. (eng. param.)\n", + " temp_m20m_inst float Celsius Air Temperature Instantaneous : instant value measured at 20m below the VLT platform measured at the end of the averaging period [degC]. (eng. param.)\n", + " temp_m20m_max float Celsius Air Temperature max: 1 minute maximum air temperature 20m below the VLT platform [degC]. (eng. param.)\n", + " temp_m20m_min float Celsius Air Temperature min: 1 minute minimum air temperature 20m below the VLT platform [degC]. (eng. param.)\n", + " tempdew_2m float Celsius Dew Temperature: Temporal (1 minute) mean of observatory site ambient dew temperature measured at sensor position 2m above the VLT platform during measurement period [degC]. (sci. param.)\n", + " tempdew_2m_dev float Celsius Dew Temperature RMS: 1 minute RMS dew temperature at 2m above the VLT platform [degC]. (eng. param.)\n", + " tempdew_2m_inst float Celsius Dew Temperature instantaneous: instant value measured at 2m above the VLT platform measured at the end of the averaging period [degC]. (eng. param.)\n", + " tempdew_2m_max float Celsius Dew Temperature max: 1 minute maximum dew temperature at 2m above the VLT platform [degC]. (eng. param.)\n", + " tempdew_2m_min float Celsius Dew Temperature min: 1 minute minimum dew temperature at 2m above the VLT platform [degC]. (eng. param.)\n", + " tempdew_30m float Celsius Dew Temperature: Temporal (1 minute) mean of observatory site ambient dew temperature measured at sensor position 30m above the VLT platform during measurement period [degC]. (sci. param.)\n", + " tempdew_30m_dev float Celsius Dew Temperature RMS: 1 minute RMS dew temperature at 30m above the VLT platform [degC]. (eng. param.)\n", + " tempdew_30m_inst float Celsius Dew Temperature instantaneous: instant value measured at 30m above the VLT platform measured at the end of the averaging period [degC]. (eng. param.)\n", + " tempdew_30m_max float Celsius Dew Temperature max: 1 minute maximum dew temperature at 30m above the VLT platform [degC]. (eng. param.)\n", + " tempdew_30m_min float Celsius Dew Temperature min: 1 minute minimum dew temperature at 30m above the VLT platform [degC]. (eng. param.)\n", + " tempdew_m20m float Celsius Dew Temperature: Temporal (1 minute) mean of observatory site ambient dew temperature measured at sensor position 20m below the VLT platform during measurement period [degC]. (sci. param.)\n", + " tempdew_m20m_dev float Celsius Dew Temperature RMS: 1 minute RMS dew temperature at 20m below the VLT platform [degC]. (eng. param.)\n", + " tempdew_m20m_inst float Celsius Dew Temperature instantaneous: instant value measured at 20m below the VLT platform measured at the end of the averaging period [degC]. (eng. param.)\n", + " tempdew_m20m_max float Celsius Dew Temperature max: 1 minute maximum dew temperature at 20m below the VLT platform [degC]. (eng. param.)\n", + " tempdew_m20m_min float Celsius Dew Temperature min: 1 minute minimum dew temperature at 20m below the VLT platform [degC]. (eng. param.)\n", + " valid short 1 if a valid measurement, 0 otherwise.\n", + " wind_dir_10m short deg Wind Direction (0/360): 1 minute average wind direction at 10m above the VLT platform counted clockwise from North (standard) [deg]. (sci. param.)\n", + " wind_dir_10m_180 short deg Wind Direction (180/-180): 1 minute average wind direction at 10m and 10m above the VLT platform counted clockwise from North (with 180 degree negative offset for display purposes) [deg]. (sci. param.)\n", + "wind_dir_10m_180_inst short deg Wind Direction instantaneous (180/-180): wind direction at 10m above the VLT platform, counted clockwise from North (with 180 degree negative offset for display purposes), at the end of the averaging period [deg]. (eng. param.)\n", + " wind_dir_10m_180_max short deg Wind Direction max (180/-180): 1 minute maximum wind direction at 10m above the VLT platform counted clockwise from North (with 180 degree negative offset for display purposes) [deg]. (eng. param.)\n", + " wind_dir_10m_180_min short deg Wind Direction min (180/-180): 1 minute minimum wind direction at 10m above the VLT platform counted clockwise from North (with 180 degree negative offset for display purposes) [deg]. (eng. param.)\n", + " wind_dir_10m_dev short deg Wind Direction RMS: 1 minute RMS air wind direction at 10m above the VLT platform [deg]. (eng. param.)\n", + " wind_dir_10m_inst short deg Wind Direction instantaneous (0/360): wind direction at 10m above the VLT platform, counted clockwise from North (standard), at the end of the averaging period [deg]. (eng. param.)\n", + " wind_dir_10m_max short deg Wind Direction max (0/360): 1 minute maximum wind direction at 10m above the VLT platform counted clockwise from North (standard) [deg]. (eng. param.)\n", + " wind_dir_10m_min short deg Wind Direction min (0/360): 1 minute minimum wind direction at 10m above the VLT platform counted clockwise from North (standard) [deg]. (eng. param.)\n", + " wind_dir_30m short deg Wind Direction (0/360): 1 minute average wind direction at 30m above the VLT platform counted clockwise from North (standard) [deg]. (sci. param.)\n", + " wind_dir_30m_180 short deg Wind Direction (180/-180): 1 minute average wind direction at 30m above the VLT platform counted clockwise from North (with 180 degree negative offset for display purposes) [deg]. (sci. param.)\n", + "wind_dir_30m_180_inst short deg Wind Direction instantaneous (180/-180): wind direction at 30m above the VLT platform, counted clockwise from North (with 180 degree negative offset for display purposes), at the end of the averaging period [deg]. (eng. param.)\n", + " wind_dir_30m_180_max short deg Wind Direction max (180/-180): 1 minute maximum wind direction at 30m above the VLT platform counted clockwise from North (with 180 degree negative offset for display purposes) [deg]. (eng. param.)\n", + " wind_dir_30m_180_min short deg Wind Direction min (180/-180): 1 minute minimum wind direction at 30m above the VLT platform counted clockwise from North (with 180 degree negative offset for display purposes) [deg]. (eng. param.)\n", + " wind_dir_30m_dev short deg Wind Direction RMS: 1 minute RMS air wind direction at 30m above the VLT platform counted clockwise from North (standard) [deg]. (eng. param.)\n", + " wind_dir_30m_inst short deg Wind Direction instantaneous (0/360): wind direction at 30m above the VLT platform, counted clockwise from North (standard), at the end of the averaging period [deg]. (eng. param.)\n", + " wind_dir_30m_max short deg Wind Direction max (0/360): 1 minute maximum wind direction at 30m above the VLT platform counted clockwise from North (standard) [deg]. (eng. param.)\n", + " wind_dir_30m_min short deg Wind Direction min (0/360): 1 minute minimum wind direction at 30m above the VLT platform counted clockwise from North (standard) [deg]. (eng. param.)\n", + " wind_speed_10m float m.s**(-1) Wind Speed: 1 minute average wind speed at sensor position 10m [m.s**(-1)]. (sci. param.)\n", + " wind_speed_10m_dev float m.s**(-1) Wind Speed RMS: 1 minute RMS wind speed at 10m above ground [m.s**(-1)]. (eng. param.)\n", + " wind_speed_10m_inst float m.s**(-1) Wind Speed instantaneous : instant value measured at 10m above the VLT platform, at the end of the averaging period [m.s**(-1)]. (eng. param.)\n", + " wind_speed_10m_max float m.s**(-1) Wind Speed max: 1 minute maximum wind speed at 10m above ground [m.s**(-1)]. (eng. param.)\n", + " wind_speed_10m_min float m.s**(-1) Wind Speed min: 1 minute minimum wind speed at 10m above ground [m.s**(-1)]. (eng. param.)\n", + " wind_speed_30m float m.s**(-1) Wind Speed: 1 minute average wind speed at sensor position 30m above the VLT platform [m.s**(-1)]. (sci. param.)\n", + " wind_speed_30m_dev float m.s**(-1) Wind Speed RMS: 1 minute RMS wind speed at 30m above the VLT platform [m.s**(-1)]. (eng. param.)\n", + " wind_speed_30m_inst float m.s**(-1) Wind Speed instantaneous : instant value measured at 30m above the VLT platform, at the end of the averaging period [m.s**(-1)]. (eng. param.)\n", + " wind_speed_30m_max float m.s**(-1) Wind Speed max: 1 minute maximum wind speed at 30m above the VLT platform [m.s**(-1)]. (eng. param.)\n", + " wind_speed_30m_min float m.s**(-1) Wind Speed min: 1 minute minimum wind speed at 30m above the VLT platform [m.s**(-1)]. (eng. param.)\n", + " wind_speedu_20m float m.s**(-1) Wind Speed component U: Temporal mean of observatory site ambient wind speed U vector component, where U is horizontal and points to 330 degree measured at sensor position 20m above ground during measurement period [m.s**(-1)]. (sci. param.)\n", + " wind_speedu_20m_dev float m.s**(-1) Wind Speed component U RMS: 1 minute RMS horizontal wind speed U component (into 330 degree) at 20m above ground [m.s**(-1)]. (eng. param.)\n", + " wind_speedu_20m_inst float m.s**(-1) Wind Speed component U instantaneous: Horizontal wind speed U component (into 330 degree) at 20m above ground at the end of the averaging period [m.s**(-1)]. (eng. param.)\n", + " wind_speedu_20m_max float m.s**(-1) Wind Speed component U max: 1 minute maximum horizontal wind speed U component (into 330 degree) at 20m above ground [m.s**(-1)]. (eng. param.)\n", + " wind_speedu_20m_min float m.s**(-1) Wind Speed component U min: 1 minute minimum horizontal wind speed U component (into 330 degree) at 20m above ground [m.s**(-1)]. (eng. param.)\n", + " wind_speedv_20m float m.s**(-1) Wind Speed component V: Temporal mean of observatory site ambient wind speed V vector component, where V is horizontal and points to 240 degree measured at sensor position 20m above ground during measurement period [m.s**(-1)]. (sci. param.)\n", + " wind_speedv_20m_dev float m.s**(-1) Wind Speed component V RMS: 1 minute RMS horizontal wind speed V component (into 240 degree) at 20m above ground [m.s**(-1)]. (eng. param.)\n", + " wind_speedv_20m_inst float m.s**(-1) Wind Speed component V instantaneous: Horizontal wind speed V component (into 240 degree) at 20m above ground at the end of the averaging period [m.s**(-1)]. (eng. param.)\n", + " wind_speedv_20m_max float m.s**(-1) Wind Speed component V max: 1 minute maximum horizontal wind speed V component (into 240 degree) at 20m above ground [m.s**(-1)]. (eng. param.)\n", + " wind_speedv_20m_min float m.s**(-1) Wind Speed component V min: 1 minute minimum horizontal wind speed V component (into 240 degree) at 20m above ground [m.s**(-1)]. (eng. param.)\n", + " wind_speedw_20m float m.s**(-1) Wind Speed component W: Temporal mean of observatory site ambient wind speed W vector component, where W is vertically pointing upwards, measured at sensor position 20m above ground during measurement period [m.s**(-1)]. (sci. param.)\n", + " wind_speedw_20m_dev float m.s**(-1) Wind Speed component W RMS: 1 minute RMS vertical wind speed W component at 20m above ground [m.s**(-1)]. (eng. param.)\n", + " wind_speedw_20m_inst float m.s**(-1) Wind Speed component W instantaneous: Vertical wind speed W component at 20m above ground at the end of the averaging period [m.s**(-1)]. (eng. param.)\n", + " wind_speedw_20m_max float m.s**(-1) Wind Speed component W max: 1 minute maximum vertical wind speed W component at 20m above ground [m.s**(-1)]. (eng. param.)\n", + " wind_speedw_20m_min float m.s**(-1) Wind Speed component W min: 1 minute minimum vertical wind speed W component at 20m above ground [m.s**(-1)]. (eng. param.)\n", + "\n", + "Number of records present in the table asm.meteo_paranal:\n", + "14162797\n", + " [astroquery.eso.core]\n" + ] + } + ], + "source": [ + "eso.query_asm('meteo_paranal', help=True)" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "edda44d1", + "metadata": {}, + "outputs": [], + "source": [ + "table = eso.query_asm('meteo_paranal', column_filters={\"start_date\": \"between '2025-05-01T21:00:00' and '2025-05-02T10:00:00'\"})" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "7ca5626c", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
Table length=780\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "\n", + "
integrationmidpoint_datepresqnhpresqnh_devpresqnh_instpresqnh_maxpresqnh_minpress_0mpress_0m_devpress_0m_instpress_0m_maxpress_0m_minprestrend_0mrain_m20mrain_m20m_devrain_m20m_instrain_m20m_maxrain_m20m_minrhum_2mrhum_2m_devrhum_2m_instrhum_2m_maxrhum_2m_minrhum_30mrhum_30m_devrhum_30m_instrhum_30m_maxrhum_30m_minrhum_m20mrhum_m20m_devrhum_m20m_instrhum_m20m_maxrhum_m20m_minstart_datetemp_0mtemp_0m_devtemp_0m_insttemp_0m_maxtemp_0m_mintemp_2mtemp_2m_devtemp_2m_insttemp_2m_maxtemp_2m_mintemp_30mtemp_30m_devtemp_30m_insttemp_30m_maxtemp_30m_mintemp_m20mtemp_m20m_devtemp_m20m_insttemp_m20m_maxtemp_m20m_mintempdew_2mtempdew_2m_devtempdew_2m_insttempdew_2m_maxtempdew_2m_mintempdew_30mtempdew_30m_devtempdew_30m_insttempdew_30m_maxtempdew_30m_mintempdew_m20mtempdew_m20m_devtempdew_m20m_insttempdew_m20m_maxtempdew_m20m_minvalidwind_dir_10mwind_dir_10m_180wind_dir_10m_180_instwind_dir_10m_180_maxwind_dir_10m_180_minwind_dir_10m_devwind_dir_10m_instwind_dir_10m_maxwind_dir_10m_minwind_dir_30mwind_dir_30m_180wind_dir_30m_180_instwind_dir_30m_180_maxwind_dir_30m_180_minwind_dir_30m_devwind_dir_30m_instwind_dir_30m_maxwind_dir_30m_minwind_speed_10mwind_speed_10m_devwind_speed_10m_instwind_speed_10m_maxwind_speed_10m_minwind_speed_30mwind_speed_30m_devwind_speed_30m_instwind_speed_30m_maxwind_speed_30m_minwind_speedu_20mwind_speedu_20m_devwind_speedu_20m_instwind_speedu_20m_maxwind_speedu_20m_minwind_speedv_20mwind_speedv_20m_devwind_speedv_20m_instwind_speedv_20m_maxwind_speedv_20m_minwind_speedw_20mwind_speedw_20m_devwind_speedw_20m_instwind_speedw_20m_maxwind_speedw_20m_min
shPahPahPahPahPahPahPahPahPahPahPa%%%%%%%%%%%%%%%%%%%%CelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusCelsiusdegdegdegdegdegdegdegdegdegdegdegdegdegdegdegdegdegdegm.s**(-1)m.s**(-1)m.s**(-1)m.s**(-1)m.s**(-1)m.s**(-1)m.s**(-1)m.s**(-1)m.s**(-1)m.s**(-1)m.s**(-1)m.s**(-1)m.s**(-1)m.s**(-1)m.s**(-1)m.s**(-1)m.s**(-1)m.s**(-1)m.s**(-1)m.s**(-1)m.s**(-1)m.s**(-1)m.s**(-1)m.s**(-1)m.s**(-1)
int16objectfloat32float32float32float32float32float32float32float32float32float32float32int16int16int16int16int16int16int16int16int16int16int16int16int16int16int16int16int16int16int16int16objectfloat32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32int16int16int16int16int16int16int16int16int16int16int16int16int16int16int16int16int16int16int16float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32float32
602025-05-01T21:01:11Z1027.440.01027.471027.471027.34745.080.24745.1745.1745.0-0.17111111511416141511517131411715132025-05-01T21:00:41Z18.040.0118.0618.0518.0215.980.0515.9616.0515.9214.780.0214.7814.8114.7617.490.1417.4617.6517.3-10.560.72-11.56-9.76-11.56-11.671.21-11.9-10.3-13.26-10.30.87-9.19-9.19-11.31343-17-17-17-170343343343346-14-22-6-2253383543388.780.877.49.97.18.431.097.711.06.8-7.450.59-7.99-6.55-8.752.030.521.123.31.052.350.62.653.671.4
602025-05-01T21:02:11Z1027.420.01027.471027.471027.34745.070.28745.0745.1745.0-0.1711111161151714161161815171--17162025-05-01T21:01:41Z18.040.0118.0318.0618.0315.950.0415.916.0115.8814.760.0314.7214.7814.7117.440.217.1517.6917.19-10.160.77-10.44-9.09-11.37-10.661.09-11.94-9.38-11.94-8.120.6-7.63-7.63-8.781343-1711-17-17011343343341-1900-28736003328.451.058.810.97.17.880.768.99.46.7-7.630.69-6.57-6.38-8.822.280.982.514.381.052.450.472.653.751.55
602025-05-01T21:03:11Z1027.442.371027.471031.231023.7745.081.8745.1748.0742.2-0.13111111511516141511616141411615132025-05-01T21:02:41Z18.040.0118.0618.0518.0215.90.0915.7516.015.7814.720.014.7314.7314.7217.410.2117.6117.6517.15-10.790.72-11.56-9.86-11.63-11.50.54-10.78-10.78-12.14-10.290.79-10.34-9.26-11.171348-12-1711-171134311343358-2-176-17634363438.31.189.610.05.98.570.726.79.97.2-6.830.7-8.04-5.55-8.153.280.991.385.00.882.10.594.544.050.75
602025-05-01T21:04:13Z1027.389.861027.471042.921011.74745.037.59745.1757.0733.0-0.111111151161615161171716151--16142025-05-01T21:03:43Z18.050.018.0518.0618.0515.760.0815.6815.8515.6614.760.0214.7514.7814.7317.610.1617.4917.8817.38-10.590.45-9.98-9.98-11.16-10.520.46-9.93-9.93-11.04-9.240.93-10.12-8.17-10.121331-29-34-17-398326343321344-16-6-6-2853543543327.931.117.010.15.77.630.97.99.46.2-7.10.93-6.92-5.75-9.551.70.661.543.4-0.032.380.872.264.551.05
602025-05-01T21:05:13Z1027.380.01027.341027.471027.34745.030.0745.0745.1745.0-0.13111111601616161711617161411315132025-05-01T21:04:43Z18.060.0118.0518.0718.0415.740.0815.7615.8515.6314.740.0114.7614.7514.7317.350.1717.317.4917.08-9.90.25-10.02-9.67-10.33-10.340.53-11.22-9.88-11.22-10.820.79-11.17-9.58-11.491336-24-1711-341334311326341-19-170-28934303328.051.6910.210.85.38.070.779.710.06.9-7.530.88-9.29-5.95-9.482.031.092.374.470.22.40.733.224.050.7
602025-05-01T21:06:13Z1027.360.01027.341027.471027.34745.020.0745.0745.1745.0-0.2811111161151715152151713152--17132025-05-01T21:05:43Z18.050.018.0818.0518.0415.890.0815.8615.9615.7614.760.0214.7114.7814.7417.470.1417.4217.6517.3-10.030.49-10.72-9.45-10.72-11.871.42-12.72-9.68-13.19-9.231.71-8.87-7.73-11.71342-18-17-17-345343343326346-14-6-6-2253543543389.251.179.711.47.29.050.739.010.57.8-8.030.79-7.89-6.45-9.782.20.753.833.80.852.350.782.074.220.45
602025-05-01T21:07:13Z1027.3313.551027.341048.761005.88745.010.44744.9761.5728.5-0.25111111511616141611517141411415132025-05-01T21:06:43Z18.070.0118.0618.118.0515.870.0315.8515.9115.8314.710.0114.7114.7314.717.660.2917.1918.0717.42-10.790.66-10.07-10.07-11.9-11.21.06-9.95-9.95-12.58-9.731.1-8.7-8.7-10.881343-17-17-17-343343343326345-15-6-6-2263543543389.151.089.310.66.98.90.579.810.17.5-8.130.78-8.67-6.63-10.352.80.793.434.351.12.650.742.194.250.9
602025-05-01T21:08:12Z1027.363.871027.341033.441021.23745.022.95745.0749.7740.3-0.18111111601717161521818141411615132025-05-01T21:07:42Z18.080.0118.0918.118.0615.70.1115.5315.8515.5614.660.0314.6114.7114.6317.490.1617.6917.6917.19-9.820.1-9.73-9.73-9.99-11.391.31-9.45-9.45-12.97-10.40.65-9.43-9.43-10.781343-17-17-17-170343343343348-12-11-6-1733493543439.350.939.211.37.59.480.638.510.88.5-8.250.63-8.03-7.33-9.782.850.462.253.61.952.250.562.833.881.52
602025-05-01T21:09:13Z1027.340.01027.341027.341027.34745.00.0745.1745.0745.0-0.211111170171717181181817134--16102025-05-01T21:08:43Z18.080.0118.0818.1118.0615.660.1315.9615.8515.5314.670.0414.814.7114.6117.690.1217.6517.8417.53-9.120.18-8.94-8.94-9.43-9.620.41-10.28-9.17-10.28-11.034.09---8.14-13.931339-21-17-17-348343343326344-16-11-6-2863493543329.050.8910.710.57.49.250.749.510.88.1-8.350.5-9.19-7.08-9.12.420.772.684.80.932.630.643.453.751.02
...................................................................................................................................................................................................................................................................................................................................................
602025-05-02T09:51:11Z1027.490.01027.61027.61027.47745.120.05745.2745.2745.1-0.5111111301313131301313131301313132025-05-02T09:50:41Z17.10.0117.117.1217.0814.720.0314.6414.7614.6714.850.0114.8414.8714.8415.680.1815.3215.9715.51-13.010.04-13.05-12.95-13.05-13.120.05-13.2-13.07-13.2-12.930.24-12.95-12.46-13.111881111631111622-611-116354113494.050.424.24.93.24.90.476.65.84.0-4.050.46-5.18-3.35-5.432.880.192.83.352.51.630.241.732.21.1
602025-05-02T09:52:11Z1027.470.091027.471027.61027.34745.10.15745.1745.2745.0-0.58111111401414131301313131311313122025-05-02T09:51:41Z17.080.0117.117.117.0614.650.0414.7514.7414.6214.890.0414.9914.9414.8415.320.0915.0915.415.17-12.940.1-12.83-12.83-13.08-13.160.06-13.06-13.06-13.21-13.130.47---12.64-13.731353-7-1711-341834311326346-1400-341136003265.130.934.77.14.06.050.544.76.95.0-5.250.84-4.01-3.95-7.131.950.770.992.950.231.770.442.133.031.08
602025-05-02T09:53:11Z1027.440.231027.471027.471027.34745.080.24745.1745.1745.0-0.58111111401414131301313131301313122025-05-02T09:52:41Z17.10.0117.0817.1117.0814.730.0214.6914.7614.714.990.0114.9715.014.9715.190.0615.3215.2815.09-12.940.04-12.92-12.88-13.0-13.150.06-13.09-13.08-13.21-13.090.41-12.92-12.82-13.911337-23-17-17-399343343321340-20-170-391134303215.330.534.46.44.55.470.725.17.14.3-5.150.58-4.38-4.0-6.61.10.732.042.08-0.251.80.381.142.51.08
602025-05-02T09:54:11Z1027.490.01027.471027.61027.47745.120.05745.1745.2745.1-0.53111111401414141301313131301413132025-05-02T09:53:41Z17.090.0117.0717.1117.0814.680.0114.6914.6914.6614.950.0114.9414.9714.9415.280.0415.415.3215.21-12.880.03-12.83-12.83-12.92-13.060.02-13.06-13.04-13.1-12.890.06-12.92-12.83-12.951350-101111-17121111343352-800-22736003384.970.565.36.83.85.280.466.26.14.1-4.60.46-4.55-3.63-5.652.30.273.013.01.71.450.261.581.930.78
602025-05-02T09:55:11Z1027.446.381027.471037.471017.33745.084.91745.1752.8737.3-0.5811111140141414130131313131--14122025-05-02T09:54:41Z17.090.0117.117.0917.0714.680.0114.6314.6914.6714.940.0114.9814.9514.9215.460.1215.5115.6315.32-12.780.07-12.78-12.7-12.88-13.050.07-13.11-12.95-13.12-12.560.66-13.21-11.86-13.321357-3-1711-171434311343351-906-22936063385.250.675.96.54.05.80.626.47.34.9-4.850.49-5.27-3.88-6.152.380.572.513.31.251.30.431.641.95-0.23
602025-05-02T09:56:10Z1027.473.771027.471033.441021.49745.12.91745.1749.7740.5-0.5311111140141414130131313140--14132025-05-02T09:55:40Z17.090.0117.0617.117.0614.620.0414.7514.6914.5815.00.0215.0315.0314.9815.750.1815.5115.9715.51-12.80.05-12.76-12.75-12.89-13.010.06-12.99-12.91-13.09-11.90.47-12.52-11.44-12.521352-8611-1713611343349-11110-34111103265.530.44.16.04.45.950.464.96.94.7-5.050.41-3.23-4.45-6.332.150.632.93.170.651.850.292.22.421.1
602025-05-02T09:57:10Z1027.4148.91027.471104.6949.97745.137.63745.1804.6685.6-0.5111111401314131301313131301313132025-05-02T09:56:40Z17.090.0217.0817.1117.0614.780.0314.7414.8114.7515.020.0214.9715.0414.9915.450.0615.4715.5115.4-12.720.12-12.93-12.55-12.93-13.050.06-13.14-12.99-13.14-12.790.08-12.74-12.71-12.911551111-17101111343358-2-611-178354113434.470.934.16.53.45.380.425.36.14.4-4.40.63-3.99-3.05-6.082.670.492.093.421.481.430.421.532.50.57
602025-05-02T09:58:10Z1027.440.01027.471027.471027.34745.080.0745.1745.1745.0-0.52111111401314131301313131211313112025-05-02T09:57:40Z17.080.0117.0517.117.0814.770.0314.8914.8214.7415.010.0215.0515.0414.9715.470.0715.2415.5515.36-12.830.06-12.77-12.77-12.94-13.310.05-13.21-13.21-13.36-13.470.82-14.24-12.63-14.58166611-179611343356-4011-177360113434.470.435.05.53.65.650.45.76.54.7-4.220.47-4.11-3.23-5.42.780.463.033.71.71.30.320.992.130.68
602025-05-02T09:59:10Z1027.446.651027.471037.991016.94745.085.13745.1753.2737.0-0.48111111301314131301313131301314132025-05-02T09:58:40Z17.060.0117.0617.0817.0514.850.0514.7714.914.7915.030.0214.9715.0514.9915.260.115.415.415.09-12.870.08-12.96-12.76-12.96-13.060.06-13.02-12.98-13.15-12.650.4-12.51-12.02-13.03155611-171061134311611-656113544.430.783.76.73.45.90.745.37.34.5-4.40.65-3.71-3.5-5.73.050.213.043.532.61.380.351.552.30.73
602025-05-02T10:00:10Z1027.4741.711027.471093.35961.46745.1332.1745.0795.9694.4-0.48111111301313131301313131311314132025-05-02T09:59:40Z17.080.0117.0917.0917.0614.740.0314.7814.7914.7214.940.0214.9314.9714.9215.260.1315.0915.415.09-13.080.09-12.96-12.96-13.18-13.150.1-13.29-13.04-13.29-12.880.58-12.94-11.75-13.35133-1711-1712343113433600-176-17634363434.030.655.85.53.25.330.465.35.94.2-4.220.56-5.57-3.4-5.82.670.41.533.851.81.350.381.172.00.08
" + ], + "text/plain": [ + "\n", + "integration midpoint_date ... wind_speedw_20m_max wind_speedw_20m_min\n", + " s ... m.s**(-1) m.s**(-1) \n", + " int16 object ... float32 float32 \n", + "----------- -------------------- ... ------------------- -------------------\n", + " 60 2025-05-01T21:01:11Z ... 3.67 1.4\n", + " 60 2025-05-01T21:02:11Z ... 3.75 1.55\n", + " 60 2025-05-01T21:03:11Z ... 4.05 0.75\n", + " 60 2025-05-01T21:04:13Z ... 4.55 1.05\n", + " 60 2025-05-01T21:05:13Z ... 4.05 0.7\n", + " 60 2025-05-01T21:06:13Z ... 4.22 0.45\n", + " 60 2025-05-01T21:07:13Z ... 4.25 0.9\n", + " 60 2025-05-01T21:08:12Z ... 3.88 1.52\n", + " 60 2025-05-01T21:09:13Z ... 3.75 1.02\n", + " ... ... ... ... ...\n", + " 60 2025-05-02T09:51:11Z ... 2.2 1.1\n", + " 60 2025-05-02T09:52:11Z ... 3.03 1.08\n", + " 60 2025-05-02T09:53:11Z ... 2.5 1.08\n", + " 60 2025-05-02T09:54:11Z ... 1.93 0.78\n", + " 60 2025-05-02T09:55:11Z ... 1.95 -0.23\n", + " 60 2025-05-02T09:56:10Z ... 2.42 1.1\n", + " 60 2025-05-02T09:57:10Z ... 2.5 0.57\n", + " 60 2025-05-02T09:58:10Z ... 2.13 0.68\n", + " 60 2025-05-02T09:59:10Z ... 2.3 0.73\n", + " 60 2025-05-02T10:00:10Z ... 2.0 0.08" + ] + }, + "execution_count": 7, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "table" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6a716474", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "astroquery_testing", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.9.25" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/astroquery/eso/tests/test_eso.py b/astroquery/eso/tests/test_eso.py index 758623e7a6..19afc0865a 100644 --- a/astroquery/eso/tests/test_eso.py +++ b/astroquery/eso/tests/test_eso.py @@ -62,6 +62,16 @@ def data_path(filename): "select table_name from TAP_SCHEMA.tables where schema_name='ist' order by table_name": "query_list_instruments.csv", + + "select table_name from TAP_SCHEMA.tables where schema_name='asm' order by table_name": + "query_list_asm.csv", + + "select column_name, datatype, xtype, unit from TAP_SCHEMA.columns " + "where table_name = 'asm.ambient_lasilla'": + "query_asm_columns_ambient_lasilla.csv", + + "select temperature, humidity from asm.ambient_lasilla where temperature > 10": + "query_asm_ambient_lasilla.csv", } } @@ -69,6 +79,8 @@ def data_path(filename): '081.C-0827', 'ADHOC', 'CAFFEINE', 'ENTROPY', 'GAIAESO', 'HARPS', 'INSPIRE', 'KIDS', 'ZCOSMOS'] TEST_INSTRUMENTS = [ 'amber', 'crires', 'espresso', 'fors1', 'giraffe', 'gravity', 'midi', 'xshooter'] +TEST_ASM = [ + 'ambient_lasilla', 'dimm_paranal', 'meteo_paranal'] def eso_request(request_type, url, **kwargs): @@ -193,6 +205,35 @@ def test_list_instruments(monkeypatch): assert set(TEST_INSTRUMENTS) <= set(saved_list) +def test_list_asm(monkeypatch): + eso = Eso() + monkeypatch.setattr(eso, 'query_tap', monkey_tap) + saved_list = eso.list_asm() + assert isinstance(saved_list, list) + assert set(TEST_ASM) <= set(saved_list) + + +def test_query_asm(monkeypatch): + eso = Eso() + monkeypatch.setattr(eso, 'query_tap', monkey_tap) + result = eso.query_asm( + 'asm.ambient_lasilla', + columns=['temperature', 'humidity'], + column_filters={ + 'temperature': '> 10' + } + ) + assert len(result) == 2 + assert 'temperature' in result.colnames + + +def test_query_asm_unknown_column(monkeypatch): + eso = Eso() + monkeypatch.setattr(eso, 'query_tap', monkey_tap) + with pytest.raises(ValueError, match="Unknown column"): + eso.query_asm('ambient_lasilla', columns=['not_a_column']) + + def test_authenticate(monkeypatch): # monkeypatch instructions from https://pytest.org/latest/monkeypatch.html eso = Eso() diff --git a/astroquery/eso/tests/test_eso_remote.py b/astroquery/eso/tests/test_eso_remote.py index 532229fa29..a8e8f70e40 100644 --- a/astroquery/eso/tests/test_eso_remote.py +++ b/astroquery/eso/tests/test_eso_remote.py @@ -233,6 +233,14 @@ def test_list_instruments(self): assert set(inst) == set(instrument_list), \ f"Expected result {instrument_list}; Obtained: {inst}" + def test_query_asm_payload(self): + eso = Eso() + asm_tables = eso.list_asm() + if not asm_tables: + pytest.skip("No ASM tables available") + query = eso.query_asm(asm_tables[0], get_query_payload=True) + assert f"from asm.{asm_tables[0]}" in query + def test_retrieve_data(self): eso = Eso() file_id = 'AMBER.2006-03-14T07:40:19.830' diff --git a/setup.cfg b/setup.cfg index ecdc423640..9d128fac73 100644 --- a/setup.cfg +++ b/setup.cfg @@ -37,7 +37,9 @@ show-response = 1 [tool:pytest] minversion = 7.4 norecursedirs = build docs/_build astroquery/irsa astroquery/nasa_exoplanet_archive astroquery/ned astroquery/ibe astroquery/irsa_dust astroquery/cds astroquery/sha astroquery/dace -testpaths = astroquery docs +testpaths = + docs/eso + astroquery/eso doctest_plus = enabled astropy_header = true text_file_format = rst diff --git a/tox.ini b/tox.ini index 5c19109f91..896c0f8341 100644 --- a/tox.ini +++ b/tox.ini @@ -68,12 +68,12 @@ commands = devdeps: pip install -U --pre --no-deps --extra-index-url https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy python -m pip freeze - !cov: pytest --pyargs astroquery {toxinidir}/docs {env:PYTEST_ARGS} {posargs} - cov: pytest --pyargs astroquery {toxinidir}/docs --cov astroquery --cov-config={toxinidir}/setup.cfg {env:PYTEST_ARGS} {posargs} + !cov: pytest --pyargs astroquery.eso {toxinidir}/docs/eso {env:PYTEST_ARGS} {posargs} + cov: pytest --pyargs astroquery.eso {toxinidir}/docs/eso --cov astroquery.eso --cov-config={toxinidir}/setup.cfg {env:PYTEST_ARGS} {posargs} # For remote tests, we re-run the failures to filter out at least some of the flaky ones. # We use a second pytest run with --last-failed as opposed to --rerun in order to rerun the # failed ones at the end rather than right away. - online: pytest --pyargs astroquery {toxinidir}/docs {env:PYTEST_ARGS_2} {posargs} + online: pytest --pyargs astroquery.eso {toxinidir}/docs/eso {env:PYTEST_ARGS_2} {posargs} cov: coverage xml -o {toxinidir}/coverage.xml pip_pre =