Skip to content

Commit bc659a3

Browse files
authored
Merge pull request #605 from jeffjennings/broken_notebooks
[WIP] Broken notebooks
2 parents 306f81f + f47ae01 commit bc659a3

File tree

4 files changed

+25
-12
lines changed

4 files changed

+25
-12
lines changed

requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
astropy
2-
astroquery
2+
astroquery>=0.4.8.dev9474 # 2024-09-24 pinned for Gaia column capitalization issue
33
IPython
44
matplotlib
5-
numpy
5+
numpy==1.26.4 # temporary for build test
66
jupyter
77
scipy
88
notebook
9-
spectral-cube @ git+https://github.com/radio-astro-tools/spectral-cube # as of: 2021-09-21
9+
spectral-cube
1010
radio-beam
1111
reproject
1212
dust_extinction

tutorials/color-excess/color-excess.ipynb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
"outputs": [],
202202
"source": [
203203
"download_dir = pathlib.Path('~/.astropy/cache/astroquery/Mast').expanduser()\n",
204-
"download_dir.mkdir(exist_ok=True)\n",
204+
"download_dir.mkdir(exist_ok=True, parents=True)\n",
205205
"\n",
206206
"obsTable = Observations.query_object(\"HD 147933\", radius=\"1 arcsec\")\n",
207207
"obsTable_spec = obsTable[obsTable['dataproduct_type'] == 'spectrum']\n",
@@ -214,7 +214,10 @@
214214
"metadata": {},
215215
"outputs": [],
216216
"source": [
217-
"obsids = obsTable_spec[39]['obsid']\n",
217+
"# retrieve a specific 'obs_id' corresponding to the IUE spectrum\n",
218+
"obsTable_spec.add_index('obs_id')\n",
219+
"obsids = obsTable_spec.loc['lwr05639']['obsid']\n",
220+
"\n",
218221
"dataProductsByID = Observations.get_product_list(obsids)\n",
219222
"manifest = Observations.download_products(dataProductsByID, \n",
220223
" download_dir=str(download_dir))"
@@ -268,11 +271,11 @@
268271
"outputs": [],
269272
"source": [
270273
"custom_query = Simbad()\n",
271-
"custom_query.add_votable_fields('fluxdata(U)','fluxdata(B)','fluxdata(V)')\n",
274+
"custom_query.add_votable_fields('U','B','V')\n",
272275
"phot_table=custom_query.query_object('HD 147933')\n",
273-
"Umag=phot_table['FLUX_U']\n",
274-
"Bmag=phot_table['FLUX_B']\n",
275-
"Vmag=phot_table['FLUX_V']"
276+
"Umag=phot_table['U']\n",
277+
"Bmag=phot_table['B']\n",
278+
"Vmag=phot_table['V']"
276279
]
277280
},
278281
{

tutorials/spectral-cube-reprojection/SpectralCubeReprojectExample.ipynb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,14 @@
523523
"metadata": {},
524524
"outputs": [],
525525
"source": [
526-
"cube2vel_reproj = cube2vel_spatialspectralsmooth.reproject(cube1vel.header)\n",
526+
"# first we make a copy of the target (cube1vel) header and set its rest frequency \n",
527+
"# to that of the cube we're reprojecting (cube2vel_spatialspectralsmooth)\n",
528+
"# (see https://github.com/radio-astro-tools/spectral-cube/issues/874)\n",
529+
"tgthdr = cube1vel.header\n",
530+
"tgthdr['RESTFRQ'] = cube2vel_spatialspectralsmooth.header['RESTFRQ']\n",
531+
"\n",
532+
"# now we continue with the reprojection\n",
533+
"cube2vel_reproj = cube2vel_spatialspectralsmooth.reproject(tgthdr)\n",
527534
"cube2vel_reproj"
528535
]
529536
},
@@ -615,7 +622,7 @@
615622
" cube2daskvel_spectralresample = cube2daskvel_smooth.spectral_interpolate(cube1vel.spectral_axis,\n",
616623
" suppress_smooth_warning=True)\n",
617624
" cube2daskvel_spatialspectralsmooth = cube2daskvel_spectralresample.convolve_to(common_beam)\n",
618-
" cube2daskvel_reproj = cube2daskvel_spatialspectralsmooth.reproject(cube1vel.header)\n",
625+
" cube2daskvel_reproj = cube2daskvel_spatialspectralsmooth.reproject(tgthdr) # as above, tgthdr is altered cube1vel header\n",
619626
"cube2daskvel_reproj"
620627
]
621628
},

tutorials/vo/conesearch.ipynb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,10 @@
243243
"outputs": [],
244244
"source": [
245245
"my_db = vos_catalog.get_remote_catalog_db(conf.conesearch_dbname)\n",
246-
"my_cat = my_db.get_catalog_by_url(result.url + '&')\n",
246+
"try:\n",
247+
" my_cat = my_db.get_catalog_by_url(result.url)\n",
248+
"except AttributeError:\n",
249+
" my_cat = my_db.get_catalog_by_url(result.url + '&')\n",
247250
"print(my_cat.dumps())"
248251
]
249252
},

0 commit comments

Comments
 (0)