-
-
Notifications
You must be signed in to change notification settings - Fork 427
Euclid: New remote tests #3407
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
bsipocz
merged 4 commits into
astropy:main
from
esdc-esac-esa-int:ESA_euclid_EUCLIDSWRQ-247_new_remote_tests
Sep 18, 2025
Merged
Euclid: New remote tests #3407
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| import astropy.units as u | ||
| import pytest | ||
| from astropy.coordinates import SkyCoord | ||
|
|
||
| from astroquery.esa.euclid import EuclidClass | ||
| from astroquery.utils.tap.model.filter import Filter | ||
|
|
||
|
|
||
| @pytest.mark.remote_data | ||
| def test_query_object_columns_with_radius(): | ||
| euclid = EuclidClass() | ||
| sc = SkyCoord(ra=0 * u.deg, dec=0 * u.deg) | ||
| table = euclid.query_object(sc, radius=10 * u.arcsec, columns=['right_ascension'], async_job=True) | ||
| assert table.colnames == ['right_ascension', 'dist'] | ||
|
|
||
|
|
||
| @pytest.mark.remote_data | ||
| @pytest.mark.filterwarnings("ignore::astropy.units.UnitsWarning") | ||
| def test_query_object_row_limit(): | ||
| euclid = EuclidClass() | ||
| coord = SkyCoord(ra=265.8, dec=64.1, unit=(u.degree, u.degree), frame='icrs') | ||
| width = u.Quantity(0.1, u.deg) | ||
| height = u.Quantity(0.1, u.deg) | ||
| r = euclid.query_object(coordinate=coord, width=width, height=height, async_job=True, verbose=True) | ||
|
|
||
| assert len(r) == 50 | ||
|
|
||
| euclid.ROW_LIMIT = 10 | ||
| r = euclid.query_object(coordinate=coord, width=width, height=height, async_job=True) | ||
|
|
||
| assert len(r) == 10 == euclid.ROW_LIMIT | ||
|
|
||
| euclid.ROW_LIMIT = -1 | ||
| r = euclid.query_object(coordinate=coord, width=width, height=height, async_job=True, verbose=True) | ||
|
|
||
| assert len(r) == 1948 | ||
|
|
||
|
|
||
| @pytest.mark.remote_data | ||
| def test_cone_search_row_limit(): | ||
| euclid = EuclidClass() | ||
| coord = SkyCoord(ra=265.8, dec=64.1, unit=(u.degree, u.degree), frame='icrs') | ||
| radius = u.Quantity(0.1, u.deg) | ||
| j = euclid.cone_search(coord, radius=radius, async_job=True) | ||
| r = j.get_results() | ||
|
|
||
| assert len(r) == euclid.ROW_LIMIT | ||
|
|
||
| euclid.ROW_LIMIT = 10 | ||
| j = euclid.cone_search(coord, radius=radius, async_job=True) | ||
| r = j.get_results() | ||
|
|
||
| assert len(r) == 10 == euclid.ROW_LIMIT | ||
|
|
||
| euclid.ROW_LIMIT = -1 | ||
| j = euclid.cone_search(coord, radius=radius, async_job=True) | ||
| r = j.get_results() | ||
|
|
||
| assert len(r) == 14606 | ||
|
|
||
|
|
||
| @pytest.mark.remote_data | ||
| def test_search_async_jobs(): | ||
| euclid = EuclidClass() | ||
| jobfilter = Filter() | ||
| jobfilter.limit = 10 | ||
| jobs = euclid.search_async_jobs(jobfilter=jobfilter, verbose=True) | ||
| assert len(jobs) == 10 | ||
|
|
||
|
|
||
| @pytest.mark.remote_data | ||
| def test_get_tables(): | ||
| euclid = EuclidClass() | ||
| r = euclid.load_tables() | ||
| assert len(r) > 1 | ||
|
|
||
| table = euclid.load_table("catalogue.mer_catalogue") | ||
| assert len(table.columns) == 471 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -282,8 +282,7 @@ In the following example, for the Clusters of Galaxies category, and the group G | |
|
|
||
| This query performs a cone search centered at the specified ra/dec coordinates with the provided radius argument. | ||
|
|
||
| .. Skipping authentication requiring examples | ||
| .. doctest-skip:: | ||
| .. doctest-remote-data:: | ||
|
||
|
|
||
| >>> #example cone search for source NGC6505 | ||
| >>> from astroquery.esa.euclid import Euclid | ||
|
|
@@ -298,21 +297,20 @@ This query performs a cone search centered at the specified ra/dec coordinates w | |
| Found 27 results | ||
| >>> cone_results['tile_index', 'creation_date', 'ra', 'dec', 'file_name', 'file_path', 'datalabs_path', 'filter_name', 'dist'][:5] | ||
| <Table length=5> | ||
| tile_index creation_date ra dec file_name file_path datalabs_path filter_name dist | ||
| int64 str23 float64 float64 str88 str55 str43 str11 float64 | ||
| ---------- ----------------------- ----------- ------- ------------------------------------------------------------------------------------- ------------------------------------------------------- ------------------------------------------- ----------- ------------------- | ||
| 102158889 2024-10-26T14:01:21.038 267.3807789 65.4983 EUC_MER_BGSUB-MOSAIC-CFIS-R_TILE102158889-4366B7_20241024T203624.450577Z_00.00.fits /euclid/repository_idr/iqr1/Q1_R1/MER/102158889/MEGACAM /data/euclid_q1/Q1_R1/MER/102158889/MEGACAM MEGACAM_r 0.16895922479034217 | ||
| 102158889 2024-10-26T13:50:13.676 267.3807789 65.4983 EUC_MER_BGSUB-MOSAIC-WISHES-G_TILE102158889-3DC3C3_20241024T205647.635112Z_00.00.fits /euclid/repository_idr/iqr1/Q1_R1/MER/102158889/HSC /data/euclid_q1/Q1_R1/MER/102158889/HSC HSC_g 0.16895922479034217 | ||
| 102158889 2024-10-26T13:37:09.628 267.3807789 65.4983 EUC_MER_BGSUB-MOSAIC-NIR-Y_TILE102158889-AC6585_20241024T225321.344048Z_00.00.fits /euclid/repository_idr/iqr1/Q1_R1/MER/102158889/NISP /data/euclid_q1/Q1_R1/MER/102158889/NISP NIR_Y 0.16895922479034217 | ||
| 102158889 2024-10-26T14:05:09.98 267.3807789 65.4983 EUC_MER_BGSUB-MOSAIC-CFIS-U_TILE102158889-9E97F_20241024T204431.839748Z_00.00.fits /euclid/repository_idr/iqr1/Q1_R1/MER/102158889/MEGACAM /data/euclid_q1/Q1_R1/MER/102158889/MEGACAM MEGACAM_u 0.16895922479034217 | ||
| 102158889 2024-10-26T13:10:32.453 267.3807789 65.4983 EUC_MER_BGSUB-MOSAIC-NIR-H_TILE102158889-ED035A_20241024T212936.705156Z_00.00.fits /euclid/repository_idr/iqr1/Q1_R1/MER/102158889/NISP /data/euclid_q1/Q1_R1/MER/102158889/NISP NIR_H 0.16895922479034217 | ||
| tile_index creation_date ra dec ... file_path datalabs_path filter_name dist | ||
| int64 str23 float64 float64 ... str55 str43 str11 float64 | ||
| ---------- ----------------------- ----------- ------- ... ------------------------------------------------------- ------------------------------------------- ----------- ------------------- | ||
| 102158889 2024-10-26T14:01:21.038 267.3807789 65.4983 ... /euclid/repository_idr/iqr1/Q1_R1/MER/102158889/MEGACAM /data/euclid_q1/Q1_R1/MER/102158889/MEGACAM MEGACAM_r 0.16895922479034217 | ||
| 102158889 2024-10-26T13:50:13.676 267.3807789 65.4983 ... /euclid/repository_idr/iqr1/Q1_R1/MER/102158889/HSC /data/euclid_q1/Q1_R1/MER/102158889/HSC HSC_g 0.16895922479034217 | ||
| 102158889 2024-10-26T13:37:09.628 267.3807789 65.4983 ... /euclid/repository_idr/iqr1/Q1_R1/MER/102158889/NISP /data/euclid_q1/Q1_R1/MER/102158889/NISP NIR_Y 0.16895922479034217 | ||
| 102158889 2024-10-26T14:05:09.98 267.3807789 65.4983 ... /euclid/repository_idr/iqr1/Q1_R1/MER/102158889/MEGACAM /data/euclid_q1/Q1_R1/MER/102158889/MEGACAM MEGACAM_u 0.16895922479034217 | ||
| 102158889 2024-10-26T13:10:32.453 267.3807789 65.4983 ... /euclid/repository_idr/iqr1/Q1_R1/MER/102158889/NISP /data/euclid_q1/Q1_R1/MER/102158889/NISP NIR_H 0.16895922479034217 | ||
|
|
||
|
|
||
|
|
||
| Queries return a limited number of rows controlled by ``Euclid.ROW_LIMIT``. To change the default behaviour set this appropriately. | ||
|
|
||
| .. Skipping authentication requiring examples | ||
| .. doctest-skip:: | ||
| .. doctest-remote-data:: | ||
|
|
||
| >>> Euclid.ROW_LIMIT = 2 | ||
| >>> job = Euclid.cone_search(coordinate=coord, radius=radius, table_name="sedm.mosaic_product", ra_column_name="ra", dec_column_name="dec", columns="*", async_job=True) | ||
|
|
@@ -336,9 +334,7 @@ The following example searches for all the sources contained in an squared regio | |
|
|
||
| The method returns the job results as astropy.table | ||
|
|
||
|
|
||
| .. Skipping authentication requiring examples | ||
| .. doctest-skip:: | ||
| .. doctest-remote-data:: | ||
|
|
||
| >>> # Search for objects around a given position with the default catalog catalogue.mer_catalogue | ||
| >>> from astroquery.esa.euclid import Euclid | ||
|
|
@@ -371,8 +367,7 @@ Synchronous queries like this one return a limited number of rows -> 2000 | |
|
|
||
| The previous query can be executed as an asynchronous version: | ||
|
|
||
| .. Skipping authentication requiring examples | ||
| .. doctest-skip:: | ||
| .. doctest-remote-data:: | ||
|
|
||
| >>> from astroquery.esa.euclid import Euclid | ||
| >>> from astropy.coordinates import SkyCoord | ||
|
|
@@ -835,8 +830,7 @@ In the Euclid archive user tables can be shared among user groups. | |
|
|
||
| To obtain a list of the tables shared to a user type the following: | ||
|
|
||
| .. Skipping authentication requiring examples | ||
| .. doctest-skip:: | ||
| .. doctest-remote-data:: | ||
|
|
||
| >>> from astroquery.esa.euclid import Euclid | ||
| >>> tables = Euclid.load_tables(only_names=True, include_shared_tables=True) | ||
|
|
@@ -977,7 +971,7 @@ table named: user_<your_login_name>.'t'<job_id>: | |
|
|
||
| >>> from astroquery.esa.euclid import Euclid | ||
| >>> Euclid.login() | ||
| >>> job_1 = Euclid.launch_job_async("select top 10 * from Eucliddr3.Euclid_source") | ||
| >>> job_1 = Euclid.launch_job_async("select top 10 * from catalogue.mer_catalogue") | ||
| >>> Euclid.upload_table_from_job(job=job_1) | ||
| Created table 't1539932994481O' from job: '1539932994481O'. | ||
|
|
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test fails with a vounit warning, I would put that into a pytest.warns context manager here knowing that we will be able to clean it up once upstream is changing behaviour