Skip to content

Commit

Permalink
FIX: add packages, fix recipe4.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
kmuehlbauer committed Nov 6, 2024
1 parent 7322048 commit b4c3903
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 31 deletions.
2 changes: 2 additions & 0 deletions ci/requirements/notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ dependencies:
- h5py
- h5netcdf
- lat_lon_parser
- libgdal-hdf5
- libgdal-netcdf
- nbconvert
- nc-time-axis
- netCDF4
Expand Down
48 changes: 17 additions & 31 deletions notebooks/workflow/recipe4.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@
" tolerance=1.0, start_angle=0, stop_angle=360, angle_res=1.0, direction=1\n",
")\n",
"for i, (r, v) in enumerate(zip(volume_reflectivity, volume_velocity)):\n",
" # print(i)\n",
" ds0 = [\n",
" xr.open_dataset(\n",
" r0,\n",
Expand All @@ -254,6 +253,7 @@
" )\n",
" for r0 in r\n",
" ]\n",
" ds0 = [r0.assign_coords(sweep_mode=r0.sweep_mode.min()) for r0 in ds0]\n",
" ds1 = [\n",
" xr.open_dataset(\n",
" v0,\n",
Expand All @@ -264,19 +264,15 @@
" )\n",
" for v0 in v\n",
" ]\n",
" ds = xr.concat(\n",
" [\n",
" xr.merge([r0, v0], compat=\"override\")\n",
" .assign(volume_time=r0.time.min().dt.floor(\"5min\"))\n",
" .assign_coords(sweep_mode=ds.sweep_mode.min())\n",
" .wrl.georef.georeference()\n",
" for r0, v0 in zip(ds0, ds1)\n",
" ],\n",
" \"volume_time\",\n",
" )\n",
" # ds = ds.assign_coords(sweep_mode=ds.sweep_mode.min())\n",
" # display(ds)\n",
" # ds = ds.wrl.georef.georeference()\n",
" ds1 = [r1.assign_coords(sweep_mode=r1.sweep_mode.min()) for r1 in ds1]\n",
" ds2 = [\n",
" xr.merge([r0, v0], compat=\"no_conflicts\").assign(\n",
" volume_time=r0.time.min().dt.floor(\"5min\")\n",
" )\n",
" for r0, v0 in zip(ds0, ds1)\n",
" ]\n",
" ds2 = [r2.wrl.georef.georeference() for r2 in ds2]\n",
" ds = xr.concat(ds2, \"volume_time\")\n",
" dsl.append(ds)"
]
},
Expand All @@ -286,21 +282,20 @@
"metadata": {},
"outputs": [],
"source": [
"# dsl.insert(0, xr.open_dataset(volume_reflectivity[0][0], group=\"/\"))\n",
"dtree = {\"/\": xd.io.backends.common._get_required_root_dataset(dsl, optional=False)}\n",
"for i, swp in enumerate(dsl):\n",
" dsl[i][\"sweep_number\"] = i\n",
" # dsl[i][\"volume_time\"] = dsl[0].volume_time\n",
"dtree = xd.io.backends.common._attach_sweep_groups(dtree, dsl)\n",
"# dtree[\"/\"][\"volume_time\"] = dsl[0].volume_time"
"dsl[0]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
"source": [
"dtree = {\"/\": xd.io.backends.common._get_required_root_dataset(dsl, optional=False)}\n",
"for i, swp in enumerate(dsl):\n",
" dsl[i][\"sweep_number\"] = i\n",
"dtree = xd.io.backends.common._attach_sweep_groups(dtree, dsl)"
]
},
{
"cell_type": "code",
Expand Down Expand Up @@ -453,15 +448,6 @@
"swp = vol0[\"sweep_9\"].ds"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"swp"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down

0 comments on commit b4c3903

Please sign in to comment.