From 5a1e582a7d0848f59383c613a483e8d70e7e4fdb Mon Sep 17 00:00:00 2001 From: Tyler Desjardins Date: Mon, 3 Jun 2024 15:09:09 -0400 Subject: [PATCH] Updated aperture photometry notebook for s3fs and fixed misc code typos --- notebooks/aperture_photometry/aperture_photometry.ipynb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/notebooks/aperture_photometry/aperture_photometry.ipynb b/notebooks/aperture_photometry/aperture_photometry.ipynb index 8ee6e22..04d2e7e 100644 --- a/notebooks/aperture_photometry/aperture_photometry.ipynb +++ b/notebooks/aperture_photometry/aperture_photometry.ipynb @@ -52,6 +52,7 @@ "import asdf\n", "from astropy.io import fits\n", "from astropy.table import Table\n", + "import copy\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import photutils\n", @@ -103,7 +104,7 @@ } }, "source": [ - "We obtain data from S3 buckets by using `s3fs`. **NOTE THAT THIS PART NEEDS TO BE TESTED ON THE ACTUAL SCIENCE PLATFORM BEFORE MERGING.**" + "We obtain data from S3 buckets by using `s3fs`." ] }, { @@ -128,8 +129,8 @@ "\n", "with fs.open(asdf_file_uri, 'rb') as f:\n", " dm = rdm.open(f)\n", - " asdf_file.data.value.copy()\n", - " wcs = asdf_file.meta.wcs.copy()" + " image = dm.data.value.copy()\n", + " wcs = copy.deepcopy(dm.meta.wcs)" ] }, { @@ -149,7 +150,7 @@ "metadata": {}, "outputs": [], "source": [ - "catalog_fname = asdf_dir_uri + 'ROMANISIM/CATALOGS_SCRIPTS/fullcat_101M_pared_ra0.50_dec0.50_WFI01.ecsv'\n", + "catalog_file_uri = asdf_dir_uri + 'ROMANISIM/CATALOGS_SCRIPTS/fullcat_101M_pared_ra0.50_dec0.50_WFI01.ecsv'\n", "with fs.open(catalog_file_uri) as catalog_file_stream:\n", " cat = Table.read(catalog_fname)" ]