From 94560b1674d427319b424b8e63416273e10af41a Mon Sep 17 00:00:00 2001 From: Jeff Jennings Date: Wed, 25 Sep 2024 20:46:22 -0400 Subject: [PATCH 1/9] color-excess: ensure path reachable --- tutorials/color-excess/color-excess.ipynb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tutorials/color-excess/color-excess.ipynb b/tutorials/color-excess/color-excess.ipynb index 4380d2e5..040ec2f7 100644 --- a/tutorials/color-excess/color-excess.ipynb +++ b/tutorials/color-excess/color-excess.ipynb @@ -201,7 +201,7 @@ "outputs": [], "source": [ "download_dir = pathlib.Path('~/.astropy/cache/astroquery/Mast').expanduser()\n", - "download_dir.mkdir(exist_ok=True)\n", + "download_dir.mkdir(exist_ok=True, parents=True)\n", "\n", "obsTable = Observations.query_object(\"HD 147933\", radius=\"1 arcsec\")\n", "obsTable_spec = obsTable[obsTable['dataproduct_type'] == 'spectrum']\n", @@ -654,14 +654,22 @@ } ], "metadata": { + "kernelspec": { + "display_name": "astropy-tutorials", + "language": "python", + "name": "python3" + }, "language_info": { "codemirror_mode": { - "name": "ipython" + "name": "ipython", + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", - "nbconvert_exporter": "python" + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.5" } }, "nbformat": 4, From 83a2c4eef38f067bb93e6bfe694d45addd0fb59d Mon Sep 17 00:00:00 2001 From: Jeff Jennings Date: Wed, 25 Sep 2024 20:48:04 -0400 Subject: [PATCH 2/9] color-excess: don't hardcode table entry --- tutorials/color-excess/color-excess.ipynb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tutorials/color-excess/color-excess.ipynb b/tutorials/color-excess/color-excess.ipynb index 040ec2f7..9b0c93cf 100644 --- a/tutorials/color-excess/color-excess.ipynb +++ b/tutorials/color-excess/color-excess.ipynb @@ -214,7 +214,10 @@ "metadata": {}, "outputs": [], "source": [ - "obsids = obsTable_spec[39]['obsid']\n", + "# retrieve a specific 'obs_id' corresponding to the IUE spectrum\n", + "obsTable_spec.add_index('obs_id')\n", + "obsids = obsTable_spec.loc['lwr05639']['obsid']\n", + "\n", "dataProductsByID = Observations.get_product_list(obsids)\n", "manifest = Observations.download_products(dataProductsByID, \n", " download_dir=str(download_dir))" From 3eb97cca0f2d5c69f681ab859aa0a263db04b9c4 Mon Sep 17 00:00:00 2001 From: Jeff Jennings Date: Wed, 25 Sep 2024 20:56:17 -0400 Subject: [PATCH 3/9] conesearch: invalid url catch --- tutorials/vo/conesearch.ipynb | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tutorials/vo/conesearch.ipynb b/tutorials/vo/conesearch.ipynb index a671c76d..abb8bd08 100755 --- a/tutorials/vo/conesearch.ipynb +++ b/tutorials/vo/conesearch.ipynb @@ -243,7 +243,10 @@ "outputs": [], "source": [ "my_db = vos_catalog.get_remote_catalog_db(conf.conesearch_dbname)\n", - "my_cat = my_db.get_catalog_by_url(result.url + '&')\n", + "try:\n", + " my_cat = my_db.get_catalog_by_url(result.url)\n", + "except AttributeError:\n", + " my_cat = my_db.get_catalog_by_url(result.url + '&')\n", "print(my_cat.dumps())" ] }, @@ -517,14 +520,22 @@ "name": "", "published": false }, + "kernelspec": { + "display_name": "astropy-tutorials", + "language": "python", + "name": "python3" + }, "language_info": { "codemirror_mode": { - "name": "ipython" + "name": "ipython", + "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", - "nbconvert_exporter": "python" + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.12.5" } }, "nbformat": 4, From 6ccd4d6b355a1aa087bdfab0735cae38760e60e9 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 12:30:41 +0000 Subject: [PATCH 4/9] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tutorials/color-excess/color-excess.ipynb | 12 ++---------- tutorials/vo/conesearch.ipynb | 12 ++---------- 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/tutorials/color-excess/color-excess.ipynb b/tutorials/color-excess/color-excess.ipynb index 9b0c93cf..f105efa1 100644 --- a/tutorials/color-excess/color-excess.ipynb +++ b/tutorials/color-excess/color-excess.ipynb @@ -657,22 +657,14 @@ } ], "metadata": { - "kernelspec": { - "display_name": "astropy-tutorials", - "language": "python", - "name": "python3" - }, "language_info": { "codemirror_mode": { - "name": "ipython", - "version": 3 + "name": "ipython" }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.12.5" + "nbconvert_exporter": "python" } }, "nbformat": 4, diff --git a/tutorials/vo/conesearch.ipynb b/tutorials/vo/conesearch.ipynb index abb8bd08..e16b141b 100755 --- a/tutorials/vo/conesearch.ipynb +++ b/tutorials/vo/conesearch.ipynb @@ -520,22 +520,14 @@ "name": "", "published": false }, - "kernelspec": { - "display_name": "astropy-tutorials", - "language": "python", - "name": "python3" - }, "language_info": { "codemirror_mode": { - "name": "ipython", - "version": 3 + "name": "ipython" }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.12.5" + "nbconvert_exporter": "python" } }, "nbformat": 4, From 5cac0bdb8b0e7e5feeb03315cc0d915090eea79e Mon Sep 17 00:00:00 2001 From: Jeff Jennings Date: Thu, 26 Sep 2024 10:08:17 -0400 Subject: [PATCH 5/9] SpectralCubeReprojectExample: frequency mismatch workaround --- .../SpectralCubeReprojectExample.ipynb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/tutorials/spectral-cube-reprojection/SpectralCubeReprojectExample.ipynb b/tutorials/spectral-cube-reprojection/SpectralCubeReprojectExample.ipynb index 68685e15..5558ffe4 100644 --- a/tutorials/spectral-cube-reprojection/SpectralCubeReprojectExample.ipynb +++ b/tutorials/spectral-cube-reprojection/SpectralCubeReprojectExample.ipynb @@ -523,7 +523,14 @@ "metadata": {}, "outputs": [], "source": [ - "cube2vel_reproj = cube2vel_spatialspectralsmooth.reproject(cube1vel.header)\n", + "# first we make a copy of the target (cube1vel) header and set its rest frequency \n", + "# to that of the cube we're reprojecting (cube2vel_spatialspectralsmooth)\n", + "# (see https://github.com/radio-astro-tools/spectral-cube/issues/874)\n", + "tgthdr = cube1vel.header\n", + "tgthdr['RESTFRQ'] = cube2vel_spatialspectralsmooth.header['RESTFRQ']\n", + "\n", + "# now we continue with the reprojection\n", + "cube2vel_reproj = cube2vel_spatialspectralsmooth.reproject(tgthdr)\n", "cube2vel_reproj" ] }, @@ -615,7 +622,7 @@ " cube2daskvel_spectralresample = cube2daskvel_smooth.spectral_interpolate(cube1vel.spectral_axis,\n", " suppress_smooth_warning=True)\n", " cube2daskvel_spatialspectralsmooth = cube2daskvel_spectralresample.convolve_to(common_beam)\n", - " cube2daskvel_reproj = cube2daskvel_spatialspectralsmooth.reproject(cube1vel.header)\n", + " cube2daskvel_reproj = cube2daskvel_spatialspectralsmooth.reproject(tgthdr) # as above, tgthdr is altered cube1vel header\n", "cube2daskvel_reproj" ] }, From 25e24c71f8143c23a27d9253b8b1e7d64f3559ca Mon Sep 17 00:00:00 2001 From: Jeff Jennings Date: Thu, 26 Sep 2024 10:23:14 -0400 Subject: [PATCH 6/9] astroquery dep version --- requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index d9e8f537..15bdcfa1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,12 +1,12 @@ astropy -astroquery +astroquery>=0.4.8.dev9474 # 2024-09-24 pinned for Gaia column capitalization issue IPython matplotlib numpy jupyter scipy notebook -spectral-cube @ git+https://github.com/radio-astro-tools/spectral-cube # as of: 2021-09-21 +spectral-cube radio-beam reproject dust_extinction From c7274308d55e716d7df9c62d60e6adde89df1271 Mon Sep 17 00:00:00 2001 From: Jeff Jennings Date: Thu, 26 Sep 2024 10:54:20 -0400 Subject: [PATCH 7/9] color-excess: update add_votable_fields syntax --- tutorials/color-excess/color-excess.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/color-excess/color-excess.ipynb b/tutorials/color-excess/color-excess.ipynb index f105efa1..6f14d191 100644 --- a/tutorials/color-excess/color-excess.ipynb +++ b/tutorials/color-excess/color-excess.ipynb @@ -271,7 +271,7 @@ "outputs": [], "source": [ "custom_query = Simbad()\n", - "custom_query.add_votable_fields('fluxdata(U)','fluxdata(B)','fluxdata(V)')\n", + "custom_query.add_votable_fields('U','B','V')\n", "phot_table=custom_query.query_object('HD 147933')\n", "Umag=phot_table['FLUX_U']\n", "Bmag=phot_table['FLUX_B']\n", From 8a980ebe85145e1b9d58e47af0a7e8fea9ee1469 Mon Sep 17 00:00:00 2001 From: Jeff Jennings Date: Thu, 26 Sep 2024 11:06:30 -0400 Subject: [PATCH 8/9] color-excess: phot_table keys --- tutorials/color-excess/color-excess.ipynb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tutorials/color-excess/color-excess.ipynb b/tutorials/color-excess/color-excess.ipynb index 6f14d191..337238d1 100644 --- a/tutorials/color-excess/color-excess.ipynb +++ b/tutorials/color-excess/color-excess.ipynb @@ -273,9 +273,9 @@ "custom_query = Simbad()\n", "custom_query.add_votable_fields('U','B','V')\n", "phot_table=custom_query.query_object('HD 147933')\n", - "Umag=phot_table['FLUX_U']\n", - "Bmag=phot_table['FLUX_B']\n", - "Vmag=phot_table['FLUX_V']" + "Umag=phot_table['U']\n", + "Bmag=phot_table['B']\n", + "Vmag=phot_table['V']" ] }, { From f47ae016744c9d37c288a481547c877d082007cf Mon Sep 17 00:00:00 2001 From: Jeff Jennings Date: Thu, 26 Sep 2024 11:15:45 -0400 Subject: [PATCH 9/9] temp pin numpy version for build test --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 15bdcfa1..dc3fac9d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ astropy astroquery>=0.4.8.dev9474 # 2024-09-24 pinned for Gaia column capitalization issue IPython matplotlib -numpy +numpy==1.26.4 # temporary for build test jupyter scipy notebook