{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Simulate a mock line observation\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# make mock observations using mockgenerator.py" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2026-10-22T18:21:36.269845Z", "iopub.status.busy": "2026-10-22T18:21:36.269513Z", "iopub.status.idle": "2026-10-22T18:21:40.356259Z", "shell.execute_reply": "2026-10-22T18:21:40.355007Z" } }, "outputs": [], "source": [ "from luv_finder import MockObservation" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "execution": { "iopub.execute_input": "2026-10-22T18:21:40.359216Z", "iopub.status.busy": "2026-10-22T18:21:40.358547Z", "iopub.status.idle": "2026-10-22T18:21:40.364880Z", "shell.execute_reply": "2026-10-22T18:21:40.364014Z" } }, "outputs": [], "source": [ "mock_obs = MockObservation(\n", " cube_shape=(50, 256, 256),\n", " cell='0.25arcsec',\n", " dv=\"100km/s\",\n", " freq_center=\"40GHz\",\n", " # sensitivity=\"0.5mJy\",\n", " integration_time=\"8min\",\n", " sources = [\n", " { \"position\": (-4.25, 23.5), \n", " \"line\": { \"width\": 300, \"mean\": 39.9, \"snr\": 13}},\n", " {\"position\": (-12.0, -4.25), \n", " \"line\": {\"width\": 300, \"mean\": 40.2, \"snr\": 9}}\n", " # {\"position\": (-12.0, -4.25), \n", " # \"line\": {\"width\": 300, \"mean\": 3.96664359e+1, \"snr\": 10}}\n", " ],\n", " alma_config='alma.cycle13.3.cfg',\n", ")" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "execution": { "iopub.execute_input": "2026-10-22T18:21:40.367282Z", "iopub.status.busy": "2026-10-22T18:21:40.366824Z", "iopub.status.idle": "2026-10-22T18:21:40.481628Z", "shell.execute_reply": "2026-10-22T18:21:40.480354Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "source (-4.25, 23.5): line flux 1.906e+00 Jy km/s\n", "source (-12.0, -4.25): line flux 1.320e+00 Jy km/s\n" ] }, { "data": { "text/plain": [ "'support/line13_line9_input.fits'" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mock_obs.create_cube()\n", "mock_obs.save_cube()" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "execution": { "iopub.execute_input": "2026-10-22T18:21:40.531382Z", "iopub.status.busy": "2026-10-22T18:21:40.531042Z", "iopub.status.idle": "2026-10-22T18:22:26.542180Z", "shell.execute_reply": "2026-10-22T18:22:26.539413Z" } }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "2026-10-22 18:21:45\tSEVERE\tsimobserve::MeasTable::dUTC(Double) (file /source/casa6/casatools/casacore/measures/Measures/MeasTable.cc, line 4290)\tLeap second table TAI_UTC seems out-of-date.\n", "2026-10-22 18:21:45\tSEVERE\tsimobserve::MeasTable::dUTC(Double) (file /source/casa6/casatools/casacore/measures/Measures/MeasTable.cc, line 4290)+\tUntil the table is updated (see the CASA documentation or your system admin),\n", "2026-10-22 18:21:45\tSEVERE\tsimobserve::MeasTable::dUTC(Double) (file /source/casa6/casatools/casacore/measures/Measures/MeasTable.cc, line 4290)+\ttimes and coordinates derived from UTC could be wrong by 1s or more.\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "....10....20....30....40....50...." ] }, { "name": "stderr", "output_type": "stream", "text": [ "60" ] }, { "name": "stderr", "output_type": "stream", "text": [ "." ] }, { "name": "stderr", "output_type": "stream", "text": [ "." ] }, { "name": "stderr", "output_type": "stream", "text": [ "." ] }, { "name": "stderr", "output_type": "stream", "text": [ "." ] }, { "name": "stderr", "output_type": "stream", "text": [ "70" ] }, { "name": "stderr", "output_type": "stream", "text": [ "." ] }, { "name": "stderr", "output_type": "stream", "text": [ "." ] }, { "name": "stderr", "output_type": "stream", "text": [ "." ] }, { "name": "stderr", "output_type": "stream", "text": [ "." ] }, { "name": "stderr", "output_type": "stream", "text": [ "80" ] }, { "name": "stderr", "output_type": "stream", "text": [ "." ] }, { "name": "stderr", "output_type": "stream", "text": [ "." ] }, { "name": "stderr", "output_type": "stream", "text": [ "." ] }, { "name": "stderr", "output_type": "stream", "text": [ "." ] }, { "name": "stderr", "output_type": "stream", "text": [ "90" ] }, { "name": "stderr", "output_type": "stream", "text": [ "." ] }, { "name": "stderr", "output_type": "stream", "text": [ "." ] }, { "name": "stderr", "output_type": "stream", "text": [ "..100%\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "2026-10-22 18:22:14\tWARN\ttask_tclean::SIImageStore::restore (file /source/casa6/casatools/src/code/synthesis/ImagerObjects/SIImageStore.cc, line 2352)\tRestoring with an empty model image. Only residuals will be processed to form the output restored image.\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "2026-10-22 18:22:26\tWARN\ttask_tclean::SIImageStore::restore (file /source/casa6/casatools/src/code/synthesis/ImagerObjects/SIImageStore.cc, line 2352)\tRestoring with an empty model image. Only residuals will be processed to form the output restored image.\n" ] } ], "source": [ "mock_obs.simulate_observation()\n", "mock_obs.run_imaging()" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "execution": { "iopub.execute_input": "2026-10-22T18:22:26.547313Z", "iopub.status.busy": "2026-10-22T18:22:26.546822Z", "iopub.status.idle": "2026-10-22T18:22:28.088203Z", "shell.execute_reply": "2026-10-22T18:22:28.086319Z" } }, "outputs": [ { "data": { "text/plain": [ "'output/ms_files/line13_line9'" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mock_obs.plot_results()\n", "mock_obs.move_output()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.14" } }, "nbformat": 4, "nbformat_minor": 2 }