Skip to content
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

[WIP] Broken notebooks #605

Merged
merged 9 commits into from
Sep 27, 2024
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
astropy
astroquery
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
spectral-cube @ git+https://github.com/radio-astro-tools/spectral-cube # as of: 2021-09-21
spectral-cube
radio-beam
reproject
dust_extinction
Expand Down
15 changes: 9 additions & 6 deletions tutorials/color-excess/color-excess.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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))"
Expand Down Expand Up @@ -268,11 +271,11 @@
"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",
"Vmag=phot_table['FLUX_V']"
"Umag=phot_table['U']\n",
"Bmag=phot_table['B']\n",
"Vmag=phot_table['V']"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
},
Expand Down Expand Up @@ -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"
]
},
Expand Down
5 changes: 4 additions & 1 deletion tutorials/vo/conesearch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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())"
]
},
Expand Down
Loading