diff --git a/hera_notebook_templates/notebooks/lststack.ipynb b/hera_notebook_templates/notebooks/lststack.ipynb index d482747..ed5dde5 100644 --- a/hera_notebook_templates/notebooks/lststack.ipynb +++ b/hera_notebook_templates/notebooks/lststack.ipynb @@ -497,6 +497,23 @@ "print(f\"This data {'is' if data_is_redundantly_averaged else 'is not'} redundantly averaged.\")" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "6bc8380a-775c-4d77-9049-60e308e246db", + "metadata": {}, + "outputs": [], + "source": [ + "# A partial function that makes it simpler to create files of the correct format.\n", + "get_fname = partial(\n", + " lstbin.io.format_outfile_name,\n", + " lst=stackconf.lst_grid_edges[0],\n", + " pols=stackconf.pols,\n", + " inpaint_mode=True,\n", + " lst_branch_cut=stackconf.properties[\"lst_branch_cut\"],\n", + ")" + ] + }, { "cell_type": "markdown", "id": "8dcb2696", @@ -795,13 +812,9 @@ " all_calibration_parameters[stackconf.lst_grid[i]] = calibration_parameters\n", " \n", " # Get the calibration filename\n", - " cal_fname = lstbin.io.format_outfile_name(\n", - " lst=stackconf.lst_grid_edges[0],\n", - " pols=stackconf.pols,\n", - " fname_format=fname_format.replace(\"sum.uvh5\", \"lstcal.pkl\"),\n", - " inpaint_mode=True,\n", - " lst_branch_cut=stackconf.properties[\"lst_branch_cut\"],\n", - " kind=\"LST\"\n", + " cal_fname = get_fname(\n", + " fname_format=fname_format.replace(\"{blchunk}\", \"{blchunk:03}\").replace(\".sum.uvh5\", \".pkl\"),\n", + " kind='LSTCAL',\n", " )\n", " outfile = outdir / cal_fname\n", " \n", @@ -1356,17 +1369,8 @@ "\n", "create_file = partial(\n", " lstbin.io.create_lstbin_output_file,\n", - "# uvd_template=uvd_template,\n", " outdir=outdir,\n", " overwrite=overwrite,\n", - ")\n", - "\n", - "get_fname = partial(\n", - " lstbin.io.format_outfile_name,\n", - " lst=stackconf.lst_grid_edges[0],\n", - " pols=stackconf.pols,\n", - " inpaint_mode=True,\n", - " lst_branch_cut=stackconf.properties[\"lst_branch_cut\"],\n", ")" ] },