From 0e5afdfef5386fdb456cd6e714c5dcfd9e8be4c9 Mon Sep 17 00:00:00 2001 From: Benjamin Alan Weaver Date: Wed, 14 Aug 2024 16:49:57 -0700 Subject: [PATCH] update notebooks --- doc/nb/TestNewTile.ipynb | 637 +++++++++++-------- doc/nb/TestPatchDailyWithJura.ipynb | 922 ++-------------------------- 2 files changed, 447 insertions(+), 1112 deletions(-) diff --git a/doc/nb/TestNewTile.ipynb b/doc/nb/TestNewTile.ipynb index 8d81748..ab244e5 100644 --- a/doc/nb/TestNewTile.ipynb +++ b/doc/nb/TestNewTile.ipynb @@ -119,68 +119,15 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 5, "id": "5322bcbd-8fcf-46a1-96be-2de812f7ea08", "metadata": { "tags": [] }, - "outputs": [ - { - "data": { - "text/html": [ - "
Table length=16\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "
TILEIDSURVEYPROGRAMFAPRGRMFAFLAVORNEXPEXPTIMETILERATILEDECEFFTIME_ETCEFFTIME_SPECEFFTIME_GFAGOALTIMEOBSSTATUSLRG_EFFTIME_DARKELG_EFFTIME_DARKBGS_EFFTIME_BRIGHTLYA_EFFTIME_DARKGOALTYPEMINTFRACLASTNIGHT
int64str7str6str16str19int64float64float64float64float64float64float64float64str8float64float64float64float64str7float64int64
80713sv1--m31sv1m3132700.210.1741.380.0758.6771.81000.0obsstart727.8758.6789.8645.0unknown0.920210110
80715sv1--m31sv1m3132700.110.1741.380.01906.81827.21000.0obsend1914.51906.82150.12216.6unknown0.920210115
80769unknown--dithfocusdithfocus7920.3111.6430.00.01.20.01000.0obsstart1.11.21.20.9unknown0.920210219
80816cmx--dithprecdithprec3540.299.066.00.014.145.21000.0obsstart11.414.111.66.8unknown0.920210223
80916unknown--dithfocusdithfocus4740.2160.050.00.063.668.81000.0obsstart59.763.666.567.5unknown0.920210422
82026unknown--dithprecdithprec1200.1251.250.40.073.159.41000.0obsstart67.573.172.764.4unknown0.920210423
82065unknown--dithfocusdithfocus1200.1220.247.80.024.827.91000.0obsstart22.424.824.525.4unknown0.920210423
82052unknown--dithfocusdithfocus1200.1190.049.50.030.117.31000.0obsstart25.430.126.114.9unknown0.920210423
81096sv2--darksv2dark11220.1180.045.00.01193.2973.81000.0obsend1111.71193.21234.41459.6dark0.920210429
82039unknown--dithprecdithprec3580.2279.050.00.0159.6131.61000.0obsstart149.0159.6158.6105.8unknown0.920210529
2704main--darkmaindark1821.0222.8974.905467.1524.1534.81000.0retired558.5524.1559.4559.7dark0.8520210627
2786main--darkmaindark1808.2240.3949.573251.3283.9260.51000.0retired273.4283.9289.1254.7dark0.8520210627
20307main--brightmainbright1448.3346.87430.79762.859.771.8180.0retired47.249.859.772.1bright0.8520210707
21273main--brightmainbright1534.4344.4552.172113.1132.8149.9180.0retired0.0133.5132.879.2bright0.8520210708
1825main--darkmaindark1770.2329.1261.365566.0547.0601.31000.0retired0.0547.0595.5597.2dark0.8520210708
82248cmx--posmappingcmxposmapping5938.9343.030.00.00.91.01000.0obsstart0.90.91.11.4unknown0.920210916
" - ], - "text/plain": [ - "\n", - "TILEID SURVEY PROGRAM FAPRGRM ... GOALTYPE MINTFRAC LASTNIGHT\n", - "int64 str7 str6 str16 ... str7 float64 int64 \n", - "------ ------- ------- ---------- ... -------- -------- ---------\n", - " 80713 sv1 -- m31 ... unknown 0.9 20210110\n", - " 80715 sv1 -- m31 ... unknown 0.9 20210115\n", - " 80769 unknown -- dithfocus ... unknown 0.9 20210219\n", - " 80816 cmx -- dithprec ... unknown 0.9 20210223\n", - " 80916 unknown -- dithfocus ... unknown 0.9 20210422\n", - " 82026 unknown -- dithprec ... unknown 0.9 20210423\n", - " 82065 unknown -- dithfocus ... unknown 0.9 20210423\n", - " 82052 unknown -- dithfocus ... unknown 0.9 20210423\n", - " 81096 sv2 -- dark ... dark 0.9 20210429\n", - " 82039 unknown -- dithprec ... unknown 0.9 20210529\n", - " 2704 main -- dark ... dark 0.85 20210627\n", - " 2786 main -- dark ... dark 0.85 20210627\n", - " 20307 main -- bright ... bright 0.85 20210707\n", - " 21273 main -- bright ... bright 0.85 20210708\n", - " 1825 main -- dark ... dark 0.85 20210708\n", - " 82248 cmx -- posmapping ... unknown 0.9 20210916" - ] - }, - "execution_count": 9, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "row_index = np.where((tiles_table['LASTNIGHT'] >= 20201214) & (tiles_table['EFFTIME_SPEC'] > 0) & (~tiles_table['PROGRAM'].mask))[0]\n", - "tiles_table[row_index]\n", + "# tiles_table[row_index]\n", "# row_index = np.where((tiles_table['LASTNIGHT'] >= 20201214) & (tiles_table['EFFTIME_SPEC'] > 0))[0]\n", "# tiles_table[row_index][tiles_table[row_index]['PROGRAM'].mask]" ] @@ -188,145 +135,23 @@ { "cell_type": "code", "execution_count": 6, - "id": "95866a59-eee1-43ea-87f7-6fce8a006115", - "metadata": { - "tags": [] - }, - "outputs": [ - { - "data": { - "text/html": [ - "
Table length=20\n", - "
\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "
TILEIDSURVEYPROGRAMFAPRGRMFAFLAVORNEXPEXPTIMETILERATILEDECEFFTIME_ETCEFFTIME_SPECEFFTIME_GFAGOALTIMEOBSSTATUSLRG_EFFTIME_DARKELG_EFFTIME_DARKBGS_EFFTIME_BRIGHTLYA_EFFTIME_DARKGOALTYPEMINTFRACLASTNIGHT
int64str7str6str16str19int64float64float64float64float64float64float64float64str8float64float64float64float64str7float64int64
80615cmxotherm33cmxm3343600.124.02731.390.03658.53270.61000.0obsend3582.43658.53945.24469.3unknown0.920201216
80609sv1darklrgqsocmxlrgqso1513500.7150.122.2060.08202.48317.84000.0obsend8103.88202.49070.212421.2dark0.920201217
80606sv1darkelgcmxelg1210800.736.448-4.5010.07179.27183.14000.0obsend6967.07179.27653.28686.3dark0.920201219
80620sv1darklrgqsosv1lrgqso1311700.7144.065.00.08228.47516.24000.0obsend7522.78228.47875.77957.3dark0.920201222
80611sv1brightbgsmwssv1bgsmws133620.935.2230.30.0691.2712.81000.0obsstart660.5754.1691.2440.5bright0.920201222
80607sv1darklrgqsocmxlrgqso7718804.90.00.00.010817.00.01000.0obsend9949.410817.010569.110520.4dark0.920201222
80612sv1brightbgsmwssv1bgsmws505658.966.68-5.240.01611.01572.81000.0obsend1522.91658.41611.0904.2bright0.920201223
80608sv1darkelgcmxelg2724301.6106.7456.20.017113.614302.24000.0obsend15770.517113.616838.117001.9dark0.920201223
80623sv1darkelgsv1elg109000.5155.032.4250.05560.05750.74000.0obsend5392.15560.06032.18957.2dark0.920201223
80616sv1brightbgsmwssv1bgsmws185106.2356.029.00.01557.11575.5600.0obsend1496.51694.11557.1847.0bright0.920201223
80617sv1brightbgsmwssv1bgsmws226162.45.028.00.01451.91449.5600.0obsend1356.31497.11451.91064.0bright0.920201223
80622sv1darklrgqsosv1lrgqso87200.4155.032.3250.05543.65477.84000.0obsend5272.75543.65844.38490.2dark0.920201223
80629sv1brightbgsmwssv1bgsmws51500.429.0-3.00.0830.3845.11000.0obsstart750.2779.1830.3632.7bright0.920210103
80638sv1brightbgsmwssv1bgsmws41200.360.0-30.00.0305.3340.41000.0obsstart285.9300.7305.3135.2bright0.920210103
80635sv1brightbgsmwssv1bgsmws51500.336.0-7.00.0185.9189.01000.0obsstart181.3210.4185.993.3bright0.920210105
80641sv1brightbgsmwssv1bgsmws185131.398.544.50.01362.71145.8600.0obsend1339.81575.31362.7716.5bright0.920210107
80642sv1brightbgsmwssv1bgsmws164801.3102.036.50.01838.21571.5600.0obsend1792.92097.21838.21077.3bright0.920210107
80633sv1brightbgsmwssv1bgsmws112220.732.0-7.00.0771.2797.11000.0obsstart715.1763.3771.2608.2bright0.920210107
80640sv1brightbgsmwssv1bgsmws103000.885.5-20.00.0512.4470.81000.0obsstart492.1542.8512.4312.3bright0.920210107
80676sv1darklrgqsosv1lrgqso119900.697.547.70.05596.74701.64000.0obsend5147.25596.75377.05067.3dark0.920210109
" - ], - "text/plain": [ - "\n", - "TILEID SURVEY PROGRAM FAPRGRM ... LYA_EFFTIME_DARK GOALTYPE MINTFRAC LASTNIGHT\n", - "int64 str7 str6 str16 ... float64 str7 float64 int64 \n", - "------ ------ ------- ------- ... ---------------- -------- -------- ---------\n", - " 80615 cmx other m33 ... 4469.3 unknown 0.9 20201216\n", - " 80609 sv1 dark lrgqso ... 12421.2 dark 0.9 20201217\n", - " 80606 sv1 dark elg ... 8686.3 dark 0.9 20201219\n", - " 80620 sv1 dark lrgqso ... 7957.3 dark 0.9 20201222\n", - " 80611 sv1 bright bgsmws ... 440.5 bright 0.9 20201222\n", - " 80607 sv1 dark lrgqso ... 10520.4 dark 0.9 20201222\n", - " 80612 sv1 bright bgsmws ... 904.2 bright 0.9 20201223\n", - " 80608 sv1 dark elg ... 17001.9 dark 0.9 20201223\n", - " 80623 sv1 dark elg ... 8957.2 dark 0.9 20201223\n", - " 80616 sv1 bright bgsmws ... 847.0 bright 0.9 20201223\n", - " 80617 sv1 bright bgsmws ... 1064.0 bright 0.9 20201223\n", - " 80622 sv1 dark lrgqso ... 8490.2 dark 0.9 20201223\n", - " 80629 sv1 bright bgsmws ... 632.7 bright 0.9 20210103\n", - " 80638 sv1 bright bgsmws ... 135.2 bright 0.9 20210103\n", - " 80635 sv1 bright bgsmws ... 93.3 bright 0.9 20210105\n", - " 80641 sv1 bright bgsmws ... 716.5 bright 0.9 20210107\n", - " 80642 sv1 bright bgsmws ... 1077.3 bright 0.9 20210107\n", - " 80633 sv1 bright bgsmws ... 608.2 bright 0.9 20210107\n", - " 80640 sv1 bright bgsmws ... 312.3 bright 0.9 20210107\n", - " 80676 sv1 dark lrgqso ... 5067.3 dark 0.9 20210109" - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], - "source": [ - "tiles_table[row_index][:20]" - ] - }, - { - "cell_type": "code", - "execution_count": 7, "id": "0e3c5449-449d-4474-b570-7db3aa50d87d", "metadata": { "tags": [] }, - "outputs": [], - "source": [ - "load_tiles = db.Tile.convert(tiles_table, row_index=row_index)" - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "id": "a88e68da-bf90-4077-b640-199ebb9f7fad", - "metadata": { - "tags": [] - }, "outputs": [ { - "data": { - "text/plain": [ - "[Tile(tileid=80615),\n", - " Tile(tileid=80609),\n", - " Tile(tileid=80606),\n", - " Tile(tileid=80620),\n", - " Tile(tileid=80611),\n", - " Tile(tileid=80607),\n", - " Tile(tileid=80612),\n", - " Tile(tileid=80608),\n", - " Tile(tileid=80623),\n", - " Tile(tileid=80616),\n", - " Tile(tileid=80617),\n", - " Tile(tileid=80622),\n", - " Tile(tileid=80629),\n", - " Tile(tileid=80638),\n", - " Tile(tileid=80635),\n", - " Tile(tileid=80641),\n", - " Tile(tileid=80642),\n", - " Tile(tileid=80633),\n", - " Tile(tileid=80640),\n", - " Tile(tileid=80676)]" - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" + "name": "stdout", + "output_type": "stream", + "text": [ + "CPU times: user 636 ms, sys: 44 ms, total: 680 ms\n", + "Wall time: 687 ms\n" + ] } ], "source": [ - "load_tiles[:20]" - ] - }, - { - "cell_type": "code", - "execution_count": 10, - "id": "eea12065-5091-48b8-897e-5c51cb6fb3f5", - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "try:\n", - " db.dbSession.add_all(load_tiles)\n", - " db.dbSession.commit()\n", - "except IntegrityError:\n", - " print(\"ERROR: Some tiles are already loaded!\")\n", - " db.dbSession.rollback()" + "%%time\n", + "candidate_tiles = db.Tile.convert(tiles_table, row_index=row_index)" ] }, { @@ -336,12 +161,12 @@ "source": [ "## Read exposures file\n", "\n", - "The daily exposures file may contain exposures with `EFFTIME_SPEC == 0`. We do not want to load these." + "The daily exposures file may contain exposures with `EFFTIME_SPEC == 0`. We do not want to load these. There are also cases where a *tile* has non-zero `EFFTIME_SPEC` but has no *exposures* with non-zero `EFFTIME_SPEC`. At least for now, don't try to load those either." ] }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 7, "id": "86c45810-11c1-4010-b429-1480f9d34008", "metadata": { "tags": [] @@ -357,7 +182,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 8, "id": "a8517a3d-0708-4b77-80b9-cab25554580b", "metadata": { "tags": [] @@ -387,6 +212,12 @@ "EXPID NIGHT MJD EFFTIME_SPEC\n", "----- -------- --- ------------\n", "83732 20210406 0.0 0.0\n", + "ERROR: No valid exposures found for tile 77, even though EFFTIME_SPEC == 68.300000!\n", + "EXPID NIGHT MJD EFFTIME_SPEC\n", + "----- -------- --- ------------\n", + "84348 20210411 0.0 0.0\n", + "84349 20210411 0.0 0.0\n", + "84350 20210411 0.0 0.0\n", "ERROR: No valid exposures found for tile 185, even though EFFTIME_SPEC == 49.500000!\n", "EXPID NIGHT MJD EFFTIME_SPEC\n", "----- -------- --- ------------\n", @@ -395,22 +226,16 @@ "EXPID NIGHT MJD EFFTIME_SPEC\n", "----- -------- --- ------------\n", "84420 20210411 0.0 0.0\n", - "ERROR: No valid exposures found for tile 77, even though EFFTIME_SPEC == 68.300000!\n", + "ERROR: No valid exposures found for tile 320, even though EFFTIME_SPEC == 59.500000!\n", "EXPID NIGHT MJD EFFTIME_SPEC\n", "----- -------- --- ------------\n", - "84348 20210411 0.0 0.0\n", - "84349 20210411 0.0 0.0\n", - "84350 20210411 0.0 0.0\n", + "84421 20210411 0.0 0.0\n", "ERROR: No valid exposures found for tile 51, even though EFFTIME_SPEC == 45.900000!\n", "EXPID NIGHT MJD EFFTIME_SPEC\n", "----- -------- --- ------------\n", "84345 20210411 0.0 0.0\n", "84346 20210411 0.0 0.0\n", "84347 20210411 0.0 0.0\n", - "ERROR: No valid exposures found for tile 320, even though EFFTIME_SPEC == 59.500000!\n", - "EXPID NIGHT MJD EFFTIME_SPEC\n", - "----- -------- --- ------------\n", - "84421 20210411 0.0 0.0\n", "ERROR: No valid exposures found for tile 104, even though EFFTIME_SPEC == 70.400000!\n", "EXPID NIGHT MJD EFFTIME_SPEC\n", "----- -------- --- ------------\n", @@ -481,6 +306,10 @@ "84418 20210411 0.0 0.0\n", "84419 20210411 0.0 0.0\n", "85641 20210420 0.0 0.0\n", + "ERROR: No valid exposures found for tile 401, even though EFFTIME_SPEC == 81.100000!\n", + "EXPID NIGHT MJD EFFTIME_SPEC\n", + "----- -------- --- ------------\n", + "86507 20210428 0.0 0.0\n", "ERROR: No valid exposures found for tile 107, even though EFFTIME_SPEC == 68.000000!\n", "EXPID NIGHT MJD EFFTIME_SPEC\n", "----- -------- --- ------------\n", @@ -489,14 +318,6 @@ "EXPID NIGHT MJD EFFTIME_SPEC\n", "----- -------- --- ------------\n", "86508 20210428 0.0 0.0\n", - "ERROR: No valid exposures found for tile 401, even though EFFTIME_SPEC == 81.100000!\n", - "EXPID NIGHT MJD EFFTIME_SPEC\n", - "----- -------- --- ------------\n", - "86507 20210428 0.0 0.0\n", - "ERROR: No valid exposures found for tile 215, even though EFFTIME_SPEC == 66.600000!\n", - "EXPID NIGHT MJD EFFTIME_SPEC\n", - "----- -------- --- ------------\n", - "86505 20210428 0.0 0.0\n", "ERROR: No valid exposures found for tile 321, even though EFFTIME_SPEC == 68.000000!\n", "EXPID NIGHT MJD EFFTIME_SPEC\n", "----- -------- --- ------------\n", @@ -506,6 +327,10 @@ "----- -------- --- ------------\n", "85619 20210420 0.0 0.0\n", "86494 20210428 0.0 0.0\n", + "ERROR: No valid exposures found for tile 215, even though EFFTIME_SPEC == 66.600000!\n", + "EXPID NIGHT MJD EFFTIME_SPEC\n", + "----- -------- --- ------------\n", + "86505 20210428 0.0 0.0\n", "ERROR: No valid exposures found for tile 429, even though EFFTIME_SPEC == 67.100000!\n", "EXPID NIGHT MJD EFFTIME_SPEC\n", "----- -------- --- ------------\n", @@ -527,45 +352,143 @@ "ERROR: No valid exposures found for tile 506, even though EFFTIME_SPEC == 76.800000!\n", "EXPID NIGHT MJD EFFTIME_SPEC\n", "----- -------- --- ------------\n", - "90224 20210529 0.0 0.0\n" + "90224 20210529 0.0 0.0\n", + "CPU times: user 1min 43s, sys: 1.9 s, total: 1min 45s\n", + "Wall time: 1min 47s\n" ] } ], "source": [ + "%%time\n", + "load_tiles = list()\n", + "bad_tiles = list()\n", "load_exposures = list()\n", - "for new_tile in load_tiles:\n", + "for new_tile in candidate_tiles:\n", " row_index = np.where((exposures_table['TILEID'] == new_tile.tileid) & (exposures_table['EFFTIME_SPEC'] > 0))[0]\n", " if len(row_index) > 0:\n", - " # load_exposures += db.Exposure.convert(exposures_table, row_index=row_index)\n", - " if (exposures_table[row_index]['MJD'] < 50000).any():\n", - " print(\"WARNING: Invalid MJD values detected for tile {0:d}!\".format(new_tile.tileid))\n", - " bad_index = np.where((exposures_table['TILEID'] == new_tile.tileid) & (exposures_table['EFFTIME_SPEC'] > 0) & (exposures_table['MJD'] < 50000))[0]\n", - " for row in exposures_table[['EXPID', 'NIGHT', 'MJD', 'EFFTIME_SPEC']][bad_index]:\n", - " raw_data_file = os.path.join(os.environ['DESI_SPECTRO_DATA'], \"{0:08d}\".format(row['NIGHT']), \"{0:08d}\".format(row['EXPID']), \"desi-{0:08d}.fits.fz\".format(row['EXPID']))\n", - " with fits.open(raw_data_file, mode='readonly') as hdulist:\n", - " mjd_obs = hdulist['SPEC'].header['MJD-OBS']\n", - " print(\"WARNING: tile {0:d} exposure {1:d} has MJD-OBS = {2:f} in {3}!\".format(new_tile.tileid, row['EXPID'], mjd_obs, raw_data_file))\n", + " load_tiles.append(new_tile)\n", + " load_exposures += db.Exposure.convert(exposures_table, row_index=row_index)\n", + " # if (exposures_table[row_index]['MJD'] < 50000).any():\n", + " # print(\"WARNING: Invalid MJD values detected for tile {0:d}!\".format(new_tile.tileid))\n", + " # bad_index = np.where((exposures_table['TILEID'] == new_tile.tileid) & (exposures_table['EFFTIME_SPEC'] > 0) & (exposures_table['MJD'] < 50000))[0]\n", + " # for row in exposures_table[['EXPID', 'NIGHT', 'MJD', 'EFFTIME_SPEC']][bad_index]:\n", + " # raw_data_file = os.path.join(os.environ['DESI_SPECTRO_DATA'], \"{0:08d}\".format(row['NIGHT']), \"{0:08d}\".format(row['EXPID']), \"desi-{0:08d}.fits.fz\".format(row['EXPID']))\n", + " # with fits.open(raw_data_file, mode='readonly') as hdulist:\n", + " # mjd_obs = hdulist['SPEC'].header['MJD-OBS']\n", + " # print(\"WARNING: tile {0:d} exposure {1:d} has MJD-OBS = {2:f} in {3}!\".format(new_tile.tileid, row['EXPID'], mjd_obs, raw_data_file))\n", " else:\n", " print(\"ERROR: No valid exposures found for tile {0:d}, even though EFFTIME_SPEC == {1:f}!\".format(new_tile.tileid, new_tile.efftime_spec))\n", " bad_index = np.where((exposures_table['TILEID'] == new_tile.tileid))[0]\n", " print(exposures_table[['EXPID', 'NIGHT', 'MJD', 'EFFTIME_SPEC']][bad_index])\n", - "# load_frames = list()\n", - "# for exposure in load_exposures:\n", - "# row_index = np.where(frames_table['EXPID'] == exposure.expid)[0]\n", - "# assert len(row_index) > 0\n", - "# load_frames += db.Frame.convert(frames_table, row_index=row_index)\n", + " bad_tiles.append(new_tile)\n", "# load_exposures" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, + "id": "38e20e0f-58e1-417d-b0ae-e902ac717888", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "CPU times: user 5min 4s, sys: 5.69 s, total: 5min 10s\n", + "Wall time: 5min 17s\n" + ] + } + ], + "source": [ + "%%time\n", + "load_frames = list()\n", + "for exposure in load_exposures:\n", + " row_index = np.where(frames_table['EXPID'] == exposure.expid)[0]\n", + " assert len(row_index) > 0\n", + " load_frames += db.Frame.convert(frames_table, row_index=row_index)\n", + "# load_frames" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "id": "8a509cfa-801c-4933-b550-b69ad75c337a", + "metadata": { + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "CPU times: user 1.46 s, sys: 52 ms, total: 1.51 s\n", + "Wall time: 2.38 s\n" + ] + } + ], + "source": [ + "%%time\n", + "try:\n", + " db.dbSession.add_all(load_tiles)\n", + " db.dbSession.commit()\n", + "except IntegrityError:\n", + " print(\"ERROR: Some tiles are already loaded!\")\n", + " db.dbSession.rollback()" + ] + }, + { + "cell_type": "code", + "execution_count": 11, "id": "269a600d-2346-4300-b71d-a6aa4053b0d9", "metadata": { "tags": [] }, - "outputs": [], + "outputs": [ + { + "ename": "IntegrityError", + "evalue": "(psycopg2.errors.NotNullViolation) null value in column \"fiberfac_gfa\" violates not-null constraint\nDETAIL: Failing row contains (20201222, 69455, 80610, 0, 0, 2020-12-23 12:02:33.591552+00, 59206.50177768, cmx, dark, elg, cmxelg, 900.004028320312, 1.34727168977261, 4000, dark, 0.9, 1.17609, 0.0214956291019917, 0, 0, 0.156659, 0.0387605, 0.103173, 0.166885976066826, 9.49855, 0, 0, 0, 1.25361, 1.34727, 1.3298, 1.909135184888, 0, 0, 0, 0.0691387515196852, 1.425028437377, 0.421895887401468, 0.319807524199896, 0.151348426191788, null, null, null, 1.18246672966859, 20.5068374559146, 21.6948676964909, 20.7336748369694, 19.1617744587365, null, null, null, null).\n\n[SQL: INSERT INTO daily.exposure (night, expid, tileid, tilera, tiledec, date_obs, mjd, survey, program, faprgrm, faflavor, exptime, efftime_spec, goaltime, goaltype, mintfrac, airmass, ebv, seeing_etc, efftime_etc, tsnr2_elg, tsnr2_qso, tsnr2_lrg, tsnr2_l ... 738229 characters truncated ... ime_gfa__627)s, %(efftime_dark_gfa__627)s, %(efftime_bright_gfa__627)s, %(efftime_backup_gfa__627)s)]\n[parameters: {'ebv__0': 0.05477216839790344, 'fiber_fracflux_gfa__0': 0.6093879572762915, 'efftime_spec__0': 716.840956115723, 'survey__0': 'cmx', 'fiberfac_bgs_gfa__0': 0.9697978701302379, 'fiberfac_gfa__0': 1.0061596313996244, 'date_obs__0': datetime.datetime(2020, 12, 17, 1, 35, 37, 77504, tzinfo=), 'sky_mag_g_spec__0': 21.82984125382668, 'goaltime__0': 1000.0, 'goaltype__0': 'unknown', 'seeing_gfa__0': 0.9498310820793945, 'tilera__0': 24.027, 'elg_efftime_dark__0': 716.840956115723, 'gpb_efftime_dark__0': 0.0, 'transparency_gfa__0': 0.9860573552204372, 'tiledec__0': 31.39, 'airmass_gfa__0': 1.0643660458221693, 'sky_mag_ab_gfa__0': 20.687300622263788, 'efftime_bright_gfa__0': 641.2192606190129, 'efftime_backup_gfa__0': 705.9319105165287, 'mintfrac__0': 0.9, 'tsnr2_bgs__0': 5526.3623046875, 'program__0': 'other', 'expid__0': 68265, 'lya_efftime_dark__0': 881.0479696260478, 'mjd__0': 59200.06640136, 'tsnr2_qso__0': 21.112829208374023, 'tsnr2_elg__0': 83.35359954833984, 'faflavor__0': 'cmxm33', 'sky_mag_r_spec__0': 21.05370965995666, 'sky_mag_z_spec__0': 19.200085082158704, 'tsnr2_lrg__0': 57.5751953125, 'tileid__0': 80615, 'tsnr2_lya__0': 77.01631164550781, 'efftime_dark_gfa__0': 648.1418017037299, 'faprgrm__0': 'm33', 'efftime_gfa__0': 648.1418017037299, 'tsnr2_gpbbright__0': 0.0, 'tsnr2_gpbbackup__0': 0.0, 'gpb_efftime_backup__0': 0.0, 'bgs_efftime_bright__0': 773.69072265625, 'night__0': 20201216, 'fiber_fracflux_bgs_gfa__0': 0.19807581524996704, 'airmass__0': 1.072093, 'exptime__0': 900.0020141601562, 'fiber_fracflux_elg_gfa__0': 0.4338655191836517, 'seeing_etc__0': 0.0, 'tsnr2_gpbdark__0': 0.0, 'gpb_efftime_bright__0': 0.0, 'lrg_efftime_dark__0': 699.573497680911 ... 32556 parameters truncated ... 'efftime_spec__627': 881.8314102172855, 'survey__627': 'sv1', 'fiberfac_bgs_gfa__627': 1.1219008645274058, 'fiberfac_gfa__627': 1.203024136532684, 'date_obs__627': datetime.datetime(2021, 1, 16, 8, 2, 31, 667136, tzinfo=), 'sky_mag_g_spec__627': 21.958881082495996, 'goaltime__627': 1000.0, 'goaltype__627': 'dark', 'seeing_gfa__627': 0.7716763904526707, 'tilera__627': 120.0, 'elg_efftime_dark__627': 881.8314102172855, 'gpb_efftime_dark__627': 0.0, 'transparency_gfa__627': 0.9688503867310785, 'tiledec__627': 34.0, 'airmass_gfa__627': 1.0052397520139693, 'sky_mag_ab_gfa__627': 22.31806687659762, 'efftime_bright_gfa__627': 762.1995935664742, 'efftime_backup_gfa__627': 847.4266225039098, 'mintfrac__627': 0.9, 'tsnr2_bgs__627': 6777.68994140625, 'program__627': 'dark', 'expid__627': 72511, 'lya_efftime_dark__627': 1024.032987862727, 'mjd__627': 59230.33508874, 'tsnr2_qso__627': 25.910263061523438, 'tsnr2_elg__627': 102.53853607177734, 'faflavor__627': 'sv1elgqso', 'sky_mag_r_spec__627': 21.33136785139145, 'sky_mag_z_spec__627': 19.726246214442227, 'tsnr2_lrg__627': 70.26490783691406, 'tileid__627': 80685, 'tsnr2_lya__627': 89.51526641845703, 'efftime_dark_gfa__627': 825.1358589806441, 'faprgrm__627': 'elgqso', 'efftime_gfa__627': 825.1358589806441, 'tsnr2_gpbbright__627': 0.0, 'tsnr2_gpbbackup__627': 0.0, 'gpb_efftime_backup__627': 0.0, 'bgs_efftime_bright__627': 948.8765917968751, 'night__627': 20210115, 'fiber_fracflux_bgs_gfa__627': 0.23162289328675623, 'airmass__627': 1.003325, 'exptime__627': 737.294189453125, 'fiber_fracflux_elg_gfa__627': 0.5170860967073544, 'seeing_etc__627': 0.0, 'tsnr2_gpbdark__627': 0.0, 'gpb_efftime_bright__627': 0.0, 'lrg_efftime_dark__627': 853.7611913063681, 'efftime_etc__627': 0.0, 'fiberfac_elg_gfa__627': 1.1538710145713105}]\n(Background on this error at: https://sqlalche.me/e/20/gkpj)", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mNotNullViolation\u001b[0m Traceback (most recent call last)", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/engine/base.py:2120\u001b[0m, in \u001b[0;36mConnection._exec_insertmany_context\u001b[0;34m(self, dialect, context)\u001b[0m\n\u001b[1;32m 2119\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m-> 2120\u001b[0m \u001b[43mdialect\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdo_execute\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 2121\u001b[0m \u001b[43m \u001b[49m\u001b[43mcursor\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2122\u001b[0m \u001b[43m \u001b[49m\u001b[43msub_stmt\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2123\u001b[0m \u001b[43m \u001b[49m\u001b[43msub_params\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2124\u001b[0m \u001b[43m \u001b[49m\u001b[43mcontext\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2125\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2127\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mBaseException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/engine/default.py:919\u001b[0m, in \u001b[0;36mDefaultDialect.do_execute\u001b[0;34m(self, cursor, statement, parameters, context)\u001b[0m\n\u001b[1;32m 918\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mdo_execute\u001b[39m(\u001b[38;5;28mself\u001b[39m, cursor, statement, parameters, context\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m):\n\u001b[0;32m--> 919\u001b[0m \u001b[43mcursor\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mexecute\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstatement\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mparameters\u001b[49m\u001b[43m)\u001b[49m\n", + "\u001b[0;31mNotNullViolation\u001b[0m: null value in column \"fiberfac_gfa\" violates not-null constraint\nDETAIL: Failing row contains (20201222, 69455, 80610, 0, 0, 2020-12-23 12:02:33.591552+00, 59206.50177768, cmx, dark, elg, cmxelg, 900.004028320312, 1.34727168977261, 4000, dark, 0.9, 1.17609, 0.0214956291019917, 0, 0, 0.156659, 0.0387605, 0.103173, 0.166885976066826, 9.49855, 0, 0, 0, 1.25361, 1.34727, 1.3298, 1.909135184888, 0, 0, 0, 0.0691387515196852, 1.425028437377, 0.421895887401468, 0.319807524199896, 0.151348426191788, null, null, null, 1.18246672966859, 20.5068374559146, 21.6948676964909, 20.7336748369694, 19.1617744587365, null, null, null, null).\n", + "\nThe above exception was the direct cause of the following exception:\n", + "\u001b[0;31mIntegrityError\u001b[0m Traceback (most recent call last)", + "File \u001b[0;32m:3\u001b[0m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/scoping.py:597\u001b[0m, in \u001b[0;36mscoped_session.commit\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 558\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mcommit\u001b[39m(\u001b[38;5;28mself\u001b[39m) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 559\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124mr\u001b[39m\u001b[38;5;124;03m\"\"\"Flush pending changes and commit the current transaction.\u001b[39;00m\n\u001b[1;32m 560\u001b[0m \n\u001b[1;32m 561\u001b[0m \u001b[38;5;124;03m .. container:: class_bases\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 594\u001b[0m \n\u001b[1;32m 595\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m \u001b[38;5;66;03m# noqa: E501\u001b[39;00m\n\u001b[0;32m--> 597\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_proxied\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcommit\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/session.py:1972\u001b[0m, in \u001b[0;36mSession.commit\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1969\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m trans \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 1970\u001b[0m trans \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_autobegin_t()\n\u001b[0;32m-> 1972\u001b[0m \u001b[43mtrans\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcommit\u001b[49m\u001b[43m(\u001b[49m\u001b[43m_to_root\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m:2\u001b[0m, in \u001b[0;36mcommit\u001b[0;34m(self, _to_root)\u001b[0m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/state_changes.py:139\u001b[0m, in \u001b[0;36m_StateChange.declare_states.._go\u001b[0;34m(fn, self, *arg, **kw)\u001b[0m\n\u001b[1;32m 137\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_next_state \u001b[38;5;241m=\u001b[39m _StateChangeStates\u001b[38;5;241m.\u001b[39mCHANGE_IN_PROGRESS\n\u001b[1;32m 138\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 139\u001b[0m ret_value \u001b[38;5;241m=\u001b[39m \u001b[43mfn\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43marg\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkw\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 140\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m:\n\u001b[1;32m 141\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/session.py:1257\u001b[0m, in \u001b[0;36mSessionTransaction.commit\u001b[0;34m(self, _to_root)\u001b[0m\n\u001b[1;32m 1255\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_state \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m SessionTransactionState\u001b[38;5;241m.\u001b[39mPREPARED:\n\u001b[1;32m 1256\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_expect_state(SessionTransactionState\u001b[38;5;241m.\u001b[39mPREPARED):\n\u001b[0;32m-> 1257\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_prepare_impl\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1259\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_parent \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mnested:\n\u001b[1;32m 1260\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m conn, trans, should_commit, autoclose \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mset\u001b[39m(\n\u001b[1;32m 1261\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_connections\u001b[38;5;241m.\u001b[39mvalues()\n\u001b[1;32m 1262\u001b[0m ):\n", + "File \u001b[0;32m:2\u001b[0m, in \u001b[0;36m_prepare_impl\u001b[0;34m(self)\u001b[0m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/state_changes.py:139\u001b[0m, in \u001b[0;36m_StateChange.declare_states.._go\u001b[0;34m(fn, self, *arg, **kw)\u001b[0m\n\u001b[1;32m 137\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_next_state \u001b[38;5;241m=\u001b[39m _StateChangeStates\u001b[38;5;241m.\u001b[39mCHANGE_IN_PROGRESS\n\u001b[1;32m 138\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 139\u001b[0m ret_value \u001b[38;5;241m=\u001b[39m \u001b[43mfn\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43marg\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkw\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 140\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m:\n\u001b[1;32m 141\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/session.py:1232\u001b[0m, in \u001b[0;36mSessionTransaction._prepare_impl\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1230\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39msession\u001b[38;5;241m.\u001b[39m_is_clean():\n\u001b[1;32m 1231\u001b[0m \u001b[38;5;28;01mbreak\u001b[39;00m\n\u001b[0;32m-> 1232\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msession\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mflush\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1233\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 1234\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exc\u001b[38;5;241m.\u001b[39mFlushError(\n\u001b[1;32m 1235\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mOver 100 subsequent flushes have occurred within \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 1236\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124msession.commit() - is an after_flush() hook \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 1237\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcreating new objects?\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 1238\u001b[0m )\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/session.py:4296\u001b[0m, in \u001b[0;36mSession.flush\u001b[0;34m(self, objects)\u001b[0m\n\u001b[1;32m 4294\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m 4295\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_flushing \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mTrue\u001b[39;00m\n\u001b[0;32m-> 4296\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_flush\u001b[49m\u001b[43m(\u001b[49m\u001b[43mobjects\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 4297\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n\u001b[1;32m 4298\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_flushing \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mFalse\u001b[39;00m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/session.py:4431\u001b[0m, in \u001b[0;36mSession._flush\u001b[0;34m(self, objects)\u001b[0m\n\u001b[1;32m 4428\u001b[0m transaction\u001b[38;5;241m.\u001b[39mcommit()\n\u001b[1;32m 4430\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m:\n\u001b[0;32m-> 4431\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m util\u001b[38;5;241m.\u001b[39msafe_reraise():\n\u001b[1;32m 4432\u001b[0m transaction\u001b[38;5;241m.\u001b[39mrollback(_capture_exception\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m)\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py:146\u001b[0m, in \u001b[0;36msafe_reraise.__exit__\u001b[0;34m(self, type_, value, traceback)\u001b[0m\n\u001b[1;32m 144\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m exc_value \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 145\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_exc_info \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;66;03m# remove potential circular references\u001b[39;00m\n\u001b[0;32m--> 146\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exc_value\u001b[38;5;241m.\u001b[39mwith_traceback(exc_tb)\n\u001b[1;32m 147\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 148\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_exc_info \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;66;03m# remove potential circular references\u001b[39;00m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/session.py:4392\u001b[0m, in \u001b[0;36mSession._flush\u001b[0;34m(self, objects)\u001b[0m\n\u001b[1;32m 4390\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_warn_on_events \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mTrue\u001b[39;00m\n\u001b[1;32m 4391\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m-> 4392\u001b[0m \u001b[43mflush_context\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mexecute\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 4393\u001b[0m \u001b[38;5;28;01mfinally\u001b[39;00m:\n\u001b[1;32m 4394\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_warn_on_events \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mFalse\u001b[39;00m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/unitofwork.py:466\u001b[0m, in \u001b[0;36mUOWTransaction.execute\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 464\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 465\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m rec \u001b[38;5;129;01min\u001b[39;00m topological\u001b[38;5;241m.\u001b[39msort(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdependencies, postsort_actions):\n\u001b[0;32m--> 466\u001b[0m \u001b[43mrec\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mexecute\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/unitofwork.py:642\u001b[0m, in \u001b[0;36mSaveUpdateAll.execute\u001b[0;34m(self, uow)\u001b[0m\n\u001b[1;32m 640\u001b[0m \u001b[38;5;129m@util\u001b[39m\u001b[38;5;241m.\u001b[39mpreload_module(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124msqlalchemy.orm.persistence\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 641\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mexecute\u001b[39m(\u001b[38;5;28mself\u001b[39m, uow):\n\u001b[0;32m--> 642\u001b[0m \u001b[43mutil\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mpreloaded\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43morm_persistence\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msave_obj\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 643\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmapper\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 644\u001b[0m \u001b[43m \u001b[49m\u001b[43muow\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mstates_for_mapper_hierarchy\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmapper\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mFalse\u001b[39;49;00m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 645\u001b[0m \u001b[43m \u001b[49m\u001b[43muow\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 646\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/persistence.py:93\u001b[0m, in \u001b[0;36msave_obj\u001b[0;34m(base_mapper, states, uowtransaction, single)\u001b[0m\n\u001b[1;32m 81\u001b[0m update \u001b[38;5;241m=\u001b[39m _collect_update_commands(\n\u001b[1;32m 82\u001b[0m uowtransaction, table, states_to_update\n\u001b[1;32m 83\u001b[0m )\n\u001b[1;32m 85\u001b[0m _emit_update_statements(\n\u001b[1;32m 86\u001b[0m base_mapper,\n\u001b[1;32m 87\u001b[0m uowtransaction,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 90\u001b[0m update,\n\u001b[1;32m 91\u001b[0m )\n\u001b[0;32m---> 93\u001b[0m \u001b[43m_emit_insert_statements\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 94\u001b[0m \u001b[43m \u001b[49m\u001b[43mbase_mapper\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 95\u001b[0m \u001b[43m \u001b[49m\u001b[43muowtransaction\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 96\u001b[0m \u001b[43m \u001b[49m\u001b[43mmapper\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 97\u001b[0m \u001b[43m \u001b[49m\u001b[43mtable\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 98\u001b[0m \u001b[43m \u001b[49m\u001b[43minsert\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 99\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 101\u001b[0m _finalize_insert_update_commands(\n\u001b[1;32m 102\u001b[0m base_mapper,\n\u001b[1;32m 103\u001b[0m uowtransaction,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 119\u001b[0m ),\n\u001b[1;32m 120\u001b[0m )\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/persistence.py:1048\u001b[0m, in \u001b[0;36m_emit_insert_statements\u001b[0;34m(base_mapper, uowtransaction, mapper, table, insert, bookkeeping, use_orm_insert_stmt, execution_options)\u001b[0m\n\u001b[1;32m 1045\u001b[0m records \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mlist\u001b[39m(records)\n\u001b[1;32m 1046\u001b[0m multiparams \u001b[38;5;241m=\u001b[39m [rec[\u001b[38;5;241m2\u001b[39m] \u001b[38;5;28;01mfor\u001b[39;00m rec \u001b[38;5;129;01min\u001b[39;00m records]\n\u001b[0;32m-> 1048\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43mconnection\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mexecute\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1049\u001b[0m \u001b[43m \u001b[49m\u001b[43mstatement\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mmultiparams\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mexecution_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mexecution_options\u001b[49m\n\u001b[1;32m 1050\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1051\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m bookkeeping:\n\u001b[1;32m 1052\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m (\n\u001b[1;32m 1053\u001b[0m (\n\u001b[1;32m 1054\u001b[0m state,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 1063\u001b[0m last_inserted_params,\n\u001b[1;32m 1064\u001b[0m ) \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mzip\u001b[39m(records, result\u001b[38;5;241m.\u001b[39mcontext\u001b[38;5;241m.\u001b[39mcompiled_parameters):\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/engine/base.py:1422\u001b[0m, in \u001b[0;36mConnection.execute\u001b[0;34m(self, statement, parameters, execution_options)\u001b[0m\n\u001b[1;32m 1420\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exc\u001b[38;5;241m.\u001b[39mObjectNotExecutableError(statement) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01merr\u001b[39;00m\n\u001b[1;32m 1421\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m-> 1422\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mmeth\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1423\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1424\u001b[0m \u001b[43m \u001b[49m\u001b[43mdistilled_parameters\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1425\u001b[0m \u001b[43m \u001b[49m\u001b[43mexecution_options\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01mor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mNO_OPTIONS\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1426\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/sql/elements.py:514\u001b[0m, in \u001b[0;36mClauseElement._execute_on_connection\u001b[0;34m(self, connection, distilled_params, execution_options)\u001b[0m\n\u001b[1;32m 512\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m TYPE_CHECKING:\n\u001b[1;32m 513\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(\u001b[38;5;28mself\u001b[39m, Executable)\n\u001b[0;32m--> 514\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mconnection\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_execute_clauseelement\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 515\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdistilled_params\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mexecution_options\u001b[49m\n\u001b[1;32m 516\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 517\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 518\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exc\u001b[38;5;241m.\u001b[39mObjectNotExecutableError(\u001b[38;5;28mself\u001b[39m)\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/engine/base.py:1644\u001b[0m, in \u001b[0;36mConnection._execute_clauseelement\u001b[0;34m(self, elem, distilled_parameters, execution_options)\u001b[0m\n\u001b[1;32m 1632\u001b[0m compiled_cache: Optional[CompiledCacheType] \u001b[38;5;241m=\u001b[39m execution_options\u001b[38;5;241m.\u001b[39mget(\n\u001b[1;32m 1633\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcompiled_cache\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mengine\u001b[38;5;241m.\u001b[39m_compiled_cache\n\u001b[1;32m 1634\u001b[0m )\n\u001b[1;32m 1636\u001b[0m compiled_sql, extracted_params, cache_hit \u001b[38;5;241m=\u001b[39m elem\u001b[38;5;241m.\u001b[39m_compile_w_cache(\n\u001b[1;32m 1637\u001b[0m dialect\u001b[38;5;241m=\u001b[39mdialect,\n\u001b[1;32m 1638\u001b[0m compiled_cache\u001b[38;5;241m=\u001b[39mcompiled_cache,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 1642\u001b[0m linting\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdialect\u001b[38;5;241m.\u001b[39mcompiler_linting \u001b[38;5;241m|\u001b[39m compiler\u001b[38;5;241m.\u001b[39mWARN_LINTING,\n\u001b[1;32m 1643\u001b[0m )\n\u001b[0;32m-> 1644\u001b[0m ret \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_execute_context\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1645\u001b[0m \u001b[43m \u001b[49m\u001b[43mdialect\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1646\u001b[0m \u001b[43m \u001b[49m\u001b[43mdialect\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mexecution_ctx_cls\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_init_compiled\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1647\u001b[0m \u001b[43m \u001b[49m\u001b[43mcompiled_sql\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1648\u001b[0m \u001b[43m \u001b[49m\u001b[43mdistilled_parameters\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1649\u001b[0m \u001b[43m \u001b[49m\u001b[43mexecution_options\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1650\u001b[0m \u001b[43m \u001b[49m\u001b[43mcompiled_sql\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1651\u001b[0m \u001b[43m \u001b[49m\u001b[43mdistilled_parameters\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1652\u001b[0m \u001b[43m \u001b[49m\u001b[43melem\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1653\u001b[0m \u001b[43m \u001b[49m\u001b[43mextracted_params\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1654\u001b[0m \u001b[43m \u001b[49m\u001b[43mcache_hit\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mcache_hit\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1655\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1656\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m has_events:\n\u001b[1;32m 1657\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdispatch\u001b[38;5;241m.\u001b[39mafter_execute(\n\u001b[1;32m 1658\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[1;32m 1659\u001b[0m elem,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 1663\u001b[0m ret,\n\u001b[1;32m 1664\u001b[0m )\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/engine/base.py:1848\u001b[0m, in \u001b[0;36mConnection._execute_context\u001b[0;34m(self, dialect, constructor, statement, parameters, execution_options, *args, **kw)\u001b[0m\n\u001b[1;32m 1845\u001b[0m context\u001b[38;5;241m.\u001b[39mpre_exec()\n\u001b[1;32m 1847\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m context\u001b[38;5;241m.\u001b[39mexecute_style \u001b[38;5;129;01mis\u001b[39;00m ExecuteStyle\u001b[38;5;241m.\u001b[39mINSERTMANYVALUES:\n\u001b[0;32m-> 1848\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_exec_insertmany_context\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdialect\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcontext\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1849\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 1850\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_exec_single_context(\n\u001b[1;32m 1851\u001b[0m dialect, context, statement, parameters\n\u001b[1;32m 1852\u001b[0m )\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/engine/base.py:2128\u001b[0m, in \u001b[0;36mConnection._exec_insertmany_context\u001b[0;34m(self, dialect, context)\u001b[0m\n\u001b[1;32m 2120\u001b[0m dialect\u001b[38;5;241m.\u001b[39mdo_execute(\n\u001b[1;32m 2121\u001b[0m cursor,\n\u001b[1;32m 2122\u001b[0m sub_stmt,\n\u001b[1;32m 2123\u001b[0m sub_params,\n\u001b[1;32m 2124\u001b[0m context,\n\u001b[1;32m 2125\u001b[0m )\n\u001b[1;32m 2127\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mBaseException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m-> 2128\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_handle_dbapi_exception\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 2129\u001b[0m \u001b[43m \u001b[49m\u001b[43me\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2130\u001b[0m \u001b[43m \u001b[49m\u001b[43msql_util\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_long_statement\u001b[49m\u001b[43m(\u001b[49m\u001b[43msub_stmt\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2131\u001b[0m \u001b[43m \u001b[49m\u001b[43msub_params\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2132\u001b[0m \u001b[43m \u001b[49m\u001b[43mcursor\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2133\u001b[0m \u001b[43m \u001b[49m\u001b[43mcontext\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2134\u001b[0m \u001b[43m \u001b[49m\u001b[43mis_sub_exec\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[1;32m 2135\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2137\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m engine_events:\n\u001b[1;32m 2138\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdispatch\u001b[38;5;241m.\u001b[39mafter_cursor_execute(\n\u001b[1;32m 2139\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[1;32m 2140\u001b[0m cursor,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 2144\u001b[0m context\u001b[38;5;241m.\u001b[39mexecutemany,\n\u001b[1;32m 2145\u001b[0m )\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/engine/base.py:2357\u001b[0m, in \u001b[0;36mConnection._handle_dbapi_exception\u001b[0;34m(self, e, statement, parameters, cursor, context, is_sub_exec)\u001b[0m\n\u001b[1;32m 2355\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m should_wrap:\n\u001b[1;32m 2356\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m sqlalchemy_exception \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m-> 2357\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m sqlalchemy_exception\u001b[38;5;241m.\u001b[39mwith_traceback(exc_info[\u001b[38;5;241m2\u001b[39m]) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01me\u001b[39;00m\n\u001b[1;32m 2358\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 2359\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m exc_info[\u001b[38;5;241m1\u001b[39m] \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/engine/base.py:2120\u001b[0m, in \u001b[0;36mConnection._exec_insertmany_context\u001b[0;34m(self, dialect, context)\u001b[0m\n\u001b[1;32m 2118\u001b[0m \u001b[38;5;28;01mbreak\u001b[39;00m\n\u001b[1;32m 2119\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m-> 2120\u001b[0m \u001b[43mdialect\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdo_execute\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 2121\u001b[0m \u001b[43m \u001b[49m\u001b[43mcursor\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2122\u001b[0m \u001b[43m \u001b[49m\u001b[43msub_stmt\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2123\u001b[0m \u001b[43m \u001b[49m\u001b[43msub_params\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2124\u001b[0m \u001b[43m \u001b[49m\u001b[43mcontext\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2125\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2127\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mBaseException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[1;32m 2128\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_handle_dbapi_exception(\n\u001b[1;32m 2129\u001b[0m e,\n\u001b[1;32m 2130\u001b[0m sql_util\u001b[38;5;241m.\u001b[39m_long_statement(sub_stmt),\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 2134\u001b[0m is_sub_exec\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m,\n\u001b[1;32m 2135\u001b[0m )\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/engine/default.py:919\u001b[0m, in \u001b[0;36mDefaultDialect.do_execute\u001b[0;34m(self, cursor, statement, parameters, context)\u001b[0m\n\u001b[1;32m 918\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mdo_execute\u001b[39m(\u001b[38;5;28mself\u001b[39m, cursor, statement, parameters, context\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mNone\u001b[39;00m):\n\u001b[0;32m--> 919\u001b[0m \u001b[43mcursor\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mexecute\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstatement\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mparameters\u001b[49m\u001b[43m)\u001b[49m\n", + "\u001b[0;31mIntegrityError\u001b[0m: (psycopg2.errors.NotNullViolation) null value in column \"fiberfac_gfa\" violates not-null constraint\nDETAIL: Failing row contains (20201222, 69455, 80610, 0, 0, 2020-12-23 12:02:33.591552+00, 59206.50177768, cmx, dark, elg, cmxelg, 900.004028320312, 1.34727168977261, 4000, dark, 0.9, 1.17609, 0.0214956291019917, 0, 0, 0.156659, 0.0387605, 0.103173, 0.166885976066826, 9.49855, 0, 0, 0, 1.25361, 1.34727, 1.3298, 1.909135184888, 0, 0, 0, 0.0691387515196852, 1.425028437377, 0.421895887401468, 0.319807524199896, 0.151348426191788, null, null, null, 1.18246672966859, 20.5068374559146, 21.6948676964909, 20.7336748369694, 19.1617744587365, null, null, null, null).\n\n[SQL: INSERT INTO daily.exposure (night, expid, tileid, tilera, tiledec, date_obs, mjd, survey, program, faprgrm, faflavor, exptime, efftime_spec, goaltime, goaltype, mintfrac, airmass, ebv, seeing_etc, efftime_etc, tsnr2_elg, tsnr2_qso, tsnr2_lrg, tsnr2_l ... 738229 characters truncated ... ime_gfa__627)s, %(efftime_dark_gfa__627)s, %(efftime_bright_gfa__627)s, %(efftime_backup_gfa__627)s)]\n[parameters: {'ebv__0': 0.05477216839790344, 'fiber_fracflux_gfa__0': 0.6093879572762915, 'efftime_spec__0': 716.840956115723, 'survey__0': 'cmx', 'fiberfac_bgs_gfa__0': 0.9697978701302379, 'fiberfac_gfa__0': 1.0061596313996244, 'date_obs__0': datetime.datetime(2020, 12, 17, 1, 35, 37, 77504, tzinfo=), 'sky_mag_g_spec__0': 21.82984125382668, 'goaltime__0': 1000.0, 'goaltype__0': 'unknown', 'seeing_gfa__0': 0.9498310820793945, 'tilera__0': 24.027, 'elg_efftime_dark__0': 716.840956115723, 'gpb_efftime_dark__0': 0.0, 'transparency_gfa__0': 0.9860573552204372, 'tiledec__0': 31.39, 'airmass_gfa__0': 1.0643660458221693, 'sky_mag_ab_gfa__0': 20.687300622263788, 'efftime_bright_gfa__0': 641.2192606190129, 'efftime_backup_gfa__0': 705.9319105165287, 'mintfrac__0': 0.9, 'tsnr2_bgs__0': 5526.3623046875, 'program__0': 'other', 'expid__0': 68265, 'lya_efftime_dark__0': 881.0479696260478, 'mjd__0': 59200.06640136, 'tsnr2_qso__0': 21.112829208374023, 'tsnr2_elg__0': 83.35359954833984, 'faflavor__0': 'cmxm33', 'sky_mag_r_spec__0': 21.05370965995666, 'sky_mag_z_spec__0': 19.200085082158704, 'tsnr2_lrg__0': 57.5751953125, 'tileid__0': 80615, 'tsnr2_lya__0': 77.01631164550781, 'efftime_dark_gfa__0': 648.1418017037299, 'faprgrm__0': 'm33', 'efftime_gfa__0': 648.1418017037299, 'tsnr2_gpbbright__0': 0.0, 'tsnr2_gpbbackup__0': 0.0, 'gpb_efftime_backup__0': 0.0, 'bgs_efftime_bright__0': 773.69072265625, 'night__0': 20201216, 'fiber_fracflux_bgs_gfa__0': 0.19807581524996704, 'airmass__0': 1.072093, 'exptime__0': 900.0020141601562, 'fiber_fracflux_elg_gfa__0': 0.4338655191836517, 'seeing_etc__0': 0.0, 'tsnr2_gpbdark__0': 0.0, 'gpb_efftime_bright__0': 0.0, 'lrg_efftime_dark__0': 699.573497680911 ... 32556 parameters truncated ... 'efftime_spec__627': 881.8314102172855, 'survey__627': 'sv1', 'fiberfac_bgs_gfa__627': 1.1219008645274058, 'fiberfac_gfa__627': 1.203024136532684, 'date_obs__627': datetime.datetime(2021, 1, 16, 8, 2, 31, 667136, tzinfo=), 'sky_mag_g_spec__627': 21.958881082495996, 'goaltime__627': 1000.0, 'goaltype__627': 'dark', 'seeing_gfa__627': 0.7716763904526707, 'tilera__627': 120.0, 'elg_efftime_dark__627': 881.8314102172855, 'gpb_efftime_dark__627': 0.0, 'transparency_gfa__627': 0.9688503867310785, 'tiledec__627': 34.0, 'airmass_gfa__627': 1.0052397520139693, 'sky_mag_ab_gfa__627': 22.31806687659762, 'efftime_bright_gfa__627': 762.1995935664742, 'efftime_backup_gfa__627': 847.4266225039098, 'mintfrac__627': 0.9, 'tsnr2_bgs__627': 6777.68994140625, 'program__627': 'dark', 'expid__627': 72511, 'lya_efftime_dark__627': 1024.032987862727, 'mjd__627': 59230.33508874, 'tsnr2_qso__627': 25.910263061523438, 'tsnr2_elg__627': 102.53853607177734, 'faflavor__627': 'sv1elgqso', 'sky_mag_r_spec__627': 21.33136785139145, 'sky_mag_z_spec__627': 19.726246214442227, 'tsnr2_lrg__627': 70.26490783691406, 'tileid__627': 80685, 'tsnr2_lya__627': 89.51526641845703, 'efftime_dark_gfa__627': 825.1358589806441, 'faprgrm__627': 'elgqso', 'efftime_gfa__627': 825.1358589806441, 'tsnr2_gpbbright__627': 0.0, 'tsnr2_gpbbackup__627': 0.0, 'gpb_efftime_backup__627': 0.0, 'bgs_efftime_bright__627': 948.8765917968751, 'night__627': 20210115, 'fiber_fracflux_bgs_gfa__627': 0.23162289328675623, 'airmass__627': 1.003325, 'exptime__627': 737.294189453125, 'fiber_fracflux_elg_gfa__627': 0.5170860967073544, 'seeing_etc__627': 0.0, 'tsnr2_gpbdark__627': 0.0, 'gpb_efftime_bright__627': 0.0, 'lrg_efftime_dark__627': 853.7611913063681, 'efftime_etc__627': 0.0, 'fiberfac_elg_gfa__627': 1.1538710145713105}]\n(Background on this error at: https://sqlalche.me/e/20/gkpj)" + ] + } + ], "source": [ + "%%time\n", "# db.dbSession.rollback()\n", "db.dbSession.add_all(load_exposures)\n", "db.dbSession.commit()" @@ -573,13 +496,31 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "id": "98306e39-48fd-41bc-9161-cbe1e47c28b6", "metadata": { "tags": [] }, - "outputs": [], + "outputs": [ + { + "ename": "PendingRollbackError", + "evalue": "This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (psycopg2.errors.NotNullViolation) null value in column \"fiberfac_gfa\" violates not-null constraint\nDETAIL: Failing row contains (20201222, 69455, 80610, 0, 0, 2020-12-23 12:02:33.591552+00, 59206.50177768, cmx, dark, elg, cmxelg, 900.004028320312, 1.34727168977261, 4000, dark, 0.9, 1.17609, 0.0214956291019917, 0, 0, 0.156659, 0.0387605, 0.103173, 0.166885976066826, 9.49855, 0, 0, 0, 1.25361, 1.34727, 1.3298, 1.909135184888, 0, 0, 0, 0.0691387515196852, 1.425028437377, 0.421895887401468, 0.319807524199896, 0.151348426191788, null, null, null, 1.18246672966859, 20.5068374559146, 21.6948676964909, 20.7336748369694, 19.1617744587365, null, null, null, null).\n\n[SQL: INSERT INTO daily.exposure (night, expid, tileid, tilera, tiledec, date_obs, mjd, survey, program, faprgrm, faflavor, exptime, efftime_spec, goaltime, goaltype, mintfrac, airmass, ebv, seeing_etc, efftime_etc, tsnr2_elg, tsnr2_qso, tsnr2_lrg, tsnr2_l ... 738229 characters truncated ... ime_gfa__627)s, %(efftime_dark_gfa__627)s, %(efftime_bright_gfa__627)s, %(efftime_backup_gfa__627)s)]\n[parameters: {'ebv__0': 0.05477216839790344, 'fiber_fracflux_gfa__0': 0.6093879572762915, 'efftime_spec__0': 716.840956115723, 'survey__0': 'cmx', 'fiberfac_bgs_gfa__0': 0.9697978701302379, 'fiberfac_gfa__0': 1.0061596313996244, 'date_obs__0': datetime.datetime(2020, 12, 17, 1, 35, 37, 77504, tzinfo=), 'sky_mag_g_spec__0': 21.82984125382668, 'goaltime__0': 1000.0, 'goaltype__0': 'unknown', 'seeing_gfa__0': 0.9498310820793945, 'tilera__0': 24.027, 'elg_efftime_dark__0': 716.840956115723, 'gpb_efftime_dark__0': 0.0, 'transparency_gfa__0': 0.9860573552204372, 'tiledec__0': 31.39, 'airmass_gfa__0': 1.0643660458221693, 'sky_mag_ab_gfa__0': 20.687300622263788, 'efftime_bright_gfa__0': 641.2192606190129, 'efftime_backup_gfa__0': 705.9319105165287, 'mintfrac__0': 0.9, 'tsnr2_bgs__0': 5526.3623046875, 'program__0': 'other', 'expid__0': 68265, 'lya_efftime_dark__0': 881.0479696260478, 'mjd__0': 59200.06640136, 'tsnr2_qso__0': 21.112829208374023, 'tsnr2_elg__0': 83.35359954833984, 'faflavor__0': 'cmxm33', 'sky_mag_r_spec__0': 21.05370965995666, 'sky_mag_z_spec__0': 19.200085082158704, 'tsnr2_lrg__0': 57.5751953125, 'tileid__0': 80615, 'tsnr2_lya__0': 77.01631164550781, 'efftime_dark_gfa__0': 648.1418017037299, 'faprgrm__0': 'm33', 'efftime_gfa__0': 648.1418017037299, 'tsnr2_gpbbright__0': 0.0, 'tsnr2_gpbbackup__0': 0.0, 'gpb_efftime_backup__0': 0.0, 'bgs_efftime_bright__0': 773.69072265625, 'night__0': 20201216, 'fiber_fracflux_bgs_gfa__0': 0.19807581524996704, 'airmass__0': 1.072093, 'exptime__0': 900.0020141601562, 'fiber_fracflux_elg_gfa__0': 0.4338655191836517, 'seeing_etc__0': 0.0, 'tsnr2_gpbdark__0': 0.0, 'gpb_efftime_bright__0': 0.0, 'lrg_efftime_dark__0': 699.573497680911 ... 32556 parameters truncated ... 'efftime_spec__627': 881.8314102172855, 'survey__627': 'sv1', 'fiberfac_bgs_gfa__627': 1.1219008645274058, 'fiberfac_gfa__627': 1.203024136532684, 'date_obs__627': datetime.datetime(2021, 1, 16, 8, 2, 31, 667136, tzinfo=), 'sky_mag_g_spec__627': 21.958881082495996, 'goaltime__627': 1000.0, 'goaltype__627': 'dark', 'seeing_gfa__627': 0.7716763904526707, 'tilera__627': 120.0, 'elg_efftime_dark__627': 881.8314102172855, 'gpb_efftime_dark__627': 0.0, 'transparency_gfa__627': 0.9688503867310785, 'tiledec__627': 34.0, 'airmass_gfa__627': 1.0052397520139693, 'sky_mag_ab_gfa__627': 22.31806687659762, 'efftime_bright_gfa__627': 762.1995935664742, 'efftime_backup_gfa__627': 847.4266225039098, 'mintfrac__627': 0.9, 'tsnr2_bgs__627': 6777.68994140625, 'program__627': 'dark', 'expid__627': 72511, 'lya_efftime_dark__627': 1024.032987862727, 'mjd__627': 59230.33508874, 'tsnr2_qso__627': 25.910263061523438, 'tsnr2_elg__627': 102.53853607177734, 'faflavor__627': 'sv1elgqso', 'sky_mag_r_spec__627': 21.33136785139145, 'sky_mag_z_spec__627': 19.726246214442227, 'tsnr2_lrg__627': 70.26490783691406, 'tileid__627': 80685, 'tsnr2_lya__627': 89.51526641845703, 'efftime_dark_gfa__627': 825.1358589806441, 'faprgrm__627': 'elgqso', 'efftime_gfa__627': 825.1358589806441, 'tsnr2_gpbbright__627': 0.0, 'tsnr2_gpbbackup__627': 0.0, 'gpb_efftime_backup__627': 0.0, 'bgs_efftime_bright__627': 948.8765917968751, 'night__627': 20210115, 'fiber_fracflux_bgs_gfa__627': 0.23162289328675623, 'airmass__627': 1.003325, 'exptime__627': 737.294189453125, 'fiber_fracflux_elg_gfa__627': 0.5170860967073544, 'seeing_etc__627': 0.0, 'tsnr2_gpbdark__627': 0.0, 'gpb_efftime_bright__627': 0.0, 'lrg_efftime_dark__627': 853.7611913063681, 'efftime_etc__627': 0.0, 'fiberfac_elg_gfa__627': 1.1538710145713105}]\n(Background on this error at: https://sqlalche.me/e/20/gkpj) (Background on this error at: https://sqlalche.me/e/20/7s2a)", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mPendingRollbackError\u001b[0m Traceback (most recent call last)", + "File \u001b[0;32m:3\u001b[0m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/scoping.py:597\u001b[0m, in \u001b[0;36mscoped_session.commit\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 558\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mcommit\u001b[39m(\u001b[38;5;28mself\u001b[39m) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 559\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124mr\u001b[39m\u001b[38;5;124;03m\"\"\"Flush pending changes and commit the current transaction.\u001b[39;00m\n\u001b[1;32m 560\u001b[0m \n\u001b[1;32m 561\u001b[0m \u001b[38;5;124;03m .. container:: class_bases\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 594\u001b[0m \n\u001b[1;32m 595\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m \u001b[38;5;66;03m# noqa: E501\u001b[39;00m\n\u001b[0;32m--> 597\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_proxied\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcommit\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/session.py:1972\u001b[0m, in \u001b[0;36mSession.commit\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1969\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m trans \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 1970\u001b[0m trans \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_autobegin_t()\n\u001b[0;32m-> 1972\u001b[0m \u001b[43mtrans\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcommit\u001b[49m\u001b[43m(\u001b[49m\u001b[43m_to_root\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m:2\u001b[0m, in \u001b[0;36mcommit\u001b[0;34m(self, _to_root)\u001b[0m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/state_changes.py:103\u001b[0m, in \u001b[0;36m_StateChange.declare_states.._go\u001b[0;34m(fn, self, *arg, **kw)\u001b[0m\n\u001b[1;32m 97\u001b[0m current_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_state\n\u001b[1;32m 99\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m (\n\u001b[1;32m 100\u001b[0m has_prerequisite_states\n\u001b[1;32m 101\u001b[0m \u001b[38;5;129;01mand\u001b[39;00m current_state \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m prerequisite_state_collection\n\u001b[1;32m 102\u001b[0m ):\n\u001b[0;32m--> 103\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_raise_for_prerequisite_state\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfn\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[38;5;18;43m__name__\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcurrent_state\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 105\u001b[0m next_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_next_state\n\u001b[1;32m 106\u001b[0m existing_fn \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_current_fn\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/session.py:928\u001b[0m, in \u001b[0;36mSessionTransaction._raise_for_prerequisite_state\u001b[0;34m(self, operation_name, state)\u001b[0m\n\u001b[1;32m 926\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m state \u001b[38;5;129;01mis\u001b[39;00m SessionTransactionState\u001b[38;5;241m.\u001b[39mDEACTIVE:\n\u001b[1;32m 927\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_rollback_exception:\n\u001b[0;32m--> 928\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m sa_exc\u001b[38;5;241m.\u001b[39mPendingRollbackError(\n\u001b[1;32m 929\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mThis Session\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124ms transaction has been rolled back \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 930\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdue to a previous exception during flush.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 931\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m To begin a new transaction with this Session, \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 932\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfirst issue Session.rollback().\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 933\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m Original exception was: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_rollback_exception\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 934\u001b[0m code\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m7s2a\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 935\u001b[0m )\n\u001b[1;32m 936\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 937\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m sa_exc\u001b[38;5;241m.\u001b[39mInvalidRequestError(\n\u001b[1;32m 938\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mThis session is in \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124minactive\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m state, due to the \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 939\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mSQL transaction being rolled back; no further SQL \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 940\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcan be emitted within this transaction.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 941\u001b[0m )\n", + "\u001b[0;31mPendingRollbackError\u001b[0m: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (psycopg2.errors.NotNullViolation) null value in column \"fiberfac_gfa\" violates not-null constraint\nDETAIL: Failing row contains (20201222, 69455, 80610, 0, 0, 2020-12-23 12:02:33.591552+00, 59206.50177768, cmx, dark, elg, cmxelg, 900.004028320312, 1.34727168977261, 4000, dark, 0.9, 1.17609, 0.0214956291019917, 0, 0, 0.156659, 0.0387605, 0.103173, 0.166885976066826, 9.49855, 0, 0, 0, 1.25361, 1.34727, 1.3298, 1.909135184888, 0, 0, 0, 0.0691387515196852, 1.425028437377, 0.421895887401468, 0.319807524199896, 0.151348426191788, null, null, null, 1.18246672966859, 20.5068374559146, 21.6948676964909, 20.7336748369694, 19.1617744587365, null, null, null, null).\n\n[SQL: INSERT INTO daily.exposure (night, expid, tileid, tilera, tiledec, date_obs, mjd, survey, program, faprgrm, faflavor, exptime, efftime_spec, goaltime, goaltype, mintfrac, airmass, ebv, seeing_etc, efftime_etc, tsnr2_elg, tsnr2_qso, tsnr2_lrg, tsnr2_l ... 738229 characters truncated ... ime_gfa__627)s, %(efftime_dark_gfa__627)s, %(efftime_bright_gfa__627)s, %(efftime_backup_gfa__627)s)]\n[parameters: {'ebv__0': 0.05477216839790344, 'fiber_fracflux_gfa__0': 0.6093879572762915, 'efftime_spec__0': 716.840956115723, 'survey__0': 'cmx', 'fiberfac_bgs_gfa__0': 0.9697978701302379, 'fiberfac_gfa__0': 1.0061596313996244, 'date_obs__0': datetime.datetime(2020, 12, 17, 1, 35, 37, 77504, tzinfo=), 'sky_mag_g_spec__0': 21.82984125382668, 'goaltime__0': 1000.0, 'goaltype__0': 'unknown', 'seeing_gfa__0': 0.9498310820793945, 'tilera__0': 24.027, 'elg_efftime_dark__0': 716.840956115723, 'gpb_efftime_dark__0': 0.0, 'transparency_gfa__0': 0.9860573552204372, 'tiledec__0': 31.39, 'airmass_gfa__0': 1.0643660458221693, 'sky_mag_ab_gfa__0': 20.687300622263788, 'efftime_bright_gfa__0': 641.2192606190129, 'efftime_backup_gfa__0': 705.9319105165287, 'mintfrac__0': 0.9, 'tsnr2_bgs__0': 5526.3623046875, 'program__0': 'other', 'expid__0': 68265, 'lya_efftime_dark__0': 881.0479696260478, 'mjd__0': 59200.06640136, 'tsnr2_qso__0': 21.112829208374023, 'tsnr2_elg__0': 83.35359954833984, 'faflavor__0': 'cmxm33', 'sky_mag_r_spec__0': 21.05370965995666, 'sky_mag_z_spec__0': 19.200085082158704, 'tsnr2_lrg__0': 57.5751953125, 'tileid__0': 80615, 'tsnr2_lya__0': 77.01631164550781, 'efftime_dark_gfa__0': 648.1418017037299, 'faprgrm__0': 'm33', 'efftime_gfa__0': 648.1418017037299, 'tsnr2_gpbbright__0': 0.0, 'tsnr2_gpbbackup__0': 0.0, 'gpb_efftime_backup__0': 0.0, 'bgs_efftime_bright__0': 773.69072265625, 'night__0': 20201216, 'fiber_fracflux_bgs_gfa__0': 0.19807581524996704, 'airmass__0': 1.072093, 'exptime__0': 900.0020141601562, 'fiber_fracflux_elg_gfa__0': 0.4338655191836517, 'seeing_etc__0': 0.0, 'tsnr2_gpbdark__0': 0.0, 'gpb_efftime_bright__0': 0.0, 'lrg_efftime_dark__0': 699.573497680911 ... 32556 parameters truncated ... 'efftime_spec__627': 881.8314102172855, 'survey__627': 'sv1', 'fiberfac_bgs_gfa__627': 1.1219008645274058, 'fiberfac_gfa__627': 1.203024136532684, 'date_obs__627': datetime.datetime(2021, 1, 16, 8, 2, 31, 667136, tzinfo=), 'sky_mag_g_spec__627': 21.958881082495996, 'goaltime__627': 1000.0, 'goaltype__627': 'dark', 'seeing_gfa__627': 0.7716763904526707, 'tilera__627': 120.0, 'elg_efftime_dark__627': 881.8314102172855, 'gpb_efftime_dark__627': 0.0, 'transparency_gfa__627': 0.9688503867310785, 'tiledec__627': 34.0, 'airmass_gfa__627': 1.0052397520139693, 'sky_mag_ab_gfa__627': 22.31806687659762, 'efftime_bright_gfa__627': 762.1995935664742, 'efftime_backup_gfa__627': 847.4266225039098, 'mintfrac__627': 0.9, 'tsnr2_bgs__627': 6777.68994140625, 'program__627': 'dark', 'expid__627': 72511, 'lya_efftime_dark__627': 1024.032987862727, 'mjd__627': 59230.33508874, 'tsnr2_qso__627': 25.910263061523438, 'tsnr2_elg__627': 102.53853607177734, 'faflavor__627': 'sv1elgqso', 'sky_mag_r_spec__627': 21.33136785139145, 'sky_mag_z_spec__627': 19.726246214442227, 'tsnr2_lrg__627': 70.26490783691406, 'tileid__627': 80685, 'tsnr2_lya__627': 89.51526641845703, 'efftime_dark_gfa__627': 825.1358589806441, 'faprgrm__627': 'elgqso', 'efftime_gfa__627': 825.1358589806441, 'tsnr2_gpbbright__627': 0.0, 'tsnr2_gpbbackup__627': 0.0, 'gpb_efftime_backup__627': 0.0, 'bgs_efftime_bright__627': 948.8765917968751, 'night__627': 20210115, 'fiber_fracflux_bgs_gfa__627': 0.23162289328675623, 'airmass__627': 1.003325, 'exptime__627': 737.294189453125, 'fiber_fracflux_elg_gfa__627': 0.5170860967073544, 'seeing_etc__627': 0.0, 'tsnr2_gpbdark__627': 0.0, 'gpb_efftime_bright__627': 0.0, 'lrg_efftime_dark__627': 853.7611913063681, 'efftime_etc__627': 0.0, 'fiberfac_elg_gfa__627': 1.1538710145713105}]\n(Background on this error at: https://sqlalche.me/e/20/gkpj) (Background on this error at: https://sqlalche.me/e/20/7s2a)" + ] + } + ], "source": [ + "%%time\n", "# db.dbSession.rollback()\n", "db.dbSession.add_all(load_frames)\n", "db.dbSession.commit()" @@ -599,52 +540,149 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, + "id": "f419c90d-1f45-46e4-add8-db81ed260a83", + "metadata": {}, + "outputs": [], + "source": [ + "tile_index = 0" + ] + }, + { + "cell_type": "code", + "execution_count": 14, "id": "6e45a02f-eb7e-415b-bcfb-b655e6c876fc", "metadata": { "tags": [] }, - "outputs": [], + "outputs": [ + { + "ename": "PendingRollbackError", + "evalue": "This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (psycopg2.errors.NotNullViolation) null value in column \"fiberfac_gfa\" violates not-null constraint\nDETAIL: Failing row contains (20201222, 69455, 80610, 0, 0, 2020-12-23 12:02:33.591552+00, 59206.50177768, cmx, dark, elg, cmxelg, 900.004028320312, 1.34727168977261, 4000, dark, 0.9, 1.17609, 0.0214956291019917, 0, 0, 0.156659, 0.0387605, 0.103173, 0.166885976066826, 9.49855, 0, 0, 0, 1.25361, 1.34727, 1.3298, 1.909135184888, 0, 0, 0, 0.0691387515196852, 1.425028437377, 0.421895887401468, 0.319807524199896, 0.151348426191788, null, null, null, 1.18246672966859, 20.5068374559146, 21.6948676964909, 20.7336748369694, 19.1617744587365, null, null, null, null).\n\n[SQL: INSERT INTO daily.exposure (night, expid, tileid, tilera, tiledec, date_obs, mjd, survey, program, faprgrm, faflavor, exptime, efftime_spec, goaltime, goaltype, mintfrac, airmass, ebv, seeing_etc, efftime_etc, tsnr2_elg, tsnr2_qso, tsnr2_lrg, tsnr2_l ... 738229 characters truncated ... ime_gfa__627)s, %(efftime_dark_gfa__627)s, %(efftime_bright_gfa__627)s, %(efftime_backup_gfa__627)s)]\n[parameters: {'ebv__0': 0.05477216839790344, 'fiber_fracflux_gfa__0': 0.6093879572762915, 'efftime_spec__0': 716.840956115723, 'survey__0': 'cmx', 'fiberfac_bgs_gfa__0': 0.9697978701302379, 'fiberfac_gfa__0': 1.0061596313996244, 'date_obs__0': datetime.datetime(2020, 12, 17, 1, 35, 37, 77504, tzinfo=), 'sky_mag_g_spec__0': 21.82984125382668, 'goaltime__0': 1000.0, 'goaltype__0': 'unknown', 'seeing_gfa__0': 0.9498310820793945, 'tilera__0': 24.027, 'elg_efftime_dark__0': 716.840956115723, 'gpb_efftime_dark__0': 0.0, 'transparency_gfa__0': 0.9860573552204372, 'tiledec__0': 31.39, 'airmass_gfa__0': 1.0643660458221693, 'sky_mag_ab_gfa__0': 20.687300622263788, 'efftime_bright_gfa__0': 641.2192606190129, 'efftime_backup_gfa__0': 705.9319105165287, 'mintfrac__0': 0.9, 'tsnr2_bgs__0': 5526.3623046875, 'program__0': 'other', 'expid__0': 68265, 'lya_efftime_dark__0': 881.0479696260478, 'mjd__0': 59200.06640136, 'tsnr2_qso__0': 21.112829208374023, 'tsnr2_elg__0': 83.35359954833984, 'faflavor__0': 'cmxm33', 'sky_mag_r_spec__0': 21.05370965995666, 'sky_mag_z_spec__0': 19.200085082158704, 'tsnr2_lrg__0': 57.5751953125, 'tileid__0': 80615, 'tsnr2_lya__0': 77.01631164550781, 'efftime_dark_gfa__0': 648.1418017037299, 'faprgrm__0': 'm33', 'efftime_gfa__0': 648.1418017037299, 'tsnr2_gpbbright__0': 0.0, 'tsnr2_gpbbackup__0': 0.0, 'gpb_efftime_backup__0': 0.0, 'bgs_efftime_bright__0': 773.69072265625, 'night__0': 20201216, 'fiber_fracflux_bgs_gfa__0': 0.19807581524996704, 'airmass__0': 1.072093, 'exptime__0': 900.0020141601562, 'fiber_fracflux_elg_gfa__0': 0.4338655191836517, 'seeing_etc__0': 0.0, 'tsnr2_gpbdark__0': 0.0, 'gpb_efftime_bright__0': 0.0, 'lrg_efftime_dark__0': 699.573497680911 ... 32556 parameters truncated ... 'efftime_spec__627': 881.8314102172855, 'survey__627': 'sv1', 'fiberfac_bgs_gfa__627': 1.1219008645274058, 'fiberfac_gfa__627': 1.203024136532684, 'date_obs__627': datetime.datetime(2021, 1, 16, 8, 2, 31, 667136, tzinfo=), 'sky_mag_g_spec__627': 21.958881082495996, 'goaltime__627': 1000.0, 'goaltype__627': 'dark', 'seeing_gfa__627': 0.7716763904526707, 'tilera__627': 120.0, 'elg_efftime_dark__627': 881.8314102172855, 'gpb_efftime_dark__627': 0.0, 'transparency_gfa__627': 0.9688503867310785, 'tiledec__627': 34.0, 'airmass_gfa__627': 1.0052397520139693, 'sky_mag_ab_gfa__627': 22.31806687659762, 'efftime_bright_gfa__627': 762.1995935664742, 'efftime_backup_gfa__627': 847.4266225039098, 'mintfrac__627': 0.9, 'tsnr2_bgs__627': 6777.68994140625, 'program__627': 'dark', 'expid__627': 72511, 'lya_efftime_dark__627': 1024.032987862727, 'mjd__627': 59230.33508874, 'tsnr2_qso__627': 25.910263061523438, 'tsnr2_elg__627': 102.53853607177734, 'faflavor__627': 'sv1elgqso', 'sky_mag_r_spec__627': 21.33136785139145, 'sky_mag_z_spec__627': 19.726246214442227, 'tsnr2_lrg__627': 70.26490783691406, 'tileid__627': 80685, 'tsnr2_lya__627': 89.51526641845703, 'efftime_dark_gfa__627': 825.1358589806441, 'faprgrm__627': 'elgqso', 'efftime_gfa__627': 825.1358589806441, 'tsnr2_gpbbright__627': 0.0, 'tsnr2_gpbbackup__627': 0.0, 'gpb_efftime_backup__627': 0.0, 'bgs_efftime_bright__627': 948.8765917968751, 'night__627': 20210115, 'fiber_fracflux_bgs_gfa__627': 0.23162289328675623, 'airmass__627': 1.003325, 'exptime__627': 737.294189453125, 'fiber_fracflux_elg_gfa__627': 0.5170860967073544, 'seeing_etc__627': 0.0, 'tsnr2_gpbdark__627': 0.0, 'gpb_efftime_bright__627': 0.0, 'lrg_efftime_dark__627': 853.7611913063681, 'efftime_etc__627': 0.0, 'fiberfac_elg_gfa__627': 1.1538710145713105}]\n(Background on this error at: https://sqlalche.me/e/20/gkpj) (Background on this error at: https://sqlalche.me/e/20/7s2a)", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mPendingRollbackError\u001b[0m Traceback (most recent call last)", + "File \u001b[0;32m:1\u001b[0m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/attributes.py:566\u001b[0m, in \u001b[0;36mInstrumentedAttribute.__get__\u001b[0;34m(self, instance, owner)\u001b[0m\n\u001b[1;32m 564\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mAttributeError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[1;32m 565\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m orm_exc\u001b[38;5;241m.\u001b[39mUnmappedInstanceError(instance) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01merr\u001b[39;00m\n\u001b[0;32m--> 566\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mimpl\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdict_\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/attributes.py:1086\u001b[0m, in \u001b[0;36mAttributeImpl.get\u001b[0;34m(self, state, dict_, passive)\u001b[0m\n\u001b[1;32m 1083\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m passive \u001b[38;5;241m&\u001b[39m CALLABLES_OK:\n\u001b[1;32m 1084\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m PASSIVE_NO_RESULT\n\u001b[0;32m-> 1086\u001b[0m value \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_fire_loader_callables\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkey\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mpassive\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1088\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m value \u001b[38;5;129;01mis\u001b[39;00m PASSIVE_NO_RESULT \u001b[38;5;129;01mor\u001b[39;00m value \u001b[38;5;129;01mis\u001b[39;00m NO_VALUE:\n\u001b[1;32m 1089\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m value\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/attributes.py:1116\u001b[0m, in \u001b[0;36mAttributeImpl._fire_loader_callables\u001b[0;34m(self, state, key, passive)\u001b[0m\n\u001b[1;32m 1108\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_fire_loader_callables\u001b[39m(\n\u001b[1;32m 1109\u001b[0m \u001b[38;5;28mself\u001b[39m, state: InstanceState[Any], key: \u001b[38;5;28mstr\u001b[39m, passive: PassiveFlag\n\u001b[1;32m 1110\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Any:\n\u001b[1;32m 1111\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m (\n\u001b[1;32m 1112\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39maccepts_scalar_loader\n\u001b[1;32m 1113\u001b[0m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mload_on_unexpire\n\u001b[1;32m 1114\u001b[0m \u001b[38;5;129;01mand\u001b[39;00m key \u001b[38;5;129;01min\u001b[39;00m state\u001b[38;5;241m.\u001b[39mexpired_attributes\n\u001b[1;32m 1115\u001b[0m ):\n\u001b[0;32m-> 1116\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mstate\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_load_expired\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mpassive\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1117\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m key \u001b[38;5;129;01min\u001b[39;00m state\u001b[38;5;241m.\u001b[39mcallables:\n\u001b[1;32m 1118\u001b[0m callable_ \u001b[38;5;241m=\u001b[39m state\u001b[38;5;241m.\u001b[39mcallables[key]\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/state.py:796\u001b[0m, in \u001b[0;36mInstanceState._load_expired\u001b[0;34m(self, state, passive)\u001b[0m\n\u001b[1;32m 789\u001b[0m toload \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mexpired_attributes\u001b[38;5;241m.\u001b[39mintersection(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39munmodified)\n\u001b[1;32m 790\u001b[0m toload \u001b[38;5;241m=\u001b[39m toload\u001b[38;5;241m.\u001b[39mdifference(\n\u001b[1;32m 791\u001b[0m attr\n\u001b[1;32m 792\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m attr \u001b[38;5;129;01min\u001b[39;00m toload\n\u001b[1;32m 793\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mmanager[attr]\u001b[38;5;241m.\u001b[39mimpl\u001b[38;5;241m.\u001b[39mload_on_unexpire\n\u001b[1;32m 794\u001b[0m )\n\u001b[0;32m--> 796\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmanager\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mexpired_attribute_loader\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtoload\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mpassive\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 798\u001b[0m \u001b[38;5;66;03m# if the loader failed, or this\u001b[39;00m\n\u001b[1;32m 799\u001b[0m \u001b[38;5;66;03m# instance state didn't have an identity,\u001b[39;00m\n\u001b[1;32m 800\u001b[0m \u001b[38;5;66;03m# the attributes still might be in the callables\u001b[39;00m\n\u001b[1;32m 801\u001b[0m \u001b[38;5;66;03m# dict. ensure they are removed.\u001b[39;00m\n\u001b[1;32m 802\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mexpired_attributes\u001b[38;5;241m.\u001b[39mclear()\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/loading.py:1653\u001b[0m, in \u001b[0;36mload_scalar_attributes\u001b[0;34m(mapper, state, attribute_names, passive)\u001b[0m\n\u001b[1;32m 1645\u001b[0m util\u001b[38;5;241m.\u001b[39mwarn_limited(\n\u001b[1;32m 1646\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mInstance \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m to be refreshed doesn\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mt \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 1647\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcontain a full primary key - can\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mt be refreshed \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 1648\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m(and shouldn\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mt be expired, either).\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 1649\u001b[0m state_str(state),\n\u001b[1;32m 1650\u001b[0m )\n\u001b[1;32m 1651\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m\n\u001b[0;32m-> 1653\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43mload_on_ident\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1654\u001b[0m \u001b[43m \u001b[49m\u001b[43msession\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1655\u001b[0m \u001b[43m \u001b[49m\u001b[43mselect\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmapper\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mset_label_style\u001b[49m\u001b[43m(\u001b[49m\u001b[43mLABEL_STYLE_TABLENAME_PLUS_COL\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1656\u001b[0m \u001b[43m \u001b[49m\u001b[43midentity_key\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1657\u001b[0m \u001b[43m \u001b[49m\u001b[43mrefresh_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1658\u001b[0m \u001b[43m \u001b[49m\u001b[43monly_load_props\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mattribute_names\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1659\u001b[0m \u001b[43m \u001b[49m\u001b[43mno_autoflush\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mno_autoflush\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1660\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1662\u001b[0m \u001b[38;5;66;03m# if instance is pending, a refresh operation\u001b[39;00m\n\u001b[1;32m 1663\u001b[0m \u001b[38;5;66;03m# may not complete (even if PK attributes are assigned)\u001b[39;00m\n\u001b[1;32m 1664\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m has_key \u001b[38;5;129;01mand\u001b[39;00m result \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/loading.py:509\u001b[0m, in \u001b[0;36mload_on_ident\u001b[0;34m(session, statement, key, load_options, refresh_state, with_for_update, only_load_props, no_autoflush, bind_arguments, execution_options, require_pk_cols, is_user_refresh)\u001b[0m\n\u001b[1;32m 506\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 507\u001b[0m ident \u001b[38;5;241m=\u001b[39m identity_token \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m--> 509\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mload_on_pk_identity\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 510\u001b[0m \u001b[43m \u001b[49m\u001b[43msession\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 511\u001b[0m \u001b[43m \u001b[49m\u001b[43mstatement\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 512\u001b[0m \u001b[43m \u001b[49m\u001b[43mident\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 513\u001b[0m \u001b[43m \u001b[49m\u001b[43mload_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mload_options\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 514\u001b[0m \u001b[43m \u001b[49m\u001b[43mrefresh_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrefresh_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 515\u001b[0m \u001b[43m \u001b[49m\u001b[43mwith_for_update\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mwith_for_update\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 516\u001b[0m \u001b[43m \u001b[49m\u001b[43monly_load_props\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43monly_load_props\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 517\u001b[0m \u001b[43m \u001b[49m\u001b[43midentity_token\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43midentity_token\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 518\u001b[0m \u001b[43m \u001b[49m\u001b[43mno_autoflush\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mno_autoflush\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 519\u001b[0m \u001b[43m \u001b[49m\u001b[43mbind_arguments\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mbind_arguments\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 520\u001b[0m \u001b[43m \u001b[49m\u001b[43mexecution_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mexecution_options\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 521\u001b[0m \u001b[43m \u001b[49m\u001b[43mrequire_pk_cols\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrequire_pk_cols\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 522\u001b[0m \u001b[43m \u001b[49m\u001b[43mis_user_refresh\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mis_user_refresh\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 523\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/loading.py:694\u001b[0m, in \u001b[0;36mload_on_pk_identity\u001b[0;34m(session, statement, primary_key_identity, load_options, refresh_state, with_for_update, only_load_props, identity_token, no_autoflush, bind_arguments, execution_options, require_pk_cols, is_user_refresh)\u001b[0m\n\u001b[1;32m 688\u001b[0m load_options \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m {\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m_autoflush\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;28;01mFalse\u001b[39;00m}\n\u001b[1;32m 690\u001b[0m execution_options \u001b[38;5;241m=\u001b[39m util\u001b[38;5;241m.\u001b[39mEMPTY_DICT\u001b[38;5;241m.\u001b[39mmerge_with(\n\u001b[1;32m 691\u001b[0m execution_options, {\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m_sa_orm_load_options\u001b[39m\u001b[38;5;124m\"\u001b[39m: load_options}\n\u001b[1;32m 692\u001b[0m )\n\u001b[1;32m 693\u001b[0m result \u001b[38;5;241m=\u001b[39m (\n\u001b[0;32m--> 694\u001b[0m \u001b[43msession\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mexecute\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 695\u001b[0m \u001b[43m \u001b[49m\u001b[43mq\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 696\u001b[0m \u001b[43m \u001b[49m\u001b[43mparams\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mparams\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 697\u001b[0m \u001b[43m \u001b[49m\u001b[43mexecution_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mexecution_options\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 698\u001b[0m \u001b[43m \u001b[49m\u001b[43mbind_arguments\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mbind_arguments\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 699\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 700\u001b[0m \u001b[38;5;241m.\u001b[39munique()\n\u001b[1;32m 701\u001b[0m \u001b[38;5;241m.\u001b[39mscalars()\n\u001b[1;32m 702\u001b[0m )\n\u001b[1;32m 704\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m 705\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\u001b[38;5;241m.\u001b[39mone()\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/session.py:2306\u001b[0m, in \u001b[0;36mSession.execute\u001b[0;34m(self, statement, params, execution_options, bind_arguments, _parent_execute_state, _add_event)\u001b[0m\n\u001b[1;32m 2245\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mexecute\u001b[39m(\n\u001b[1;32m 2246\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[1;32m 2247\u001b[0m statement: Executable,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 2253\u001b[0m _add_event: Optional[Any] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[1;32m 2254\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Result[Any]:\n\u001b[1;32m 2255\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124mr\u001b[39m\u001b[38;5;124;03m\"\"\"Execute a SQL expression construct.\u001b[39;00m\n\u001b[1;32m 2256\u001b[0m \n\u001b[1;32m 2257\u001b[0m \u001b[38;5;124;03m Returns a :class:`_engine.Result` object representing\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 2304\u001b[0m \n\u001b[1;32m 2305\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m-> 2306\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_execute_internal\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 2307\u001b[0m \u001b[43m \u001b[49m\u001b[43mstatement\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2308\u001b[0m \u001b[43m \u001b[49m\u001b[43mparams\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2309\u001b[0m \u001b[43m \u001b[49m\u001b[43mexecution_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mexecution_options\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2310\u001b[0m \u001b[43m \u001b[49m\u001b[43mbind_arguments\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mbind_arguments\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2311\u001b[0m \u001b[43m \u001b[49m\u001b[43m_parent_execute_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m_parent_execute_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2312\u001b[0m \u001b[43m \u001b[49m\u001b[43m_add_event\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m_add_event\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2313\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/session.py:2181\u001b[0m, in \u001b[0;36mSession._execute_internal\u001b[0;34m(self, statement, params, execution_options, bind_arguments, _parent_execute_state, _add_event, _scalar_result)\u001b[0m\n\u001b[1;32m 2167\u001b[0m (\n\u001b[1;32m 2168\u001b[0m statement,\n\u001b[1;32m 2169\u001b[0m execution_options,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 2176\u001b[0m \u001b[38;5;28;01mFalse\u001b[39;00m,\n\u001b[1;32m 2177\u001b[0m )\n\u001b[1;32m 2179\u001b[0m bind \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mget_bind(\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mbind_arguments)\n\u001b[0;32m-> 2181\u001b[0m conn \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_connection_for_bind\u001b[49m\u001b[43m(\u001b[49m\u001b[43mbind\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2183\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m _scalar_result \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m compile_state_cls:\n\u001b[1;32m 2184\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m TYPE_CHECKING:\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/session.py:2050\u001b[0m, in \u001b[0;36mSession._connection_for_bind\u001b[0;34m(self, engine, execution_options, **kw)\u001b[0m\n\u001b[1;32m 2048\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m trans \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 2049\u001b[0m trans \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_autobegin_t()\n\u001b[0;32m-> 2050\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mtrans\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_connection_for_bind\u001b[49m\u001b[43m(\u001b[49m\u001b[43mengine\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mexecution_options\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m:2\u001b[0m, in \u001b[0;36m_connection_for_bind\u001b[0;34m(self, bind, execution_options)\u001b[0m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/state_changes.py:103\u001b[0m, in \u001b[0;36m_StateChange.declare_states.._go\u001b[0;34m(fn, self, *arg, **kw)\u001b[0m\n\u001b[1;32m 97\u001b[0m current_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_state\n\u001b[1;32m 99\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m (\n\u001b[1;32m 100\u001b[0m has_prerequisite_states\n\u001b[1;32m 101\u001b[0m \u001b[38;5;129;01mand\u001b[39;00m current_state \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m prerequisite_state_collection\n\u001b[1;32m 102\u001b[0m ):\n\u001b[0;32m--> 103\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_raise_for_prerequisite_state\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfn\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[38;5;18;43m__name__\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcurrent_state\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 105\u001b[0m next_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_next_state\n\u001b[1;32m 106\u001b[0m existing_fn \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_current_fn\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/session.py:928\u001b[0m, in \u001b[0;36mSessionTransaction._raise_for_prerequisite_state\u001b[0;34m(self, operation_name, state)\u001b[0m\n\u001b[1;32m 926\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m state \u001b[38;5;129;01mis\u001b[39;00m SessionTransactionState\u001b[38;5;241m.\u001b[39mDEACTIVE:\n\u001b[1;32m 927\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_rollback_exception:\n\u001b[0;32m--> 928\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m sa_exc\u001b[38;5;241m.\u001b[39mPendingRollbackError(\n\u001b[1;32m 929\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mThis Session\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124ms transaction has been rolled back \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 930\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdue to a previous exception during flush.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 931\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m To begin a new transaction with this Session, \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 932\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfirst issue Session.rollback().\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 933\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m Original exception was: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_rollback_exception\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 934\u001b[0m code\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m7s2a\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 935\u001b[0m )\n\u001b[1;32m 936\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 937\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m sa_exc\u001b[38;5;241m.\u001b[39mInvalidRequestError(\n\u001b[1;32m 938\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mThis session is in \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124minactive\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m state, due to the \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 939\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mSQL transaction being rolled back; no further SQL \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 940\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcan be emitted within this transaction.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 941\u001b[0m )\n", + "\u001b[0;31mPendingRollbackError\u001b[0m: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (psycopg2.errors.NotNullViolation) null value in column \"fiberfac_gfa\" violates not-null constraint\nDETAIL: Failing row contains (20201222, 69455, 80610, 0, 0, 2020-12-23 12:02:33.591552+00, 59206.50177768, cmx, dark, elg, cmxelg, 900.004028320312, 1.34727168977261, 4000, dark, 0.9, 1.17609, 0.0214956291019917, 0, 0, 0.156659, 0.0387605, 0.103173, 0.166885976066826, 9.49855, 0, 0, 0, 1.25361, 1.34727, 1.3298, 1.909135184888, 0, 0, 0, 0.0691387515196852, 1.425028437377, 0.421895887401468, 0.319807524199896, 0.151348426191788, null, null, null, 1.18246672966859, 20.5068374559146, 21.6948676964909, 20.7336748369694, 19.1617744587365, null, null, null, null).\n\n[SQL: INSERT INTO daily.exposure (night, expid, tileid, tilera, tiledec, date_obs, mjd, survey, program, faprgrm, faflavor, exptime, efftime_spec, goaltime, goaltype, mintfrac, airmass, ebv, seeing_etc, efftime_etc, tsnr2_elg, tsnr2_qso, tsnr2_lrg, tsnr2_l ... 738229 characters truncated ... ime_gfa__627)s, %(efftime_dark_gfa__627)s, %(efftime_bright_gfa__627)s, %(efftime_backup_gfa__627)s)]\n[parameters: {'ebv__0': 0.05477216839790344, 'fiber_fracflux_gfa__0': 0.6093879572762915, 'efftime_spec__0': 716.840956115723, 'survey__0': 'cmx', 'fiberfac_bgs_gfa__0': 0.9697978701302379, 'fiberfac_gfa__0': 1.0061596313996244, 'date_obs__0': datetime.datetime(2020, 12, 17, 1, 35, 37, 77504, tzinfo=), 'sky_mag_g_spec__0': 21.82984125382668, 'goaltime__0': 1000.0, 'goaltype__0': 'unknown', 'seeing_gfa__0': 0.9498310820793945, 'tilera__0': 24.027, 'elg_efftime_dark__0': 716.840956115723, 'gpb_efftime_dark__0': 0.0, 'transparency_gfa__0': 0.9860573552204372, 'tiledec__0': 31.39, 'airmass_gfa__0': 1.0643660458221693, 'sky_mag_ab_gfa__0': 20.687300622263788, 'efftime_bright_gfa__0': 641.2192606190129, 'efftime_backup_gfa__0': 705.9319105165287, 'mintfrac__0': 0.9, 'tsnr2_bgs__0': 5526.3623046875, 'program__0': 'other', 'expid__0': 68265, 'lya_efftime_dark__0': 881.0479696260478, 'mjd__0': 59200.06640136, 'tsnr2_qso__0': 21.112829208374023, 'tsnr2_elg__0': 83.35359954833984, 'faflavor__0': 'cmxm33', 'sky_mag_r_spec__0': 21.05370965995666, 'sky_mag_z_spec__0': 19.200085082158704, 'tsnr2_lrg__0': 57.5751953125, 'tileid__0': 80615, 'tsnr2_lya__0': 77.01631164550781, 'efftime_dark_gfa__0': 648.1418017037299, 'faprgrm__0': 'm33', 'efftime_gfa__0': 648.1418017037299, 'tsnr2_gpbbright__0': 0.0, 'tsnr2_gpbbackup__0': 0.0, 'gpb_efftime_backup__0': 0.0, 'bgs_efftime_bright__0': 773.69072265625, 'night__0': 20201216, 'fiber_fracflux_bgs_gfa__0': 0.19807581524996704, 'airmass__0': 1.072093, 'exptime__0': 900.0020141601562, 'fiber_fracflux_elg_gfa__0': 0.4338655191836517, 'seeing_etc__0': 0.0, 'tsnr2_gpbdark__0': 0.0, 'gpb_efftime_bright__0': 0.0, 'lrg_efftime_dark__0': 699.573497680911 ... 32556 parameters truncated ... 'efftime_spec__627': 881.8314102172855, 'survey__627': 'sv1', 'fiberfac_bgs_gfa__627': 1.1219008645274058, 'fiberfac_gfa__627': 1.203024136532684, 'date_obs__627': datetime.datetime(2021, 1, 16, 8, 2, 31, 667136, tzinfo=), 'sky_mag_g_spec__627': 21.958881082495996, 'goaltime__627': 1000.0, 'goaltype__627': 'dark', 'seeing_gfa__627': 0.7716763904526707, 'tilera__627': 120.0, 'elg_efftime_dark__627': 881.8314102172855, 'gpb_efftime_dark__627': 0.0, 'transparency_gfa__627': 0.9688503867310785, 'tiledec__627': 34.0, 'airmass_gfa__627': 1.0052397520139693, 'sky_mag_ab_gfa__627': 22.31806687659762, 'efftime_bright_gfa__627': 762.1995935664742, 'efftime_backup_gfa__627': 847.4266225039098, 'mintfrac__627': 0.9, 'tsnr2_bgs__627': 6777.68994140625, 'program__627': 'dark', 'expid__627': 72511, 'lya_efftime_dark__627': 1024.032987862727, 'mjd__627': 59230.33508874, 'tsnr2_qso__627': 25.910263061523438, 'tsnr2_elg__627': 102.53853607177734, 'faflavor__627': 'sv1elgqso', 'sky_mag_r_spec__627': 21.33136785139145, 'sky_mag_z_spec__627': 19.726246214442227, 'tsnr2_lrg__627': 70.26490783691406, 'tileid__627': 80685, 'tsnr2_lya__627': 89.51526641845703, 'efftime_dark_gfa__627': 825.1358589806441, 'faprgrm__627': 'elgqso', 'efftime_gfa__627': 825.1358589806441, 'tsnr2_gpbbright__627': 0.0, 'tsnr2_gpbbackup__627': 0.0, 'gpb_efftime_backup__627': 0.0, 'bgs_efftime_bright__627': 948.8765917968751, 'night__627': 20210115, 'fiber_fracflux_bgs_gfa__627': 0.23162289328675623, 'airmass__627': 1.003325, 'exptime__627': 737.294189453125, 'fiber_fracflux_elg_gfa__627': 0.5170860967073544, 'seeing_etc__627': 0.0, 'tsnr2_gpbdark__627': 0.0, 'gpb_efftime_bright__627': 0.0, 'lrg_efftime_dark__627': 853.7611913063681, 'efftime_etc__627': 0.0, 'fiberfac_elg_gfa__627': 1.1538710145713105}]\n(Background on this error at: https://sqlalche.me/e/20/gkpj) (Background on this error at: https://sqlalche.me/e/20/7s2a)" + ] + } + ], "source": [ - "potential_targets_table = t.potential_targets(load_tiles[1].tileid)\n", + "%%time\n", + "potential_targets_table = t.potential_targets(load_tiles[tile_index].tileid)\n", "# potential_targets_table" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 15, "id": "2c2a5859-47b9-41aa-bcd6-7ec02397e2df", "metadata": { "tags": [] }, - "outputs": [], + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'potential_targets_table' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", + "File \u001b[0;32m:1\u001b[0m\n", + "\u001b[0;31mNameError\u001b[0m: name 'potential_targets_table' is not defined" + ] + } + ], "source": [ - "potential_cat = t.potential_photometry(load_tiles[1], potential_targets_table)\n", + "%%time\n", + "potential_cat = t.potential_photometry(load_tiles[tile_index], potential_targets_table)\n", "# potential_cat" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 16, "id": "ffbae527-c5e1-43b5-b63f-8d34891dc2f8", "metadata": { "tags": [] }, - "outputs": [], + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'potential_cat' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", + "File \u001b[0;32m:1\u001b[0m\n", + "\u001b[0;31mNameError\u001b[0m: name 'potential_cat' is not defined" + ] + } + ], + "source": [ + "%%time\n", + "potential_targetphot = t.targetphot(potential_cat)" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "id": "94e10407-edee-4731-ad7c-3de63749dd7f", + "metadata": {}, + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'potential_cat' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", + "File \u001b[0;32m:1\u001b[0m\n", + "\u001b[0;31mNameError\u001b[0m: name 'potential_cat' is not defined" + ] + } + ], "source": [ - "potential_targetphot = t.targetphot(potential_cat)\n", + "%%time\n", "potential_tractorphot = t.tractorphot(potential_cat)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 18, "id": "f1f7e918-f906-4545-bfb3-d3a9b686111c", "metadata": { "tags": [] }, - "outputs": [], + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'potential_tractorphot' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", + "File \u001b[0;32m:1\u001b[0m\n", + "\u001b[0;31mNameError\u001b[0m: name 'potential_tractorphot' is not defined" + ] + } + ], "source": [ + "%%time\n", "load_photometry = t.load_photometry(potential_tractorphot)" ] }, @@ -658,13 +696,26 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 19, "id": "10c990d3-b90c-4999-885d-9467f30220a6", "metadata": { "tags": [] }, - "outputs": [], + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'potential_targetphot' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", + "File \u001b[0;32m:1\u001b[0m\n", + "\u001b[0;31mNameError\u001b[0m: name 'potential_targetphot' is not defined" + ] + } + ], "source": [ + "%%time\n", "load_targetphot = t.load_targetphot(potential_targetphot, load_photometry)" ] }, @@ -678,14 +729,27 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 20, "id": "81e78286-da02-4208-b2e3-ca434d643020", "metadata": { "tags": [] }, - "outputs": [], + "outputs": [ + { + "ename": "NameError", + "evalue": "name 'potential_targetphot' is not defined", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", + "File \u001b[0;32m:1\u001b[0m\n", + "\u001b[0;31mNameError\u001b[0m: name 'potential_targetphot' is not defined" + ] + } + ], "source": [ - "load_target = t.load_target(load_tiles[1], potential_targetphot)" + "%%time\n", + "load_target = t.load_target(load_tiles[tile_index], potential_targetphot)" ] }, { @@ -700,12 +764,39 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 21, "id": "0dc5e0b1-54a2-4975-aa97-6e533cb1d75a", "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "PendingRollbackError", + "evalue": "This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (psycopg2.errors.NotNullViolation) null value in column \"fiberfac_gfa\" violates not-null constraint\nDETAIL: Failing row contains (20201222, 69455, 80610, 0, 0, 2020-12-23 12:02:33.591552+00, 59206.50177768, cmx, dark, elg, cmxelg, 900.004028320312, 1.34727168977261, 4000, dark, 0.9, 1.17609, 0.0214956291019917, 0, 0, 0.156659, 0.0387605, 0.103173, 0.166885976066826, 9.49855, 0, 0, 0, 1.25361, 1.34727, 1.3298, 1.909135184888, 0, 0, 0, 0.0691387515196852, 1.425028437377, 0.421895887401468, 0.319807524199896, 0.151348426191788, null, null, null, 1.18246672966859, 20.5068374559146, 21.6948676964909, 20.7336748369694, 19.1617744587365, null, null, null, null).\n\n[SQL: INSERT INTO daily.exposure (night, expid, tileid, tilera, tiledec, date_obs, mjd, survey, program, faprgrm, faflavor, exptime, efftime_spec, goaltime, goaltype, mintfrac, airmass, ebv, seeing_etc, efftime_etc, tsnr2_elg, tsnr2_qso, tsnr2_lrg, tsnr2_l ... 738229 characters truncated ... ime_gfa__627)s, %(efftime_dark_gfa__627)s, %(efftime_bright_gfa__627)s, %(efftime_backup_gfa__627)s)]\n[parameters: {'ebv__0': 0.05477216839790344, 'fiber_fracflux_gfa__0': 0.6093879572762915, 'efftime_spec__0': 716.840956115723, 'survey__0': 'cmx', 'fiberfac_bgs_gfa__0': 0.9697978701302379, 'fiberfac_gfa__0': 1.0061596313996244, 'date_obs__0': datetime.datetime(2020, 12, 17, 1, 35, 37, 77504, tzinfo=), 'sky_mag_g_spec__0': 21.82984125382668, 'goaltime__0': 1000.0, 'goaltype__0': 'unknown', 'seeing_gfa__0': 0.9498310820793945, 'tilera__0': 24.027, 'elg_efftime_dark__0': 716.840956115723, 'gpb_efftime_dark__0': 0.0, 'transparency_gfa__0': 0.9860573552204372, 'tiledec__0': 31.39, 'airmass_gfa__0': 1.0643660458221693, 'sky_mag_ab_gfa__0': 20.687300622263788, 'efftime_bright_gfa__0': 641.2192606190129, 'efftime_backup_gfa__0': 705.9319105165287, 'mintfrac__0': 0.9, 'tsnr2_bgs__0': 5526.3623046875, 'program__0': 'other', 'expid__0': 68265, 'lya_efftime_dark__0': 881.0479696260478, 'mjd__0': 59200.06640136, 'tsnr2_qso__0': 21.112829208374023, 'tsnr2_elg__0': 83.35359954833984, 'faflavor__0': 'cmxm33', 'sky_mag_r_spec__0': 21.05370965995666, 'sky_mag_z_spec__0': 19.200085082158704, 'tsnr2_lrg__0': 57.5751953125, 'tileid__0': 80615, 'tsnr2_lya__0': 77.01631164550781, 'efftime_dark_gfa__0': 648.1418017037299, 'faprgrm__0': 'm33', 'efftime_gfa__0': 648.1418017037299, 'tsnr2_gpbbright__0': 0.0, 'tsnr2_gpbbackup__0': 0.0, 'gpb_efftime_backup__0': 0.0, 'bgs_efftime_bright__0': 773.69072265625, 'night__0': 20201216, 'fiber_fracflux_bgs_gfa__0': 0.19807581524996704, 'airmass__0': 1.072093, 'exptime__0': 900.0020141601562, 'fiber_fracflux_elg_gfa__0': 0.4338655191836517, 'seeing_etc__0': 0.0, 'tsnr2_gpbdark__0': 0.0, 'gpb_efftime_bright__0': 0.0, 'lrg_efftime_dark__0': 699.573497680911 ... 32556 parameters truncated ... 'efftime_spec__627': 881.8314102172855, 'survey__627': 'sv1', 'fiberfac_bgs_gfa__627': 1.1219008645274058, 'fiberfac_gfa__627': 1.203024136532684, 'date_obs__627': datetime.datetime(2021, 1, 16, 8, 2, 31, 667136, tzinfo=), 'sky_mag_g_spec__627': 21.958881082495996, 'goaltime__627': 1000.0, 'goaltype__627': 'dark', 'seeing_gfa__627': 0.7716763904526707, 'tilera__627': 120.0, 'elg_efftime_dark__627': 881.8314102172855, 'gpb_efftime_dark__627': 0.0, 'transparency_gfa__627': 0.9688503867310785, 'tiledec__627': 34.0, 'airmass_gfa__627': 1.0052397520139693, 'sky_mag_ab_gfa__627': 22.31806687659762, 'efftime_bright_gfa__627': 762.1995935664742, 'efftime_backup_gfa__627': 847.4266225039098, 'mintfrac__627': 0.9, 'tsnr2_bgs__627': 6777.68994140625, 'program__627': 'dark', 'expid__627': 72511, 'lya_efftime_dark__627': 1024.032987862727, 'mjd__627': 59230.33508874, 'tsnr2_qso__627': 25.910263061523438, 'tsnr2_elg__627': 102.53853607177734, 'faflavor__627': 'sv1elgqso', 'sky_mag_r_spec__627': 21.33136785139145, 'sky_mag_z_spec__627': 19.726246214442227, 'tsnr2_lrg__627': 70.26490783691406, 'tileid__627': 80685, 'tsnr2_lya__627': 89.51526641845703, 'efftime_dark_gfa__627': 825.1358589806441, 'faprgrm__627': 'elgqso', 'efftime_gfa__627': 825.1358589806441, 'tsnr2_gpbbright__627': 0.0, 'tsnr2_gpbbackup__627': 0.0, 'gpb_efftime_backup__627': 0.0, 'bgs_efftime_bright__627': 948.8765917968751, 'night__627': 20210115, 'fiber_fracflux_bgs_gfa__627': 0.23162289328675623, 'airmass__627': 1.003325, 'exptime__627': 737.294189453125, 'fiber_fracflux_elg_gfa__627': 0.5170860967073544, 'seeing_etc__627': 0.0, 'tsnr2_gpbdark__627': 0.0, 'gpb_efftime_bright__627': 0.0, 'lrg_efftime_dark__627': 853.7611913063681, 'efftime_etc__627': 0.0, 'fiberfac_elg_gfa__627': 1.1538710145713105}]\n(Background on this error at: https://sqlalche.me/e/20/gkpj) (Background on this error at: https://sqlalche.me/e/20/7s2a)", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mPendingRollbackError\u001b[0m Traceback (most recent call last)", + "File \u001b[0;32m:1\u001b[0m\n", + "File \u001b[0;32m/global/common/software/desi/users/bweaver/perlmutter/desiconda/current/code/specprod-db/my-main/py/specprodDB/tile.py:293\u001b[0m, in \u001b[0;36mload_redshift\u001b[0;34m(tile, spgrp)\u001b[0m\n\u001b[1;32m 290\u001b[0m redrock_files \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mlist\u001b[39m()\n\u001b[1;32m 291\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m spectrograph \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mrange\u001b[39m(\u001b[38;5;241m10\u001b[39m):\n\u001b[1;32m 292\u001b[0m redrock_file, redrock_exists \u001b[38;5;241m=\u001b[39m findfile(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mredrock_tile\u001b[39m\u001b[38;5;124m'\u001b[39m, groupname\u001b[38;5;241m=\u001b[39mspgrp,\n\u001b[0;32m--> 293\u001b[0m tile\u001b[38;5;241m=\u001b[39m\u001b[43mtile\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtileid\u001b[49m, spectrograph\u001b[38;5;241m=\u001b[39mspectrograph,\n\u001b[1;32m 294\u001b[0m night\u001b[38;5;241m=\u001b[39mtile\u001b[38;5;241m.\u001b[39mlastnight,\n\u001b[1;32m 295\u001b[0m readonly\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m, return_exists\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mTrue\u001b[39;00m)\n\u001b[1;32m 296\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m redrock_exists:\n\u001b[1;32m 297\u001b[0m redrock_files\u001b[38;5;241m.\u001b[39mappend(redrock_file)\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/attributes.py:566\u001b[0m, in \u001b[0;36mInstrumentedAttribute.__get__\u001b[0;34m(self, instance, owner)\u001b[0m\n\u001b[1;32m 564\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mAttributeError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[1;32m 565\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m orm_exc\u001b[38;5;241m.\u001b[39mUnmappedInstanceError(instance) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01merr\u001b[39;00m\n\u001b[0;32m--> 566\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mimpl\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdict_\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/attributes.py:1086\u001b[0m, in \u001b[0;36mAttributeImpl.get\u001b[0;34m(self, state, dict_, passive)\u001b[0m\n\u001b[1;32m 1083\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m passive \u001b[38;5;241m&\u001b[39m CALLABLES_OK:\n\u001b[1;32m 1084\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m PASSIVE_NO_RESULT\n\u001b[0;32m-> 1086\u001b[0m value \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_fire_loader_callables\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkey\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mpassive\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1088\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m value \u001b[38;5;129;01mis\u001b[39;00m PASSIVE_NO_RESULT \u001b[38;5;129;01mor\u001b[39;00m value \u001b[38;5;129;01mis\u001b[39;00m NO_VALUE:\n\u001b[1;32m 1089\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m value\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/attributes.py:1116\u001b[0m, in \u001b[0;36mAttributeImpl._fire_loader_callables\u001b[0;34m(self, state, key, passive)\u001b[0m\n\u001b[1;32m 1108\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_fire_loader_callables\u001b[39m(\n\u001b[1;32m 1109\u001b[0m \u001b[38;5;28mself\u001b[39m, state: InstanceState[Any], key: \u001b[38;5;28mstr\u001b[39m, passive: PassiveFlag\n\u001b[1;32m 1110\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Any:\n\u001b[1;32m 1111\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m (\n\u001b[1;32m 1112\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39maccepts_scalar_loader\n\u001b[1;32m 1113\u001b[0m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mload_on_unexpire\n\u001b[1;32m 1114\u001b[0m \u001b[38;5;129;01mand\u001b[39;00m key \u001b[38;5;129;01min\u001b[39;00m state\u001b[38;5;241m.\u001b[39mexpired_attributes\n\u001b[1;32m 1115\u001b[0m ):\n\u001b[0;32m-> 1116\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mstate\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_load_expired\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mpassive\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1117\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m key \u001b[38;5;129;01min\u001b[39;00m state\u001b[38;5;241m.\u001b[39mcallables:\n\u001b[1;32m 1118\u001b[0m callable_ \u001b[38;5;241m=\u001b[39m state\u001b[38;5;241m.\u001b[39mcallables[key]\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/state.py:796\u001b[0m, in \u001b[0;36mInstanceState._load_expired\u001b[0;34m(self, state, passive)\u001b[0m\n\u001b[1;32m 789\u001b[0m toload \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mexpired_attributes\u001b[38;5;241m.\u001b[39mintersection(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39munmodified)\n\u001b[1;32m 790\u001b[0m toload \u001b[38;5;241m=\u001b[39m toload\u001b[38;5;241m.\u001b[39mdifference(\n\u001b[1;32m 791\u001b[0m attr\n\u001b[1;32m 792\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m attr \u001b[38;5;129;01min\u001b[39;00m toload\n\u001b[1;32m 793\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mmanager[attr]\u001b[38;5;241m.\u001b[39mimpl\u001b[38;5;241m.\u001b[39mload_on_unexpire\n\u001b[1;32m 794\u001b[0m )\n\u001b[0;32m--> 796\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmanager\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mexpired_attribute_loader\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtoload\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mpassive\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 798\u001b[0m \u001b[38;5;66;03m# if the loader failed, or this\u001b[39;00m\n\u001b[1;32m 799\u001b[0m \u001b[38;5;66;03m# instance state didn't have an identity,\u001b[39;00m\n\u001b[1;32m 800\u001b[0m \u001b[38;5;66;03m# the attributes still might be in the callables\u001b[39;00m\n\u001b[1;32m 801\u001b[0m \u001b[38;5;66;03m# dict. ensure they are removed.\u001b[39;00m\n\u001b[1;32m 802\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mexpired_attributes\u001b[38;5;241m.\u001b[39mclear()\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/loading.py:1653\u001b[0m, in \u001b[0;36mload_scalar_attributes\u001b[0;34m(mapper, state, attribute_names, passive)\u001b[0m\n\u001b[1;32m 1645\u001b[0m util\u001b[38;5;241m.\u001b[39mwarn_limited(\n\u001b[1;32m 1646\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mInstance \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m to be refreshed doesn\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mt \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 1647\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcontain a full primary key - can\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mt be refreshed \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 1648\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m(and shouldn\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mt be expired, either).\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 1649\u001b[0m state_str(state),\n\u001b[1;32m 1650\u001b[0m )\n\u001b[1;32m 1651\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m\n\u001b[0;32m-> 1653\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43mload_on_ident\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1654\u001b[0m \u001b[43m \u001b[49m\u001b[43msession\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1655\u001b[0m \u001b[43m \u001b[49m\u001b[43mselect\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmapper\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mset_label_style\u001b[49m\u001b[43m(\u001b[49m\u001b[43mLABEL_STYLE_TABLENAME_PLUS_COL\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1656\u001b[0m \u001b[43m \u001b[49m\u001b[43midentity_key\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1657\u001b[0m \u001b[43m \u001b[49m\u001b[43mrefresh_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1658\u001b[0m \u001b[43m \u001b[49m\u001b[43monly_load_props\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mattribute_names\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1659\u001b[0m \u001b[43m \u001b[49m\u001b[43mno_autoflush\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mno_autoflush\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1660\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1662\u001b[0m \u001b[38;5;66;03m# if instance is pending, a refresh operation\u001b[39;00m\n\u001b[1;32m 1663\u001b[0m \u001b[38;5;66;03m# may not complete (even if PK attributes are assigned)\u001b[39;00m\n\u001b[1;32m 1664\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m has_key \u001b[38;5;129;01mand\u001b[39;00m result \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/loading.py:509\u001b[0m, in \u001b[0;36mload_on_ident\u001b[0;34m(session, statement, key, load_options, refresh_state, with_for_update, only_load_props, no_autoflush, bind_arguments, execution_options, require_pk_cols, is_user_refresh)\u001b[0m\n\u001b[1;32m 506\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 507\u001b[0m ident \u001b[38;5;241m=\u001b[39m identity_token \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m--> 509\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mload_on_pk_identity\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 510\u001b[0m \u001b[43m \u001b[49m\u001b[43msession\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 511\u001b[0m \u001b[43m \u001b[49m\u001b[43mstatement\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 512\u001b[0m \u001b[43m \u001b[49m\u001b[43mident\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 513\u001b[0m \u001b[43m \u001b[49m\u001b[43mload_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mload_options\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 514\u001b[0m \u001b[43m \u001b[49m\u001b[43mrefresh_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrefresh_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 515\u001b[0m \u001b[43m \u001b[49m\u001b[43mwith_for_update\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mwith_for_update\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 516\u001b[0m \u001b[43m \u001b[49m\u001b[43monly_load_props\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43monly_load_props\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 517\u001b[0m \u001b[43m \u001b[49m\u001b[43midentity_token\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43midentity_token\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 518\u001b[0m \u001b[43m \u001b[49m\u001b[43mno_autoflush\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mno_autoflush\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 519\u001b[0m \u001b[43m \u001b[49m\u001b[43mbind_arguments\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mbind_arguments\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 520\u001b[0m \u001b[43m \u001b[49m\u001b[43mexecution_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mexecution_options\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 521\u001b[0m \u001b[43m \u001b[49m\u001b[43mrequire_pk_cols\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrequire_pk_cols\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 522\u001b[0m \u001b[43m \u001b[49m\u001b[43mis_user_refresh\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mis_user_refresh\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 523\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/loading.py:694\u001b[0m, in \u001b[0;36mload_on_pk_identity\u001b[0;34m(session, statement, primary_key_identity, load_options, refresh_state, with_for_update, only_load_props, identity_token, no_autoflush, bind_arguments, execution_options, require_pk_cols, is_user_refresh)\u001b[0m\n\u001b[1;32m 688\u001b[0m load_options \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m {\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m_autoflush\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;28;01mFalse\u001b[39;00m}\n\u001b[1;32m 690\u001b[0m execution_options \u001b[38;5;241m=\u001b[39m util\u001b[38;5;241m.\u001b[39mEMPTY_DICT\u001b[38;5;241m.\u001b[39mmerge_with(\n\u001b[1;32m 691\u001b[0m execution_options, {\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m_sa_orm_load_options\u001b[39m\u001b[38;5;124m\"\u001b[39m: load_options}\n\u001b[1;32m 692\u001b[0m )\n\u001b[1;32m 693\u001b[0m result \u001b[38;5;241m=\u001b[39m (\n\u001b[0;32m--> 694\u001b[0m \u001b[43msession\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mexecute\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 695\u001b[0m \u001b[43m \u001b[49m\u001b[43mq\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 696\u001b[0m \u001b[43m \u001b[49m\u001b[43mparams\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mparams\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 697\u001b[0m \u001b[43m \u001b[49m\u001b[43mexecution_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mexecution_options\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 698\u001b[0m \u001b[43m \u001b[49m\u001b[43mbind_arguments\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mbind_arguments\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 699\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 700\u001b[0m \u001b[38;5;241m.\u001b[39munique()\n\u001b[1;32m 701\u001b[0m \u001b[38;5;241m.\u001b[39mscalars()\n\u001b[1;32m 702\u001b[0m )\n\u001b[1;32m 704\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m 705\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\u001b[38;5;241m.\u001b[39mone()\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/session.py:2306\u001b[0m, in \u001b[0;36mSession.execute\u001b[0;34m(self, statement, params, execution_options, bind_arguments, _parent_execute_state, _add_event)\u001b[0m\n\u001b[1;32m 2245\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mexecute\u001b[39m(\n\u001b[1;32m 2246\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[1;32m 2247\u001b[0m statement: Executable,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 2253\u001b[0m _add_event: Optional[Any] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[1;32m 2254\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Result[Any]:\n\u001b[1;32m 2255\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124mr\u001b[39m\u001b[38;5;124;03m\"\"\"Execute a SQL expression construct.\u001b[39;00m\n\u001b[1;32m 2256\u001b[0m \n\u001b[1;32m 2257\u001b[0m \u001b[38;5;124;03m Returns a :class:`_engine.Result` object representing\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 2304\u001b[0m \n\u001b[1;32m 2305\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m-> 2306\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_execute_internal\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 2307\u001b[0m \u001b[43m \u001b[49m\u001b[43mstatement\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2308\u001b[0m \u001b[43m \u001b[49m\u001b[43mparams\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2309\u001b[0m \u001b[43m \u001b[49m\u001b[43mexecution_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mexecution_options\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2310\u001b[0m \u001b[43m \u001b[49m\u001b[43mbind_arguments\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mbind_arguments\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2311\u001b[0m \u001b[43m \u001b[49m\u001b[43m_parent_execute_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m_parent_execute_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2312\u001b[0m \u001b[43m \u001b[49m\u001b[43m_add_event\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m_add_event\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2313\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/session.py:2181\u001b[0m, in \u001b[0;36mSession._execute_internal\u001b[0;34m(self, statement, params, execution_options, bind_arguments, _parent_execute_state, _add_event, _scalar_result)\u001b[0m\n\u001b[1;32m 2167\u001b[0m (\n\u001b[1;32m 2168\u001b[0m statement,\n\u001b[1;32m 2169\u001b[0m execution_options,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 2176\u001b[0m \u001b[38;5;28;01mFalse\u001b[39;00m,\n\u001b[1;32m 2177\u001b[0m )\n\u001b[1;32m 2179\u001b[0m bind \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mget_bind(\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mbind_arguments)\n\u001b[0;32m-> 2181\u001b[0m conn \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_connection_for_bind\u001b[49m\u001b[43m(\u001b[49m\u001b[43mbind\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2183\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m _scalar_result \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m compile_state_cls:\n\u001b[1;32m 2184\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m TYPE_CHECKING:\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/session.py:2050\u001b[0m, in \u001b[0;36mSession._connection_for_bind\u001b[0;34m(self, engine, execution_options, **kw)\u001b[0m\n\u001b[1;32m 2048\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m trans \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 2049\u001b[0m trans \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_autobegin_t()\n\u001b[0;32m-> 2050\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mtrans\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_connection_for_bind\u001b[49m\u001b[43m(\u001b[49m\u001b[43mengine\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mexecution_options\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m:2\u001b[0m, in \u001b[0;36m_connection_for_bind\u001b[0;34m(self, bind, execution_options)\u001b[0m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/state_changes.py:103\u001b[0m, in \u001b[0;36m_StateChange.declare_states.._go\u001b[0;34m(fn, self, *arg, **kw)\u001b[0m\n\u001b[1;32m 97\u001b[0m current_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_state\n\u001b[1;32m 99\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m (\n\u001b[1;32m 100\u001b[0m has_prerequisite_states\n\u001b[1;32m 101\u001b[0m \u001b[38;5;129;01mand\u001b[39;00m current_state \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m prerequisite_state_collection\n\u001b[1;32m 102\u001b[0m ):\n\u001b[0;32m--> 103\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_raise_for_prerequisite_state\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfn\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[38;5;18;43m__name__\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcurrent_state\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 105\u001b[0m next_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_next_state\n\u001b[1;32m 106\u001b[0m existing_fn \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_current_fn\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/session.py:928\u001b[0m, in \u001b[0;36mSessionTransaction._raise_for_prerequisite_state\u001b[0;34m(self, operation_name, state)\u001b[0m\n\u001b[1;32m 926\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m state \u001b[38;5;129;01mis\u001b[39;00m SessionTransactionState\u001b[38;5;241m.\u001b[39mDEACTIVE:\n\u001b[1;32m 927\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_rollback_exception:\n\u001b[0;32m--> 928\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m sa_exc\u001b[38;5;241m.\u001b[39mPendingRollbackError(\n\u001b[1;32m 929\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mThis Session\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124ms transaction has been rolled back \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 930\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdue to a previous exception during flush.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 931\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m To begin a new transaction with this Session, \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 932\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfirst issue Session.rollback().\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 933\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m Original exception was: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_rollback_exception\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 934\u001b[0m code\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m7s2a\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 935\u001b[0m )\n\u001b[1;32m 936\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 937\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m sa_exc\u001b[38;5;241m.\u001b[39mInvalidRequestError(\n\u001b[1;32m 938\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mThis session is in \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124minactive\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m state, due to the \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 939\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mSQL transaction being rolled back; no further SQL \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 940\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcan be emitted within this transaction.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 941\u001b[0m )\n", + "\u001b[0;31mPendingRollbackError\u001b[0m: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (psycopg2.errors.NotNullViolation) null value in column \"fiberfac_gfa\" violates not-null constraint\nDETAIL: Failing row contains (20201222, 69455, 80610, 0, 0, 2020-12-23 12:02:33.591552+00, 59206.50177768, cmx, dark, elg, cmxelg, 900.004028320312, 1.34727168977261, 4000, dark, 0.9, 1.17609, 0.0214956291019917, 0, 0, 0.156659, 0.0387605, 0.103173, 0.166885976066826, 9.49855, 0, 0, 0, 1.25361, 1.34727, 1.3298, 1.909135184888, 0, 0, 0, 0.0691387515196852, 1.425028437377, 0.421895887401468, 0.319807524199896, 0.151348426191788, null, null, null, 1.18246672966859, 20.5068374559146, 21.6948676964909, 20.7336748369694, 19.1617744587365, null, null, null, null).\n\n[SQL: INSERT INTO daily.exposure (night, expid, tileid, tilera, tiledec, date_obs, mjd, survey, program, faprgrm, faflavor, exptime, efftime_spec, goaltime, goaltype, mintfrac, airmass, ebv, seeing_etc, efftime_etc, tsnr2_elg, tsnr2_qso, tsnr2_lrg, tsnr2_l ... 738229 characters truncated ... ime_gfa__627)s, %(efftime_dark_gfa__627)s, %(efftime_bright_gfa__627)s, %(efftime_backup_gfa__627)s)]\n[parameters: {'ebv__0': 0.05477216839790344, 'fiber_fracflux_gfa__0': 0.6093879572762915, 'efftime_spec__0': 716.840956115723, 'survey__0': 'cmx', 'fiberfac_bgs_gfa__0': 0.9697978701302379, 'fiberfac_gfa__0': 1.0061596313996244, 'date_obs__0': datetime.datetime(2020, 12, 17, 1, 35, 37, 77504, tzinfo=), 'sky_mag_g_spec__0': 21.82984125382668, 'goaltime__0': 1000.0, 'goaltype__0': 'unknown', 'seeing_gfa__0': 0.9498310820793945, 'tilera__0': 24.027, 'elg_efftime_dark__0': 716.840956115723, 'gpb_efftime_dark__0': 0.0, 'transparency_gfa__0': 0.9860573552204372, 'tiledec__0': 31.39, 'airmass_gfa__0': 1.0643660458221693, 'sky_mag_ab_gfa__0': 20.687300622263788, 'efftime_bright_gfa__0': 641.2192606190129, 'efftime_backup_gfa__0': 705.9319105165287, 'mintfrac__0': 0.9, 'tsnr2_bgs__0': 5526.3623046875, 'program__0': 'other', 'expid__0': 68265, 'lya_efftime_dark__0': 881.0479696260478, 'mjd__0': 59200.06640136, 'tsnr2_qso__0': 21.112829208374023, 'tsnr2_elg__0': 83.35359954833984, 'faflavor__0': 'cmxm33', 'sky_mag_r_spec__0': 21.05370965995666, 'sky_mag_z_spec__0': 19.200085082158704, 'tsnr2_lrg__0': 57.5751953125, 'tileid__0': 80615, 'tsnr2_lya__0': 77.01631164550781, 'efftime_dark_gfa__0': 648.1418017037299, 'faprgrm__0': 'm33', 'efftime_gfa__0': 648.1418017037299, 'tsnr2_gpbbright__0': 0.0, 'tsnr2_gpbbackup__0': 0.0, 'gpb_efftime_backup__0': 0.0, 'bgs_efftime_bright__0': 773.69072265625, 'night__0': 20201216, 'fiber_fracflux_bgs_gfa__0': 0.19807581524996704, 'airmass__0': 1.072093, 'exptime__0': 900.0020141601562, 'fiber_fracflux_elg_gfa__0': 0.4338655191836517, 'seeing_etc__0': 0.0, 'tsnr2_gpbdark__0': 0.0, 'gpb_efftime_bright__0': 0.0, 'lrg_efftime_dark__0': 699.573497680911 ... 32556 parameters truncated ... 'efftime_spec__627': 881.8314102172855, 'survey__627': 'sv1', 'fiberfac_bgs_gfa__627': 1.1219008645274058, 'fiberfac_gfa__627': 1.203024136532684, 'date_obs__627': datetime.datetime(2021, 1, 16, 8, 2, 31, 667136, tzinfo=), 'sky_mag_g_spec__627': 21.958881082495996, 'goaltime__627': 1000.0, 'goaltype__627': 'dark', 'seeing_gfa__627': 0.7716763904526707, 'tilera__627': 120.0, 'elg_efftime_dark__627': 881.8314102172855, 'gpb_efftime_dark__627': 0.0, 'transparency_gfa__627': 0.9688503867310785, 'tiledec__627': 34.0, 'airmass_gfa__627': 1.0052397520139693, 'sky_mag_ab_gfa__627': 22.31806687659762, 'efftime_bright_gfa__627': 762.1995935664742, 'efftime_backup_gfa__627': 847.4266225039098, 'mintfrac__627': 0.9, 'tsnr2_bgs__627': 6777.68994140625, 'program__627': 'dark', 'expid__627': 72511, 'lya_efftime_dark__627': 1024.032987862727, 'mjd__627': 59230.33508874, 'tsnr2_qso__627': 25.910263061523438, 'tsnr2_elg__627': 102.53853607177734, 'faflavor__627': 'sv1elgqso', 'sky_mag_r_spec__627': 21.33136785139145, 'sky_mag_z_spec__627': 19.726246214442227, 'tsnr2_lrg__627': 70.26490783691406, 'tileid__627': 80685, 'tsnr2_lya__627': 89.51526641845703, 'efftime_dark_gfa__627': 825.1358589806441, 'faprgrm__627': 'elgqso', 'efftime_gfa__627': 825.1358589806441, 'tsnr2_gpbbright__627': 0.0, 'tsnr2_gpbbackup__627': 0.0, 'gpb_efftime_backup__627': 0.0, 'bgs_efftime_bright__627': 948.8765917968751, 'night__627': 20210115, 'fiber_fracflux_bgs_gfa__627': 0.23162289328675623, 'airmass__627': 1.003325, 'exptime__627': 737.294189453125, 'fiber_fracflux_elg_gfa__627': 0.5170860967073544, 'seeing_etc__627': 0.0, 'tsnr2_gpbdark__627': 0.0, 'gpb_efftime_bright__627': 0.0, 'lrg_efftime_dark__627': 853.7611913063681, 'efftime_etc__627': 0.0, 'fiberfac_elg_gfa__627': 1.1538710145713105}]\n(Background on this error at: https://sqlalche.me/e/20/gkpj) (Background on this error at: https://sqlalche.me/e/20/7s2a)" + ] + } + ], "source": [ - "load_ztile = t.load_redshift(load_tiles[0])" + "%%time\n", + "load_ztile = t.load_redshift(load_tiles[tile_index])" ] }, { @@ -718,12 +809,39 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 22, "id": "f9230013-8106-43be-8439-ab11953bdb75", "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "PendingRollbackError", + "evalue": "This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (psycopg2.errors.NotNullViolation) null value in column \"fiberfac_gfa\" violates not-null constraint\nDETAIL: Failing row contains (20201222, 69455, 80610, 0, 0, 2020-12-23 12:02:33.591552+00, 59206.50177768, cmx, dark, elg, cmxelg, 900.004028320312, 1.34727168977261, 4000, dark, 0.9, 1.17609, 0.0214956291019917, 0, 0, 0.156659, 0.0387605, 0.103173, 0.166885976066826, 9.49855, 0, 0, 0, 1.25361, 1.34727, 1.3298, 1.909135184888, 0, 0, 0, 0.0691387515196852, 1.425028437377, 0.421895887401468, 0.319807524199896, 0.151348426191788, null, null, null, 1.18246672966859, 20.5068374559146, 21.6948676964909, 20.7336748369694, 19.1617744587365, null, null, null, null).\n\n[SQL: INSERT INTO daily.exposure (night, expid, tileid, tilera, tiledec, date_obs, mjd, survey, program, faprgrm, faflavor, exptime, efftime_spec, goaltime, goaltype, mintfrac, airmass, ebv, seeing_etc, efftime_etc, tsnr2_elg, tsnr2_qso, tsnr2_lrg, tsnr2_l ... 738229 characters truncated ... ime_gfa__627)s, %(efftime_dark_gfa__627)s, %(efftime_bright_gfa__627)s, %(efftime_backup_gfa__627)s)]\n[parameters: {'ebv__0': 0.05477216839790344, 'fiber_fracflux_gfa__0': 0.6093879572762915, 'efftime_spec__0': 716.840956115723, 'survey__0': 'cmx', 'fiberfac_bgs_gfa__0': 0.9697978701302379, 'fiberfac_gfa__0': 1.0061596313996244, 'date_obs__0': datetime.datetime(2020, 12, 17, 1, 35, 37, 77504, tzinfo=), 'sky_mag_g_spec__0': 21.82984125382668, 'goaltime__0': 1000.0, 'goaltype__0': 'unknown', 'seeing_gfa__0': 0.9498310820793945, 'tilera__0': 24.027, 'elg_efftime_dark__0': 716.840956115723, 'gpb_efftime_dark__0': 0.0, 'transparency_gfa__0': 0.9860573552204372, 'tiledec__0': 31.39, 'airmass_gfa__0': 1.0643660458221693, 'sky_mag_ab_gfa__0': 20.687300622263788, 'efftime_bright_gfa__0': 641.2192606190129, 'efftime_backup_gfa__0': 705.9319105165287, 'mintfrac__0': 0.9, 'tsnr2_bgs__0': 5526.3623046875, 'program__0': 'other', 'expid__0': 68265, 'lya_efftime_dark__0': 881.0479696260478, 'mjd__0': 59200.06640136, 'tsnr2_qso__0': 21.112829208374023, 'tsnr2_elg__0': 83.35359954833984, 'faflavor__0': 'cmxm33', 'sky_mag_r_spec__0': 21.05370965995666, 'sky_mag_z_spec__0': 19.200085082158704, 'tsnr2_lrg__0': 57.5751953125, 'tileid__0': 80615, 'tsnr2_lya__0': 77.01631164550781, 'efftime_dark_gfa__0': 648.1418017037299, 'faprgrm__0': 'm33', 'efftime_gfa__0': 648.1418017037299, 'tsnr2_gpbbright__0': 0.0, 'tsnr2_gpbbackup__0': 0.0, 'gpb_efftime_backup__0': 0.0, 'bgs_efftime_bright__0': 773.69072265625, 'night__0': 20201216, 'fiber_fracflux_bgs_gfa__0': 0.19807581524996704, 'airmass__0': 1.072093, 'exptime__0': 900.0020141601562, 'fiber_fracflux_elg_gfa__0': 0.4338655191836517, 'seeing_etc__0': 0.0, 'tsnr2_gpbdark__0': 0.0, 'gpb_efftime_bright__0': 0.0, 'lrg_efftime_dark__0': 699.573497680911 ... 32556 parameters truncated ... 'efftime_spec__627': 881.8314102172855, 'survey__627': 'sv1', 'fiberfac_bgs_gfa__627': 1.1219008645274058, 'fiberfac_gfa__627': 1.203024136532684, 'date_obs__627': datetime.datetime(2021, 1, 16, 8, 2, 31, 667136, tzinfo=), 'sky_mag_g_spec__627': 21.958881082495996, 'goaltime__627': 1000.0, 'goaltype__627': 'dark', 'seeing_gfa__627': 0.7716763904526707, 'tilera__627': 120.0, 'elg_efftime_dark__627': 881.8314102172855, 'gpb_efftime_dark__627': 0.0, 'transparency_gfa__627': 0.9688503867310785, 'tiledec__627': 34.0, 'airmass_gfa__627': 1.0052397520139693, 'sky_mag_ab_gfa__627': 22.31806687659762, 'efftime_bright_gfa__627': 762.1995935664742, 'efftime_backup_gfa__627': 847.4266225039098, 'mintfrac__627': 0.9, 'tsnr2_bgs__627': 6777.68994140625, 'program__627': 'dark', 'expid__627': 72511, 'lya_efftime_dark__627': 1024.032987862727, 'mjd__627': 59230.33508874, 'tsnr2_qso__627': 25.910263061523438, 'tsnr2_elg__627': 102.53853607177734, 'faflavor__627': 'sv1elgqso', 'sky_mag_r_spec__627': 21.33136785139145, 'sky_mag_z_spec__627': 19.726246214442227, 'tsnr2_lrg__627': 70.26490783691406, 'tileid__627': 80685, 'tsnr2_lya__627': 89.51526641845703, 'efftime_dark_gfa__627': 825.1358589806441, 'faprgrm__627': 'elgqso', 'efftime_gfa__627': 825.1358589806441, 'tsnr2_gpbbright__627': 0.0, 'tsnr2_gpbbackup__627': 0.0, 'gpb_efftime_backup__627': 0.0, 'bgs_efftime_bright__627': 948.8765917968751, 'night__627': 20210115, 'fiber_fracflux_bgs_gfa__627': 0.23162289328675623, 'airmass__627': 1.003325, 'exptime__627': 737.294189453125, 'fiber_fracflux_elg_gfa__627': 0.5170860967073544, 'seeing_etc__627': 0.0, 'tsnr2_gpbdark__627': 0.0, 'gpb_efftime_bright__627': 0.0, 'lrg_efftime_dark__627': 853.7611913063681, 'efftime_etc__627': 0.0, 'fiberfac_elg_gfa__627': 1.1538710145713105}]\n(Background on this error at: https://sqlalche.me/e/20/gkpj) (Background on this error at: https://sqlalche.me/e/20/7s2a)", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mPendingRollbackError\u001b[0m Traceback (most recent call last)", + "File \u001b[0;32m:1\u001b[0m\n", + "File \u001b[0;32m/global/common/software/desi/users/bweaver/perlmutter/desiconda/current/code/specprod-db/my-main/py/specprodDB/tile.py:336\u001b[0m, in \u001b[0;36mload_fiberassign\u001b[0;34m(tile)\u001b[0m\n\u001b[1;32m 322\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mload_fiberassign\u001b[39m(tile):\n\u001b[1;32m 323\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"Load the fiber assignments and potential assignments for `tile`.\u001b[39;00m\n\u001b[1;32m 324\u001b[0m \n\u001b[1;32m 325\u001b[0m \u001b[38;5;124;03m Parameters\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 334\u001b[0m \u001b[38;5;124;03m and :class:`~specprodDB.load.Potential` objects loaded.\u001b[39;00m\n\u001b[1;32m 335\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m--> 336\u001b[0m fiberassign_table \u001b[38;5;241m=\u001b[39m Table\u001b[38;5;241m.\u001b[39mread(fiberassign_file(\u001b[43mtile\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtileid\u001b[49m), \u001b[38;5;28mformat\u001b[39m\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mfits\u001b[39m\u001b[38;5;124m'\u001b[39m, hdu\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mFIBERASSIGN\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 337\u001b[0m potential_table \u001b[38;5;241m=\u001b[39m Table\u001b[38;5;241m.\u001b[39mread(fiberassign_file(tile\u001b[38;5;241m.\u001b[39mtileid), \u001b[38;5;28mformat\u001b[39m\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mfits\u001b[39m\u001b[38;5;124m'\u001b[39m, hdu\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mPOTENTIAL_ASSIGNMENTS\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 338\u001b[0m row_index \u001b[38;5;241m=\u001b[39m no_sky(fiberassign_table)\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/attributes.py:566\u001b[0m, in \u001b[0;36mInstrumentedAttribute.__get__\u001b[0;34m(self, instance, owner)\u001b[0m\n\u001b[1;32m 564\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mAttributeError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[1;32m 565\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m orm_exc\u001b[38;5;241m.\u001b[39mUnmappedInstanceError(instance) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01merr\u001b[39;00m\n\u001b[0;32m--> 566\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mimpl\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mget\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdict_\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/attributes.py:1086\u001b[0m, in \u001b[0;36mAttributeImpl.get\u001b[0;34m(self, state, dict_, passive)\u001b[0m\n\u001b[1;32m 1083\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m passive \u001b[38;5;241m&\u001b[39m CALLABLES_OK:\n\u001b[1;32m 1084\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m PASSIVE_NO_RESULT\n\u001b[0;32m-> 1086\u001b[0m value \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_fire_loader_callables\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mkey\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mpassive\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1088\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m value \u001b[38;5;129;01mis\u001b[39;00m PASSIVE_NO_RESULT \u001b[38;5;129;01mor\u001b[39;00m value \u001b[38;5;129;01mis\u001b[39;00m NO_VALUE:\n\u001b[1;32m 1089\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m value\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/attributes.py:1116\u001b[0m, in \u001b[0;36mAttributeImpl._fire_loader_callables\u001b[0;34m(self, state, key, passive)\u001b[0m\n\u001b[1;32m 1108\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_fire_loader_callables\u001b[39m(\n\u001b[1;32m 1109\u001b[0m \u001b[38;5;28mself\u001b[39m, state: InstanceState[Any], key: \u001b[38;5;28mstr\u001b[39m, passive: PassiveFlag\n\u001b[1;32m 1110\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Any:\n\u001b[1;32m 1111\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m (\n\u001b[1;32m 1112\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39maccepts_scalar_loader\n\u001b[1;32m 1113\u001b[0m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mload_on_unexpire\n\u001b[1;32m 1114\u001b[0m \u001b[38;5;129;01mand\u001b[39;00m key \u001b[38;5;129;01min\u001b[39;00m state\u001b[38;5;241m.\u001b[39mexpired_attributes\n\u001b[1;32m 1115\u001b[0m ):\n\u001b[0;32m-> 1116\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mstate\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_load_expired\u001b[49m\u001b[43m(\u001b[49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mpassive\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1117\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m key \u001b[38;5;129;01min\u001b[39;00m state\u001b[38;5;241m.\u001b[39mcallables:\n\u001b[1;32m 1118\u001b[0m callable_ \u001b[38;5;241m=\u001b[39m state\u001b[38;5;241m.\u001b[39mcallables[key]\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/state.py:796\u001b[0m, in \u001b[0;36mInstanceState._load_expired\u001b[0;34m(self, state, passive)\u001b[0m\n\u001b[1;32m 789\u001b[0m toload \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mexpired_attributes\u001b[38;5;241m.\u001b[39mintersection(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39munmodified)\n\u001b[1;32m 790\u001b[0m toload \u001b[38;5;241m=\u001b[39m toload\u001b[38;5;241m.\u001b[39mdifference(\n\u001b[1;32m 791\u001b[0m attr\n\u001b[1;32m 792\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m attr \u001b[38;5;129;01min\u001b[39;00m toload\n\u001b[1;32m 793\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mmanager[attr]\u001b[38;5;241m.\u001b[39mimpl\u001b[38;5;241m.\u001b[39mload_on_unexpire\n\u001b[1;32m 794\u001b[0m )\n\u001b[0;32m--> 796\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mmanager\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mexpired_attribute_loader\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mtoload\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mpassive\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 798\u001b[0m \u001b[38;5;66;03m# if the loader failed, or this\u001b[39;00m\n\u001b[1;32m 799\u001b[0m \u001b[38;5;66;03m# instance state didn't have an identity,\u001b[39;00m\n\u001b[1;32m 800\u001b[0m \u001b[38;5;66;03m# the attributes still might be in the callables\u001b[39;00m\n\u001b[1;32m 801\u001b[0m \u001b[38;5;66;03m# dict. ensure they are removed.\u001b[39;00m\n\u001b[1;32m 802\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mexpired_attributes\u001b[38;5;241m.\u001b[39mclear()\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/loading.py:1653\u001b[0m, in \u001b[0;36mload_scalar_attributes\u001b[0;34m(mapper, state, attribute_names, passive)\u001b[0m\n\u001b[1;32m 1645\u001b[0m util\u001b[38;5;241m.\u001b[39mwarn_limited(\n\u001b[1;32m 1646\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mInstance \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m to be refreshed doesn\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mt \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 1647\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcontain a full primary key - can\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mt be refreshed \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 1648\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m(and shouldn\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mt be expired, either).\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 1649\u001b[0m state_str(state),\n\u001b[1;32m 1650\u001b[0m )\n\u001b[1;32m 1651\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m\n\u001b[0;32m-> 1653\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[43mload_on_ident\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1654\u001b[0m \u001b[43m \u001b[49m\u001b[43msession\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1655\u001b[0m \u001b[43m \u001b[49m\u001b[43mselect\u001b[49m\u001b[43m(\u001b[49m\u001b[43mmapper\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mset_label_style\u001b[49m\u001b[43m(\u001b[49m\u001b[43mLABEL_STYLE_TABLENAME_PLUS_COL\u001b[49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1656\u001b[0m \u001b[43m \u001b[49m\u001b[43midentity_key\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1657\u001b[0m \u001b[43m \u001b[49m\u001b[43mrefresh_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mstate\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1658\u001b[0m \u001b[43m \u001b[49m\u001b[43monly_load_props\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mattribute_names\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1659\u001b[0m \u001b[43m \u001b[49m\u001b[43mno_autoflush\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mno_autoflush\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1660\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1662\u001b[0m \u001b[38;5;66;03m# if instance is pending, a refresh operation\u001b[39;00m\n\u001b[1;32m 1663\u001b[0m \u001b[38;5;66;03m# may not complete (even if PK attributes are assigned)\u001b[39;00m\n\u001b[1;32m 1664\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m has_key \u001b[38;5;129;01mand\u001b[39;00m result \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/loading.py:509\u001b[0m, in \u001b[0;36mload_on_ident\u001b[0;34m(session, statement, key, load_options, refresh_state, with_for_update, only_load_props, no_autoflush, bind_arguments, execution_options, require_pk_cols, is_user_refresh)\u001b[0m\n\u001b[1;32m 506\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 507\u001b[0m ident \u001b[38;5;241m=\u001b[39m identity_token \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m--> 509\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mload_on_pk_identity\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 510\u001b[0m \u001b[43m \u001b[49m\u001b[43msession\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 511\u001b[0m \u001b[43m \u001b[49m\u001b[43mstatement\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 512\u001b[0m \u001b[43m \u001b[49m\u001b[43mident\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 513\u001b[0m \u001b[43m \u001b[49m\u001b[43mload_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mload_options\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 514\u001b[0m \u001b[43m \u001b[49m\u001b[43mrefresh_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrefresh_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 515\u001b[0m \u001b[43m \u001b[49m\u001b[43mwith_for_update\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mwith_for_update\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 516\u001b[0m \u001b[43m \u001b[49m\u001b[43monly_load_props\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43monly_load_props\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 517\u001b[0m \u001b[43m \u001b[49m\u001b[43midentity_token\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43midentity_token\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 518\u001b[0m \u001b[43m \u001b[49m\u001b[43mno_autoflush\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mno_autoflush\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 519\u001b[0m \u001b[43m \u001b[49m\u001b[43mbind_arguments\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mbind_arguments\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 520\u001b[0m \u001b[43m \u001b[49m\u001b[43mexecution_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mexecution_options\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 521\u001b[0m \u001b[43m \u001b[49m\u001b[43mrequire_pk_cols\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mrequire_pk_cols\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 522\u001b[0m \u001b[43m \u001b[49m\u001b[43mis_user_refresh\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mis_user_refresh\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 523\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/loading.py:694\u001b[0m, in \u001b[0;36mload_on_pk_identity\u001b[0;34m(session, statement, primary_key_identity, load_options, refresh_state, with_for_update, only_load_props, identity_token, no_autoflush, bind_arguments, execution_options, require_pk_cols, is_user_refresh)\u001b[0m\n\u001b[1;32m 688\u001b[0m load_options \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m {\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m_autoflush\u001b[39m\u001b[38;5;124m\"\u001b[39m: \u001b[38;5;28;01mFalse\u001b[39;00m}\n\u001b[1;32m 690\u001b[0m execution_options \u001b[38;5;241m=\u001b[39m util\u001b[38;5;241m.\u001b[39mEMPTY_DICT\u001b[38;5;241m.\u001b[39mmerge_with(\n\u001b[1;32m 691\u001b[0m execution_options, {\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m_sa_orm_load_options\u001b[39m\u001b[38;5;124m\"\u001b[39m: load_options}\n\u001b[1;32m 692\u001b[0m )\n\u001b[1;32m 693\u001b[0m result \u001b[38;5;241m=\u001b[39m (\n\u001b[0;32m--> 694\u001b[0m \u001b[43msession\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mexecute\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 695\u001b[0m \u001b[43m \u001b[49m\u001b[43mq\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 696\u001b[0m \u001b[43m \u001b[49m\u001b[43mparams\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mparams\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 697\u001b[0m \u001b[43m \u001b[49m\u001b[43mexecution_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mexecution_options\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 698\u001b[0m \u001b[43m \u001b[49m\u001b[43mbind_arguments\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mbind_arguments\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 699\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 700\u001b[0m \u001b[38;5;241m.\u001b[39munique()\n\u001b[1;32m 701\u001b[0m \u001b[38;5;241m.\u001b[39mscalars()\n\u001b[1;32m 702\u001b[0m )\n\u001b[1;32m 704\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m 705\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m result\u001b[38;5;241m.\u001b[39mone()\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/session.py:2306\u001b[0m, in \u001b[0;36mSession.execute\u001b[0;34m(self, statement, params, execution_options, bind_arguments, _parent_execute_state, _add_event)\u001b[0m\n\u001b[1;32m 2245\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mexecute\u001b[39m(\n\u001b[1;32m 2246\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[1;32m 2247\u001b[0m statement: Executable,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 2253\u001b[0m _add_event: Optional[Any] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[1;32m 2254\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Result[Any]:\n\u001b[1;32m 2255\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124mr\u001b[39m\u001b[38;5;124;03m\"\"\"Execute a SQL expression construct.\u001b[39;00m\n\u001b[1;32m 2256\u001b[0m \n\u001b[1;32m 2257\u001b[0m \u001b[38;5;124;03m Returns a :class:`_engine.Result` object representing\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 2304\u001b[0m \n\u001b[1;32m 2305\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m-> 2306\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_execute_internal\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 2307\u001b[0m \u001b[43m \u001b[49m\u001b[43mstatement\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2308\u001b[0m \u001b[43m \u001b[49m\u001b[43mparams\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2309\u001b[0m \u001b[43m \u001b[49m\u001b[43mexecution_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mexecution_options\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2310\u001b[0m \u001b[43m \u001b[49m\u001b[43mbind_arguments\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mbind_arguments\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2311\u001b[0m \u001b[43m \u001b[49m\u001b[43m_parent_execute_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m_parent_execute_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2312\u001b[0m \u001b[43m \u001b[49m\u001b[43m_add_event\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m_add_event\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2313\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/session.py:2181\u001b[0m, in \u001b[0;36mSession._execute_internal\u001b[0;34m(self, statement, params, execution_options, bind_arguments, _parent_execute_state, _add_event, _scalar_result)\u001b[0m\n\u001b[1;32m 2167\u001b[0m (\n\u001b[1;32m 2168\u001b[0m statement,\n\u001b[1;32m 2169\u001b[0m execution_options,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 2176\u001b[0m \u001b[38;5;28;01mFalse\u001b[39;00m,\n\u001b[1;32m 2177\u001b[0m )\n\u001b[1;32m 2179\u001b[0m bind \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mget_bind(\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mbind_arguments)\n\u001b[0;32m-> 2181\u001b[0m conn \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_connection_for_bind\u001b[49m\u001b[43m(\u001b[49m\u001b[43mbind\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2183\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m _scalar_result \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m compile_state_cls:\n\u001b[1;32m 2184\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m TYPE_CHECKING:\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/session.py:2050\u001b[0m, in \u001b[0;36mSession._connection_for_bind\u001b[0;34m(self, engine, execution_options, **kw)\u001b[0m\n\u001b[1;32m 2048\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m trans \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 2049\u001b[0m trans \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_autobegin_t()\n\u001b[0;32m-> 2050\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mtrans\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_connection_for_bind\u001b[49m\u001b[43m(\u001b[49m\u001b[43mengine\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mexecution_options\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m:2\u001b[0m, in \u001b[0;36m_connection_for_bind\u001b[0;34m(self, bind, execution_options)\u001b[0m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/state_changes.py:103\u001b[0m, in \u001b[0;36m_StateChange.declare_states.._go\u001b[0;34m(fn, self, *arg, **kw)\u001b[0m\n\u001b[1;32m 97\u001b[0m current_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_state\n\u001b[1;32m 99\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m (\n\u001b[1;32m 100\u001b[0m has_prerequisite_states\n\u001b[1;32m 101\u001b[0m \u001b[38;5;129;01mand\u001b[39;00m current_state \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m prerequisite_state_collection\n\u001b[1;32m 102\u001b[0m ):\n\u001b[0;32m--> 103\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_raise_for_prerequisite_state\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfn\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[38;5;18;43m__name__\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcurrent_state\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 105\u001b[0m next_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_next_state\n\u001b[1;32m 106\u001b[0m existing_fn \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_current_fn\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/session.py:928\u001b[0m, in \u001b[0;36mSessionTransaction._raise_for_prerequisite_state\u001b[0;34m(self, operation_name, state)\u001b[0m\n\u001b[1;32m 926\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m state \u001b[38;5;129;01mis\u001b[39;00m SessionTransactionState\u001b[38;5;241m.\u001b[39mDEACTIVE:\n\u001b[1;32m 927\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_rollback_exception:\n\u001b[0;32m--> 928\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m sa_exc\u001b[38;5;241m.\u001b[39mPendingRollbackError(\n\u001b[1;32m 929\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mThis Session\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124ms transaction has been rolled back \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 930\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdue to a previous exception during flush.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 931\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m To begin a new transaction with this Session, \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 932\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfirst issue Session.rollback().\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 933\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m Original exception was: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_rollback_exception\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 934\u001b[0m code\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m7s2a\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 935\u001b[0m )\n\u001b[1;32m 936\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 937\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m sa_exc\u001b[38;5;241m.\u001b[39mInvalidRequestError(\n\u001b[1;32m 938\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mThis session is in \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124minactive\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m state, due to the \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 939\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mSQL transaction being rolled back; no further SQL \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 940\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcan be emitted within this transaction.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 941\u001b[0m )\n", + "\u001b[0;31mPendingRollbackError\u001b[0m: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (psycopg2.errors.NotNullViolation) null value in column \"fiberfac_gfa\" violates not-null constraint\nDETAIL: Failing row contains (20201222, 69455, 80610, 0, 0, 2020-12-23 12:02:33.591552+00, 59206.50177768, cmx, dark, elg, cmxelg, 900.004028320312, 1.34727168977261, 4000, dark, 0.9, 1.17609, 0.0214956291019917, 0, 0, 0.156659, 0.0387605, 0.103173, 0.166885976066826, 9.49855, 0, 0, 0, 1.25361, 1.34727, 1.3298, 1.909135184888, 0, 0, 0, 0.0691387515196852, 1.425028437377, 0.421895887401468, 0.319807524199896, 0.151348426191788, null, null, null, 1.18246672966859, 20.5068374559146, 21.6948676964909, 20.7336748369694, 19.1617744587365, null, null, null, null).\n\n[SQL: INSERT INTO daily.exposure (night, expid, tileid, tilera, tiledec, date_obs, mjd, survey, program, faprgrm, faflavor, exptime, efftime_spec, goaltime, goaltype, mintfrac, airmass, ebv, seeing_etc, efftime_etc, tsnr2_elg, tsnr2_qso, tsnr2_lrg, tsnr2_l ... 738229 characters truncated ... ime_gfa__627)s, %(efftime_dark_gfa__627)s, %(efftime_bright_gfa__627)s, %(efftime_backup_gfa__627)s)]\n[parameters: {'ebv__0': 0.05477216839790344, 'fiber_fracflux_gfa__0': 0.6093879572762915, 'efftime_spec__0': 716.840956115723, 'survey__0': 'cmx', 'fiberfac_bgs_gfa__0': 0.9697978701302379, 'fiberfac_gfa__0': 1.0061596313996244, 'date_obs__0': datetime.datetime(2020, 12, 17, 1, 35, 37, 77504, tzinfo=), 'sky_mag_g_spec__0': 21.82984125382668, 'goaltime__0': 1000.0, 'goaltype__0': 'unknown', 'seeing_gfa__0': 0.9498310820793945, 'tilera__0': 24.027, 'elg_efftime_dark__0': 716.840956115723, 'gpb_efftime_dark__0': 0.0, 'transparency_gfa__0': 0.9860573552204372, 'tiledec__0': 31.39, 'airmass_gfa__0': 1.0643660458221693, 'sky_mag_ab_gfa__0': 20.687300622263788, 'efftime_bright_gfa__0': 641.2192606190129, 'efftime_backup_gfa__0': 705.9319105165287, 'mintfrac__0': 0.9, 'tsnr2_bgs__0': 5526.3623046875, 'program__0': 'other', 'expid__0': 68265, 'lya_efftime_dark__0': 881.0479696260478, 'mjd__0': 59200.06640136, 'tsnr2_qso__0': 21.112829208374023, 'tsnr2_elg__0': 83.35359954833984, 'faflavor__0': 'cmxm33', 'sky_mag_r_spec__0': 21.05370965995666, 'sky_mag_z_spec__0': 19.200085082158704, 'tsnr2_lrg__0': 57.5751953125, 'tileid__0': 80615, 'tsnr2_lya__0': 77.01631164550781, 'efftime_dark_gfa__0': 648.1418017037299, 'faprgrm__0': 'm33', 'efftime_gfa__0': 648.1418017037299, 'tsnr2_gpbbright__0': 0.0, 'tsnr2_gpbbackup__0': 0.0, 'gpb_efftime_backup__0': 0.0, 'bgs_efftime_bright__0': 773.69072265625, 'night__0': 20201216, 'fiber_fracflux_bgs_gfa__0': 0.19807581524996704, 'airmass__0': 1.072093, 'exptime__0': 900.0020141601562, 'fiber_fracflux_elg_gfa__0': 0.4338655191836517, 'seeing_etc__0': 0.0, 'tsnr2_gpbdark__0': 0.0, 'gpb_efftime_bright__0': 0.0, 'lrg_efftime_dark__0': 699.573497680911 ... 32556 parameters truncated ... 'efftime_spec__627': 881.8314102172855, 'survey__627': 'sv1', 'fiberfac_bgs_gfa__627': 1.1219008645274058, 'fiberfac_gfa__627': 1.203024136532684, 'date_obs__627': datetime.datetime(2021, 1, 16, 8, 2, 31, 667136, tzinfo=), 'sky_mag_g_spec__627': 21.958881082495996, 'goaltime__627': 1000.0, 'goaltype__627': 'dark', 'seeing_gfa__627': 0.7716763904526707, 'tilera__627': 120.0, 'elg_efftime_dark__627': 881.8314102172855, 'gpb_efftime_dark__627': 0.0, 'transparency_gfa__627': 0.9688503867310785, 'tiledec__627': 34.0, 'airmass_gfa__627': 1.0052397520139693, 'sky_mag_ab_gfa__627': 22.31806687659762, 'efftime_bright_gfa__627': 762.1995935664742, 'efftime_backup_gfa__627': 847.4266225039098, 'mintfrac__627': 0.9, 'tsnr2_bgs__627': 6777.68994140625, 'program__627': 'dark', 'expid__627': 72511, 'lya_efftime_dark__627': 1024.032987862727, 'mjd__627': 59230.33508874, 'tsnr2_qso__627': 25.910263061523438, 'tsnr2_elg__627': 102.53853607177734, 'faflavor__627': 'sv1elgqso', 'sky_mag_r_spec__627': 21.33136785139145, 'sky_mag_z_spec__627': 19.726246214442227, 'tsnr2_lrg__627': 70.26490783691406, 'tileid__627': 80685, 'tsnr2_lya__627': 89.51526641845703, 'efftime_dark_gfa__627': 825.1358589806441, 'faprgrm__627': 'elgqso', 'efftime_gfa__627': 825.1358589806441, 'tsnr2_gpbbright__627': 0.0, 'tsnr2_gpbbackup__627': 0.0, 'gpb_efftime_backup__627': 0.0, 'bgs_efftime_bright__627': 948.8765917968751, 'night__627': 20210115, 'fiber_fracflux_bgs_gfa__627': 0.23162289328675623, 'airmass__627': 1.003325, 'exptime__627': 737.294189453125, 'fiber_fracflux_elg_gfa__627': 0.5170860967073544, 'seeing_etc__627': 0.0, 'tsnr2_gpbdark__627': 0.0, 'gpb_efftime_bright__627': 0.0, 'lrg_efftime_dark__627': 853.7611913063681, 'efftime_etc__627': 0.0, 'fiberfac_elg_gfa__627': 1.1538710145713105}]\n(Background on this error at: https://sqlalche.me/e/20/gkpj) (Background on this error at: https://sqlalche.me/e/20/7s2a)" + ] + } + ], "source": [ - "load_fiberassign, load_potential = t.load_fiberassign(load_tiles[0])" + "%%time\n", + "load_fiberassign, load_potential = t.load_fiberassign(load_tiles[tile_index])" ] }, { @@ -738,10 +856,31 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 23, "id": "8c129caa-b3d7-4b61-8848-2c6ac5c85460", "metadata": {}, - "outputs": [], + "outputs": [ + { + "ename": "PendingRollbackError", + "evalue": "This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (psycopg2.errors.NotNullViolation) null value in column \"fiberfac_gfa\" violates not-null constraint\nDETAIL: Failing row contains (20201222, 69455, 80610, 0, 0, 2020-12-23 12:02:33.591552+00, 59206.50177768, cmx, dark, elg, cmxelg, 900.004028320312, 1.34727168977261, 4000, dark, 0.9, 1.17609, 0.0214956291019917, 0, 0, 0.156659, 0.0387605, 0.103173, 0.166885976066826, 9.49855, 0, 0, 0, 1.25361, 1.34727, 1.3298, 1.909135184888, 0, 0, 0, 0.0691387515196852, 1.425028437377, 0.421895887401468, 0.319807524199896, 0.151348426191788, null, null, null, 1.18246672966859, 20.5068374559146, 21.6948676964909, 20.7336748369694, 19.1617744587365, null, null, null, null).\n\n[SQL: INSERT INTO daily.exposure (night, expid, tileid, tilera, tiledec, date_obs, mjd, survey, program, faprgrm, faflavor, exptime, efftime_spec, goaltime, goaltype, mintfrac, airmass, ebv, seeing_etc, efftime_etc, tsnr2_elg, tsnr2_qso, tsnr2_lrg, tsnr2_l ... 738229 characters truncated ... ime_gfa__627)s, %(efftime_dark_gfa__627)s, %(efftime_bright_gfa__627)s, %(efftime_backup_gfa__627)s)]\n[parameters: {'ebv__0': 0.05477216839790344, 'fiber_fracflux_gfa__0': 0.6093879572762915, 'efftime_spec__0': 716.840956115723, 'survey__0': 'cmx', 'fiberfac_bgs_gfa__0': 0.9697978701302379, 'fiberfac_gfa__0': 1.0061596313996244, 'date_obs__0': datetime.datetime(2020, 12, 17, 1, 35, 37, 77504, tzinfo=), 'sky_mag_g_spec__0': 21.82984125382668, 'goaltime__0': 1000.0, 'goaltype__0': 'unknown', 'seeing_gfa__0': 0.9498310820793945, 'tilera__0': 24.027, 'elg_efftime_dark__0': 716.840956115723, 'gpb_efftime_dark__0': 0.0, 'transparency_gfa__0': 0.9860573552204372, 'tiledec__0': 31.39, 'airmass_gfa__0': 1.0643660458221693, 'sky_mag_ab_gfa__0': 20.687300622263788, 'efftime_bright_gfa__0': 641.2192606190129, 'efftime_backup_gfa__0': 705.9319105165287, 'mintfrac__0': 0.9, 'tsnr2_bgs__0': 5526.3623046875, 'program__0': 'other', 'expid__0': 68265, 'lya_efftime_dark__0': 881.0479696260478, 'mjd__0': 59200.06640136, 'tsnr2_qso__0': 21.112829208374023, 'tsnr2_elg__0': 83.35359954833984, 'faflavor__0': 'cmxm33', 'sky_mag_r_spec__0': 21.05370965995666, 'sky_mag_z_spec__0': 19.200085082158704, 'tsnr2_lrg__0': 57.5751953125, 'tileid__0': 80615, 'tsnr2_lya__0': 77.01631164550781, 'efftime_dark_gfa__0': 648.1418017037299, 'faprgrm__0': 'm33', 'efftime_gfa__0': 648.1418017037299, 'tsnr2_gpbbright__0': 0.0, 'tsnr2_gpbbackup__0': 0.0, 'gpb_efftime_backup__0': 0.0, 'bgs_efftime_bright__0': 773.69072265625, 'night__0': 20201216, 'fiber_fracflux_bgs_gfa__0': 0.19807581524996704, 'airmass__0': 1.072093, 'exptime__0': 900.0020141601562, 'fiber_fracflux_elg_gfa__0': 0.4338655191836517, 'seeing_etc__0': 0.0, 'tsnr2_gpbdark__0': 0.0, 'gpb_efftime_bright__0': 0.0, 'lrg_efftime_dark__0': 699.573497680911 ... 32556 parameters truncated ... 'efftime_spec__627': 881.8314102172855, 'survey__627': 'sv1', 'fiberfac_bgs_gfa__627': 1.1219008645274058, 'fiberfac_gfa__627': 1.203024136532684, 'date_obs__627': datetime.datetime(2021, 1, 16, 8, 2, 31, 667136, tzinfo=), 'sky_mag_g_spec__627': 21.958881082495996, 'goaltime__627': 1000.0, 'goaltype__627': 'dark', 'seeing_gfa__627': 0.7716763904526707, 'tilera__627': 120.0, 'elg_efftime_dark__627': 881.8314102172855, 'gpb_efftime_dark__627': 0.0, 'transparency_gfa__627': 0.9688503867310785, 'tiledec__627': 34.0, 'airmass_gfa__627': 1.0052397520139693, 'sky_mag_ab_gfa__627': 22.31806687659762, 'efftime_bright_gfa__627': 762.1995935664742, 'efftime_backup_gfa__627': 847.4266225039098, 'mintfrac__627': 0.9, 'tsnr2_bgs__627': 6777.68994140625, 'program__627': 'dark', 'expid__627': 72511, 'lya_efftime_dark__627': 1024.032987862727, 'mjd__627': 59230.33508874, 'tsnr2_qso__627': 25.910263061523438, 'tsnr2_elg__627': 102.53853607177734, 'faflavor__627': 'sv1elgqso', 'sky_mag_r_spec__627': 21.33136785139145, 'sky_mag_z_spec__627': 19.726246214442227, 'tsnr2_lrg__627': 70.26490783691406, 'tileid__627': 80685, 'tsnr2_lya__627': 89.51526641845703, 'efftime_dark_gfa__627': 825.1358589806441, 'faprgrm__627': 'elgqso', 'efftime_gfa__627': 825.1358589806441, 'tsnr2_gpbbright__627': 0.0, 'tsnr2_gpbbackup__627': 0.0, 'gpb_efftime_backup__627': 0.0, 'bgs_efftime_bright__627': 948.8765917968751, 'night__627': 20210115, 'fiber_fracflux_bgs_gfa__627': 0.23162289328675623, 'airmass__627': 1.003325, 'exptime__627': 737.294189453125, 'fiber_fracflux_elg_gfa__627': 0.5170860967073544, 'seeing_etc__627': 0.0, 'tsnr2_gpbdark__627': 0.0, 'gpb_efftime_bright__627': 0.0, 'lrg_efftime_dark__627': 853.7611913063681, 'efftime_etc__627': 0.0, 'fiberfac_elg_gfa__627': 1.1538710145713105}]\n(Background on this error at: https://sqlalche.me/e/20/gkpj) (Background on this error at: https://sqlalche.me/e/20/7s2a)", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mPendingRollbackError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[23], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mt\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mupdate_primary\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/global/common/software/desi/users/bweaver/perlmutter/desiconda/current/code/specprod-db/my-main/py/specprodDB/tile.py:360\u001b[0m, in \u001b[0;36mupdate_primary\u001b[0;34m()\u001b[0m\n\u001b[1;32m 357\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mupdate_primary\u001b[39m():\n\u001b[1;32m 358\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"Update the primary classification after some number of tiles has been loaded.\u001b[39;00m\n\u001b[1;32m 359\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m--> 360\u001b[0m zall_tilecumulative \u001b[38;5;241m=\u001b[39m \u001b[43mdb\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mdbSession\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mquery\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdb\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mZtile\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mall\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 361\u001b[0m zall_table \u001b[38;5;241m=\u001b[39m Table(\u001b[38;5;28mlist\u001b[39m(\u001b[38;5;28mzip\u001b[39m(\u001b[38;5;241m*\u001b[39m[(z\u001b[38;5;241m.\u001b[39mtargetid, z\u001b[38;5;241m.\u001b[39mzwarn, z\u001b[38;5;241m.\u001b[39mtsnr2_lrg) \u001b[38;5;28;01mfor\u001b[39;00m z \u001b[38;5;129;01min\u001b[39;00m zall_tilecumulative])),\n\u001b[1;32m 362\u001b[0m names\u001b[38;5;241m=\u001b[39m(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mTARGETID\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mZWARN\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mTSNR2_LRG\u001b[39m\u001b[38;5;124m'\u001b[39m))\n\u001b[1;32m 363\u001b[0m nspec, primary \u001b[38;5;241m=\u001b[39m find_primary_spectra(zall_table)\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/query.py:2673\u001b[0m, in \u001b[0;36mQuery.all\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 2651\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mall\u001b[39m(\u001b[38;5;28mself\u001b[39m) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m List[_T]:\n\u001b[1;32m 2652\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"Return the results represented by this :class:`_query.Query`\u001b[39;00m\n\u001b[1;32m 2653\u001b[0m \u001b[38;5;124;03m as a list.\u001b[39;00m\n\u001b[1;32m 2654\u001b[0m \n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 2671\u001b[0m \u001b[38;5;124;03m :meth:`_engine.Result.scalars` - v2 comparable method.\u001b[39;00m\n\u001b[1;32m 2672\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m-> 2673\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_iter\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241m.\u001b[39mall()\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/query.py:2827\u001b[0m, in \u001b[0;36mQuery._iter\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 2824\u001b[0m params \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_params\n\u001b[1;32m 2826\u001b[0m statement \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_statement_20()\n\u001b[0;32m-> 2827\u001b[0m result: Union[ScalarResult[_T], Result[_T]] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43msession\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mexecute\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 2828\u001b[0m \u001b[43m \u001b[49m\u001b[43mstatement\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2829\u001b[0m \u001b[43m \u001b[49m\u001b[43mparams\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2830\u001b[0m \u001b[43m \u001b[49m\u001b[43mexecution_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m{\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43m_sa_orm_load_options\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m:\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mload_options\u001b[49m\u001b[43m}\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2831\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2833\u001b[0m \u001b[38;5;66;03m# legacy: automatically set scalars, unique\u001b[39;00m\n\u001b[1;32m 2834\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m result\u001b[38;5;241m.\u001b[39m_attributes\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mis_single_entity\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mFalse\u001b[39;00m):\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/session.py:2306\u001b[0m, in \u001b[0;36mSession.execute\u001b[0;34m(self, statement, params, execution_options, bind_arguments, _parent_execute_state, _add_event)\u001b[0m\n\u001b[1;32m 2245\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mexecute\u001b[39m(\n\u001b[1;32m 2246\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[1;32m 2247\u001b[0m statement: Executable,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 2253\u001b[0m _add_event: Optional[Any] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[1;32m 2254\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Result[Any]:\n\u001b[1;32m 2255\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124mr\u001b[39m\u001b[38;5;124;03m\"\"\"Execute a SQL expression construct.\u001b[39;00m\n\u001b[1;32m 2256\u001b[0m \n\u001b[1;32m 2257\u001b[0m \u001b[38;5;124;03m Returns a :class:`_engine.Result` object representing\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 2304\u001b[0m \n\u001b[1;32m 2305\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m-> 2306\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_execute_internal\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 2307\u001b[0m \u001b[43m \u001b[49m\u001b[43mstatement\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2308\u001b[0m \u001b[43m \u001b[49m\u001b[43mparams\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2309\u001b[0m \u001b[43m \u001b[49m\u001b[43mexecution_options\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mexecution_options\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2310\u001b[0m \u001b[43m \u001b[49m\u001b[43mbind_arguments\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mbind_arguments\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2311\u001b[0m \u001b[43m \u001b[49m\u001b[43m_parent_execute_state\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m_parent_execute_state\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2312\u001b[0m \u001b[43m \u001b[49m\u001b[43m_add_event\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43m_add_event\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 2313\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/session.py:2181\u001b[0m, in \u001b[0;36mSession._execute_internal\u001b[0;34m(self, statement, params, execution_options, bind_arguments, _parent_execute_state, _add_event, _scalar_result)\u001b[0m\n\u001b[1;32m 2167\u001b[0m (\n\u001b[1;32m 2168\u001b[0m statement,\n\u001b[1;32m 2169\u001b[0m execution_options,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 2176\u001b[0m \u001b[38;5;28;01mFalse\u001b[39;00m,\n\u001b[1;32m 2177\u001b[0m )\n\u001b[1;32m 2179\u001b[0m bind \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mget_bind(\u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mbind_arguments)\n\u001b[0;32m-> 2181\u001b[0m conn \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_connection_for_bind\u001b[49m\u001b[43m(\u001b[49m\u001b[43mbind\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 2183\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m _scalar_result \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m compile_state_cls:\n\u001b[1;32m 2184\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m TYPE_CHECKING:\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/session.py:2050\u001b[0m, in \u001b[0;36mSession._connection_for_bind\u001b[0;34m(self, engine, execution_options, **kw)\u001b[0m\n\u001b[1;32m 2048\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m trans \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 2049\u001b[0m trans \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_autobegin_t()\n\u001b[0;32m-> 2050\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mtrans\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_connection_for_bind\u001b[49m\u001b[43m(\u001b[49m\u001b[43mengine\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mexecution_options\u001b[49m\u001b[43m)\u001b[49m\n", + "File \u001b[0;32m:2\u001b[0m, in \u001b[0;36m_connection_for_bind\u001b[0;34m(self, bind, execution_options)\u001b[0m\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/state_changes.py:103\u001b[0m, in \u001b[0;36m_StateChange.declare_states.._go\u001b[0;34m(fn, self, *arg, **kw)\u001b[0m\n\u001b[1;32m 97\u001b[0m current_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_state\n\u001b[1;32m 99\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m (\n\u001b[1;32m 100\u001b[0m has_prerequisite_states\n\u001b[1;32m 101\u001b[0m \u001b[38;5;129;01mand\u001b[39;00m current_state \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;129;01min\u001b[39;00m prerequisite_state_collection\n\u001b[1;32m 102\u001b[0m ):\n\u001b[0;32m--> 103\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_raise_for_prerequisite_state\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfn\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[38;5;18;43m__name__\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mcurrent_state\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 105\u001b[0m next_state \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_next_state\n\u001b[1;32m 106\u001b[0m existing_fn \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_current_fn\n", + "File \u001b[0;32m/global/common/software/desi/perlmutter/desiconda/20240425-2.2.0/conda/lib/python3.10/site-packages/sqlalchemy/orm/session.py:928\u001b[0m, in \u001b[0;36mSessionTransaction._raise_for_prerequisite_state\u001b[0;34m(self, operation_name, state)\u001b[0m\n\u001b[1;32m 926\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m state \u001b[38;5;129;01mis\u001b[39;00m SessionTransactionState\u001b[38;5;241m.\u001b[39mDEACTIVE:\n\u001b[1;32m 927\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_rollback_exception:\n\u001b[0;32m--> 928\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m sa_exc\u001b[38;5;241m.\u001b[39mPendingRollbackError(\n\u001b[1;32m 929\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mThis Session\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124ms transaction has been rolled back \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 930\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mdue to a previous exception during flush.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 931\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m To begin a new transaction with this Session, \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 932\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfirst issue Session.rollback().\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 933\u001b[0m \u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m Original exception was: \u001b[39m\u001b[38;5;132;01m{\u001b[39;00m\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_rollback_exception\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 934\u001b[0m code\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m7s2a\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 935\u001b[0m )\n\u001b[1;32m 936\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 937\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m sa_exc\u001b[38;5;241m.\u001b[39mInvalidRequestError(\n\u001b[1;32m 938\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mThis session is in \u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124minactive\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124m state, due to the \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 939\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mSQL transaction being rolled back; no further SQL \u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 940\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcan be emitted within this transaction.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[1;32m 941\u001b[0m )\n", + "\u001b[0;31mPendingRollbackError\u001b[0m: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (psycopg2.errors.NotNullViolation) null value in column \"fiberfac_gfa\" violates not-null constraint\nDETAIL: Failing row contains (20201222, 69455, 80610, 0, 0, 2020-12-23 12:02:33.591552+00, 59206.50177768, cmx, dark, elg, cmxelg, 900.004028320312, 1.34727168977261, 4000, dark, 0.9, 1.17609, 0.0214956291019917, 0, 0, 0.156659, 0.0387605, 0.103173, 0.166885976066826, 9.49855, 0, 0, 0, 1.25361, 1.34727, 1.3298, 1.909135184888, 0, 0, 0, 0.0691387515196852, 1.425028437377, 0.421895887401468, 0.319807524199896, 0.151348426191788, null, null, null, 1.18246672966859, 20.5068374559146, 21.6948676964909, 20.7336748369694, 19.1617744587365, null, null, null, null).\n\n[SQL: INSERT INTO daily.exposure (night, expid, tileid, tilera, tiledec, date_obs, mjd, survey, program, faprgrm, faflavor, exptime, efftime_spec, goaltime, goaltype, mintfrac, airmass, ebv, seeing_etc, efftime_etc, tsnr2_elg, tsnr2_qso, tsnr2_lrg, tsnr2_l ... 738229 characters truncated ... ime_gfa__627)s, %(efftime_dark_gfa__627)s, %(efftime_bright_gfa__627)s, %(efftime_backup_gfa__627)s)]\n[parameters: {'ebv__0': 0.05477216839790344, 'fiber_fracflux_gfa__0': 0.6093879572762915, 'efftime_spec__0': 716.840956115723, 'survey__0': 'cmx', 'fiberfac_bgs_gfa__0': 0.9697978701302379, 'fiberfac_gfa__0': 1.0061596313996244, 'date_obs__0': datetime.datetime(2020, 12, 17, 1, 35, 37, 77504, tzinfo=), 'sky_mag_g_spec__0': 21.82984125382668, 'goaltime__0': 1000.0, 'goaltype__0': 'unknown', 'seeing_gfa__0': 0.9498310820793945, 'tilera__0': 24.027, 'elg_efftime_dark__0': 716.840956115723, 'gpb_efftime_dark__0': 0.0, 'transparency_gfa__0': 0.9860573552204372, 'tiledec__0': 31.39, 'airmass_gfa__0': 1.0643660458221693, 'sky_mag_ab_gfa__0': 20.687300622263788, 'efftime_bright_gfa__0': 641.2192606190129, 'efftime_backup_gfa__0': 705.9319105165287, 'mintfrac__0': 0.9, 'tsnr2_bgs__0': 5526.3623046875, 'program__0': 'other', 'expid__0': 68265, 'lya_efftime_dark__0': 881.0479696260478, 'mjd__0': 59200.06640136, 'tsnr2_qso__0': 21.112829208374023, 'tsnr2_elg__0': 83.35359954833984, 'faflavor__0': 'cmxm33', 'sky_mag_r_spec__0': 21.05370965995666, 'sky_mag_z_spec__0': 19.200085082158704, 'tsnr2_lrg__0': 57.5751953125, 'tileid__0': 80615, 'tsnr2_lya__0': 77.01631164550781, 'efftime_dark_gfa__0': 648.1418017037299, 'faprgrm__0': 'm33', 'efftime_gfa__0': 648.1418017037299, 'tsnr2_gpbbright__0': 0.0, 'tsnr2_gpbbackup__0': 0.0, 'gpb_efftime_backup__0': 0.0, 'bgs_efftime_bright__0': 773.69072265625, 'night__0': 20201216, 'fiber_fracflux_bgs_gfa__0': 0.19807581524996704, 'airmass__0': 1.072093, 'exptime__0': 900.0020141601562, 'fiber_fracflux_elg_gfa__0': 0.4338655191836517, 'seeing_etc__0': 0.0, 'tsnr2_gpbdark__0': 0.0, 'gpb_efftime_bright__0': 0.0, 'lrg_efftime_dark__0': 699.573497680911 ... 32556 parameters truncated ... 'efftime_spec__627': 881.8314102172855, 'survey__627': 'sv1', 'fiberfac_bgs_gfa__627': 1.1219008645274058, 'fiberfac_gfa__627': 1.203024136532684, 'date_obs__627': datetime.datetime(2021, 1, 16, 8, 2, 31, 667136, tzinfo=), 'sky_mag_g_spec__627': 21.958881082495996, 'goaltime__627': 1000.0, 'goaltype__627': 'dark', 'seeing_gfa__627': 0.7716763904526707, 'tilera__627': 120.0, 'elg_efftime_dark__627': 881.8314102172855, 'gpb_efftime_dark__627': 0.0, 'transparency_gfa__627': 0.9688503867310785, 'tiledec__627': 34.0, 'airmass_gfa__627': 1.0052397520139693, 'sky_mag_ab_gfa__627': 22.31806687659762, 'efftime_bright_gfa__627': 762.1995935664742, 'efftime_backup_gfa__627': 847.4266225039098, 'mintfrac__627': 0.9, 'tsnr2_bgs__627': 6777.68994140625, 'program__627': 'dark', 'expid__627': 72511, 'lya_efftime_dark__627': 1024.032987862727, 'mjd__627': 59230.33508874, 'tsnr2_qso__627': 25.910263061523438, 'tsnr2_elg__627': 102.53853607177734, 'faflavor__627': 'sv1elgqso', 'sky_mag_r_spec__627': 21.33136785139145, 'sky_mag_z_spec__627': 19.726246214442227, 'tsnr2_lrg__627': 70.26490783691406, 'tileid__627': 80685, 'tsnr2_lya__627': 89.51526641845703, 'efftime_dark_gfa__627': 825.1358589806441, 'faprgrm__627': 'elgqso', 'efftime_gfa__627': 825.1358589806441, 'tsnr2_gpbbright__627': 0.0, 'tsnr2_gpbbackup__627': 0.0, 'gpb_efftime_backup__627': 0.0, 'bgs_efftime_bright__627': 948.8765917968751, 'night__627': 20210115, 'fiber_fracflux_bgs_gfa__627': 0.23162289328675623, 'airmass__627': 1.003325, 'exptime__627': 737.294189453125, 'fiber_fracflux_elg_gfa__627': 0.5170860967073544, 'seeing_etc__627': 0.0, 'tsnr2_gpbdark__627': 0.0, 'gpb_efftime_bright__627': 0.0, 'lrg_efftime_dark__627': 853.7611913063681, 'efftime_etc__627': 0.0, 'fiberfac_elg_gfa__627': 1.1538710145713105}]\n(Background on this error at: https://sqlalche.me/e/20/gkpj) (Background on this error at: https://sqlalche.me/e/20/7s2a)" + ] + } + ], "source": [ "t.update_primary()" ] diff --git a/doc/nb/TestPatchDailyWithJura.ipynb b/doc/nb/TestPatchDailyWithJura.ipynb index 998efef..af82701 100644 --- a/doc/nb/TestPatchDailyWithJura.ipynb +++ b/doc/nb/TestPatchDailyWithJura.ipynb @@ -10,7 +10,7 @@ }, { "cell_type": "code", - "execution_count": 1, + "execution_count": null, "id": "f220285b-75d0-4109-a5f5-3709bfaeed79", "metadata": { "tags": [] @@ -26,7 +26,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "c2571c97-816c-4b12-a572-8e987c88b654", "metadata": { "tags": [] @@ -57,7 +57,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "id": "74d311b4-d697-4944-945a-d56a68d1a39e", "metadata": { "tags": [] @@ -72,23 +72,12 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": null, "id": "ca1d655b-e315-4e14-9fdc-5d31f5dadcb1", "metadata": { "tags": [] }, - "outputs": [ - { - "data": { - "text/plain": [ - "(67710, 235203)" - ] - }, - "execution_count": 4, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "first_jura_exposure, last_jura_exposure = jura_exposures['EXPID'].min(), jura_exposures['EXPID'].max()\n", "first_jura_exposure, last_jura_exposure" @@ -96,23 +85,12 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": null, "id": "29c2d15b-3247-4320-bba7-a9b4e9fcc398", "metadata": { "tags": [] }, - "outputs": [ - { - "data": { - "text/plain": [ - "(20201214, 20240409)" - ] - }, - "execution_count": 5, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "first_jura_night = jura_exposures['NIGHT'][jura_exposures['EXPID'] == first_jura_exposure].min()\n", "last_jura_night = jura_exposures['NIGHT'][jura_exposures['EXPID'] == last_jura_exposure].max()\n", @@ -121,30 +99,19 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": null, "id": "51366113-4bfe-46e4-be86-dd4699cd2218", "metadata": { "tags": [] }, - "outputs": [ - { - "data": { - "text/plain": [ - "(20201216, 20240409)" - ] - }, - "execution_count": 6, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "jura_tiles['LASTNIGHT'].min(), jura_tiles['LASTNIGHT'].max()" ] }, { "cell_type": "code", - "execution_count": 7, + "execution_count": null, "id": "ded2208b-f17e-4c7f-aeff-3e7cca0f77a4", "metadata": { "tags": [] @@ -157,23 +124,12 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": null, "id": "473307c7-30f6-40ca-b297-3b927577d5b1", "metadata": { "tags": [] }, - "outputs": [ - { - "data": { - "text/plain": [ - "frozenset({80478, 80681, 80688, 80691, 82603, 82622, 82625, 221977})" - ] - }, - "execution_count": 8, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "jura_not_in_daily = jura_expid_set - daily_expid_set\n", "jura_not_in_daily" @@ -181,7 +137,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": null, "id": "879e049d-3aca-484b-80e3-5b06344077c5", "metadata": { "tags": [] @@ -204,7 +160,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": null, "id": "11f82181-9647-42e4-b05d-bd8427d20c9a", "metadata": { "tags": [] @@ -218,7 +174,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "id": "333dbff1-65b2-4e66-a35f-b1d2b34a05c4", "metadata": { "tags": [] @@ -232,7 +188,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "id": "8d6ca37d-2350-47b6-8e90-5ab8b0cc01ad", "metadata": { "tags": [] @@ -245,7 +201,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "id": "32431f66-d899-490e-98ad-4d9c299f74d7", "metadata": { "tags": [] @@ -258,7 +214,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": null, "id": "31e94315-0a93-454f-b228-7c10e14c22b1", "metadata": { "tags": [] @@ -266,9 +222,11 @@ "outputs": [], "source": [ "daily_frames_patched = daily_frames.copy()\n", - "# for column in jura_frames.colnames:\n", - " # jura does not have TSNR2_ALPHA\n", - " # daily_frames_patched[column][daily_frames_index] = jura_frames[column][jura_frames_index]\n", + "for column in daily_frames_patched.colnames:\n", + " if hasattr(daily_frames_patched[column], 'mask') and not column.startswith('TSNR2_'):\n", + " print(f\"Patching {column}...\")\n", + " daily_frames_patched[column][daily_frames_index] = jura_frames[column][jura_frames_index]\n", + " daily_frames_patched[column].mask[daily_frames_index] = False\n", "# daily_frames_patched" ] }, @@ -295,7 +253,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": null, "id": "e800b0bf-3824-4b78-94e5-e1f3fdb1e9ef", "metadata": { "tags": [] @@ -311,7 +269,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": null, "id": "933274c3-bc01-4287-ba1f-bf138d22c901", "metadata": { "tags": [] @@ -325,75 +283,12 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": null, "id": "6fec01f6-f4b2-443b-9763-c663375bae25", "metadata": { "tags": [] }, - "outputs": [ - { - "data": { - "text/html": [ - "
Table length=23714\n", - "
\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "
EXPIDNIGHTEFFTIME_SPECDAILY_INDEXJURA_INDEX
int32int32float64int64int64
50986202002190.00--
5098820200219680.39455871582061--
50991202002190.02--
5099520200219846.91201934814493--
5100120200219999.38381500244184--
51002202002191093.09810791015665--
51028202002190.06--
51029202002190.07--
51030202002191343.98883056640678--
51031202002191274.87585754394589--
...............
24752820240811969.604614257812523696--
24752920240811429.1817016601562523697--
247530202408111127.610351562523698--
247531202408111052.03784179687523699--
247532202408111063.46948242187523700--
247533202408111091.355834960937523701--
247534202408111112.20288085937523702--
24753520240811709.793579101562523703--
24753620240811213.3377532958984423704--
24753720240811199.9758148193359423705--
" - ], - "text/plain": [ - "\n", - "EXPID NIGHT EFFTIME_SPEC DAILY_INDEX JURA_INDEX\n", - "int32 int32 float64 int64 int64 \n", - "------ -------- ------------------ ----------- ----------\n", - " 50986 20200219 0.0 0 --\n", - " 50988 20200219 680.3945587158206 1 --\n", - " 50991 20200219 0.0 2 --\n", - " 50995 20200219 846.9120193481449 3 --\n", - " 51001 20200219 999.3838150024418 4 --\n", - " 51002 20200219 1093.0981079101566 5 --\n", - " 51028 20200219 0.0 6 --\n", - " 51029 20200219 0.0 7 --\n", - " 51030 20200219 1343.9888305664067 8 --\n", - " 51031 20200219 1274.8758575439458 9 --\n", - " ... ... ... ... ...\n", - "247528 20240811 969.6046142578125 23696 --\n", - "247529 20240811 429.18170166015625 23697 --\n", - "247530 20240811 1127.6103515625 23698 --\n", - "247531 20240811 1052.037841796875 23699 --\n", - "247532 20240811 1063.469482421875 23700 --\n", - "247533 20240811 1091.3558349609375 23701 --\n", - "247534 20240811 1112.202880859375 23702 --\n", - "247535 20240811 709.7935791015625 23703 --\n", - "247536 20240811 213.33775329589844 23704 --\n", - "247537 20240811 199.97581481933594 23705 --" - ] - }, - "execution_count": 17, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "j = join(daily_exposures_join, jura_exposures_join, join_type='outer', keys='EXPID')\n", "j" @@ -401,7 +296,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": null, "id": "83004567-d880-4ba6-968d-0555662ef9a2", "metadata": { "tags": [] @@ -414,83 +309,22 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": null, "id": "a63345ad-5660-4f46-9940-60f13370312a", "metadata": { "tags": [] }, - "outputs": [ - { - "data": { - "text/html": [ - "
Table length=23706\n", - "
\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "
NIGHTEXPIDTILEIDTILERATILEDECMJDSURVEYPROGRAMFAPRGRMFAFLAVOREXPTIMEEFFTIME_SPECGOALTIMEGOALTYPEMINTFRACAIRMASSEBVSEEING_ETCEFFTIME_ETCTSNR2_ELGTSNR2_QSOTSNR2_LRGTSNR2_LYATSNR2_BGSTSNR2_GPBDARKTSNR2_GPBBRIGHTTSNR2_GPBBACKUPLRG_EFFTIME_DARKELG_EFFTIME_DARKBGS_EFFTIME_BRIGHTLYA_EFFTIME_DARKGPB_EFFTIME_DARKGPB_EFFTIME_BRIGHTGPB_EFFTIME_BACKUPTRANSPARENCY_GFASEEING_GFAFIBER_FRACFLUX_GFAFIBER_FRACFLUX_ELG_GFAFIBER_FRACFLUX_BGS_GFAFIBERFAC_GFAFIBERFAC_ELG_GFAFIBERFAC_BGS_GFAAIRMASS_GFASKY_MAG_AB_GFASKY_MAG_G_SPECSKY_MAG_R_SPECSKY_MAG_Z_SPECEFFTIME_GFAEFFTIME_DARK_GFAEFFTIME_BRIGHT_GFAEFFTIME_BACKUP_GFA
int32int32int32float64float64float64bytes7bytes6bytes19bytes19float64float64float64bytes7float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64
2020021950986630750.00.00.0unknownotherunknownunknown60.00.01000.0unknown0.91.0433620.09420800954103470.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.0
2020021950988700040.00.00.0unknownotherunknownunknown900.0680.39455871582061000.0unknown0.91.1042830.046965613961219790.00.079.1156463623046919.95047569274902354.66622924804687557.564990997314455267.747558593750.00.00.0664.2277979694464680.3945587158206737.484658203125658.52956803708290.00.00.00.00.00.00.00.00.00.00.00.00.021.95559404162917321.28422641860946719.7907557967266570.00.00.00.0
2020021950991630750.00.00.0unknownotherunknownunknown60.00.01000.0unknown0.91.0080760.09420800954103470.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.0
2020021950995700040.00.00.0unknownotherunknownunknown900.0846.91201934814491000.0unknown0.91.0342270.046965613961219790.00.098.4781417846679724.32467079162597767.4287033081054766.306678771972666406.1250.00.00.0819.299588326338846.9120193481449896.8575000000001758.53236095733680.00.00.00.00.00.00.00.00.00.00.00.00.021.96630291420134621.26235970784676319.7520544912799420.00.00.00.0
2020021951001700040.00.00.0unknownotherunknownunknown900.0999.38381500244181000.0unknown0.91.0224790.046965613961219790.00.0116.207420349121128.30395698547363377.6779403686523471.614952087402347325.8222656250.00.00.0943.8340268130958999.38381500244181025.6151171875001819.25772324560270.00.00.00.00.00.00.00.00.00.00.00.00.022.0028815711624421.35699305442597819.8444141215956230.00.00.00.0
2020021951002700040.00.00.0unknownotherunknownunknown900.01093.09810791015661000.0unknown0.91.0349860.046965613961219790.00.0127.1044311523437530.66957283020019585.8729629516601671.70786285400398028.750.00.00.01043.40851511229831093.09810791015661124.025820.32059993395260.00.00.00.00.00.00.00.00.00.00.00.00.022.02143696272194621.3581861256913519.8880637760159540.00.00.00.0
2020021951028700050.00.00.0unknownotherunknownunknown0.00.01000.0unknown0.91.029540.0183388404548168180.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.0
2020021951029700050.00.00.0unknownotherunknownunknown0.00.01000.0unknown0.91.0252110.0183388404548168180.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.00.0
2020021951030700050.00.00.0unknownotherunknownunknown900.01343.98883056640671000.0unknown0.91.0213810.0183388404548168180.00.0156.2777709960937538.330753326416016103.22396850585938115.395515441894539775.4277343750.00.00.01254.2337425031771343.98883056640671368.55988281251320.09677445988860.00.00.00.00.00.00.00.00.00.00.00.00.022.08672177328053721.42054453875639219.894656012553120.00.00.00.0
2020021951031700050.00.00.0unknownotherunknownunknown900.01274.87585754394581000.0unknown0.91.0112030.0183388404548168180.00.0148.241378784179736.4664154052734497.36178588867188116.915367126464849226.10156250.00.00.01183.00467284408141274.87585754394581291.65421875000021337.4835099736180.00.00.00.00.00.00.00.00.00.00.00.00.022.08059819444743621.4001538558672119.8486995836349960.00.00.00.0
.........................................................................................................................................................
202408112475286951344.36916.08660534.38172642maindarkdarkmaindark901.3694458007812969.60461425781251000.0dark0.851.04063200950622560.0448774397373199460.74117398262023931011.6485595703125109.2862701416015631.88508987426757879.79886627197266102.941741891205316855.825195312512592.32519531252020.41918945312512808.1142578125969.6046142578125939.8619384765625959.81555175781251214.80612978081241055.62512207031251057.2437744140625907.14105224609380.99000682319121470.76396468408536870.76487712549817940.5316133813334640.23747911439513831.22104616772142731.16344033634172961.12885592073195881.042570606525832221.36786408651550322.103059970619621.37521262704342519.8551086022411224.23486465281641224.23486465281641087.21716695713081177.2436004852325
2024081124752910040351.02812.03960534.39354864maindarkdarkmaindark496.1578369140625429.181701660156251000.0dark0.851.06358504295349120.058740235865116120.7435870170593262457.55493164062548.6544723510742214.09316730499267635.32183456420898439.413046438433233153.460449218755470.96240234375914.03692626953126353.80078125429.18170166015625418.428466796875441.4844665527344465.10977497685997458.6353454589844478.2967224121094450.01107788085940.99578131492285740.74849031040015520.76440449806453510.53164504726826610.237186136870943361.21648092360340821.16369472624756031.1309542700424081.063975707915648221.24940770006806222.04194510395065621.29246781058749619.780432078859388497.0730537310182497.0730537310182476.4885777853104563.4197035038846
202408112475303815347.36418.41260534.40069601maindarkdarkmaindark1345.63464355468751127.61035156251000.0dark0.851.0343019962310790.146841824054718020.73557400703430181007.197021484375131.0687103271484435.8990554809570392.8028030395507890.588272075727597743.522460937513522.1738281252175.98657226562513279.15917968751127.61035156251127.190917968751084.09313964843751069.02395648356131133.57507324218751138.6490478515625940.50299072265620.95468684234531680.84080006020525320.70868512008352470.49694043505656980.223697220347170041.11030193671670931.0653895254811741.04028256903285451.040261525516957221.2692239477515522.07525024380956721.3228587050155319.891968418292131078.46791185527541078.4679118552754966.8927272969829999.3082350790254
2024081124753110051350.63520.86260534.41774169maindarkdarkmaindark1018.9348144531251052.0378417968751000.0dark0.851.03045797348022460.047810725867748260.80895602703094481018.5135498046875119.2167510986328134.2153244018554786.583152770996198.23122229110457357.291992187513527.36425781252159.6997070312513523.06251052.0378417968751025.264160156251030.02087402343751159.2177165722731134.010253906251130.12646484375957.7775878906250.99012242620495460.77335794144678170.75208868741713970.52368428594683470.234100126025368341.17730629432931441.12187481279197821.0888993879743461.036223986709016221.22358744681873322.0849911808578421.3262567098313119.9194751000014531271.0298011577481271.0298011577481131.42064080694291225.4939056252717
202408112475322238354.07618.23560534.43091844maindarkdarkmaindark1259.88757324218751063.4694824218751000.0dark0.851.0447549819946290.062360219657421110.77524602413177491009.441650390625122.2901153564453134.9276809692382887.52398681640625109.544803544878967571.916992187513547.36230468752216.3745117187514551.4160156251063.4694824218751051.6950683593751060.0683593751292.72825956836641135.68664550781251159.7832031251030.61120605468750.81814394873854380.76573855851906280.76725106020668780.53434497802158590.238671715588151921.04188164088526620.9937277750918350.96486582076512731.05335588416504421.12892024346390621.98283224846216321.22661701928618819.799648387840931128.4017960218831128.4017960218831020.68415196527681115.7333645631868
202408112475332257358.61614.51960534.44688809maindarkdarkmaindark1030.042480468751091.35583496093751000.0dark0.851.06836295127868650.0428092926740646360.85419398546218871015.0289916992188122.88208007812535.7277488708496189.81904602050781120.509653853997597814.2758789062514248.33593752322.95239257812514969.16894531251091.35583496093751056.7858886718751093.99865722656251422.12346041627761194.44982910156251215.553222656251060.19885253906250.9801154150043570.81497064589240380.72203285706975380.50400255717055380.226271894393553441.15834105075389321.10677764541663311.07652473370567911.076514520680384621.0807378671570821.97494638471752321.17643619967662319.804190361295971139.81419175385921139.81419175385921053.23160757644181179.0196901751244
20240811247534116434.10512.00560534.46021628maindarkdarkmaindark1180.03356933593751112.2028808593751000.0dark0.851.0825229883193970.143479302525520320.83504301309585571013.2708740234375127.9147186279296936.14294815063476691.534767150878999.8675450231887807.9868164062513986.50781252260.81176757812514419.84863281251112.2028808593751100.0666503906251093.11816406251178.52781225081281172.50061035156251183.03625488281251021.29290771484381.01752096882123460.79202059626740250.71420202053052080.49956374621625410.224639766629193881.19635622986405021.13826107187531721.10806501858822021.091819639062613621.06850376590253421.8929439652998421.14967536639509419.79140194174022928.3050724871539928.3050724871539860.0327572123894967.0168042167019
2024081124753536238.03715.23560534.47525803maindarkdarkmaindark815.0862426757812709.79357910156251000.0dark0.851.06699001789093020.066058114171028140.9333620071411133697.580383300781281.0710906982421922.83950233459472758.4163093566894560.5251485047861955139.26464843759036.7714843751505.731811523437510087.515625709.7935791015625697.21142578125719.4970703125714.2517705520763757.56005859375787.91845703125714.45330810546881.0179344717098240.82009548159593430.71564466415319120.5001102904208250.224355076193633761.1681476380988661.11922646505002991.09338470124394951.073692847041877621.03914255360679821.6598371732961921.10891747560536319.715744629047887760.1467011612814760.1467011612814728.8823471134752837.8630329669646
202408112475362100414.4815.50660534.48628697mainbrightbrightmainbright388.0565490722656213.33775329589844180.0bright0.851.05745804309844970.0573110096156597140.8351590037345886186.0221862792968823.163438796997076.30766725540161116.2284336090087912.1491895945742721523.8410644531252369.862060546875423.018249511718753283.35400390625197.185302734375199.20558166503906213.33775329589844143.37148099704925198.66751098632812221.35675048828125232.5451660156251.00032303783424670.83905328067896830.708492115218710.49736982617542070.223941833757577871.13199864480712861.0992226649972841.07455434932241521.059955398741816220.6810850068555920.76668432451620620.72527796986644319.699271231268256243.16951620049647228.24315289172364243.16951620049647325.19085591350307
202408112475372256416.36911.41660534.49216449mainbrightbrightmainbright802.7540893554688199.97581481933594180.0bright0.851.0843540430068970.0403720848262311.1371020078659058159.1012878417968824.5193061828613286.13717174530029314.4767894744873059.792677556071431428.3986816406252059.87060546875385.86526489257813577.23974609375175.90176391601562210.8660430908203199.97581481933594115.56249684073876172.6806640625201.9153594970703253.359771728515620.96378083658604430.82427697569845060.73145903013307180.51077391004699610.229462695910271571.15342931824153141.10405034919916781.07977397987880241.090236170929188619.09355995332339318.70764197286207419.113249084528819.091466695236615196.75697506196457160.3567407149404196.75697506196457384.09250395416865
" - ], - "text/plain": [ - "\n", - " NIGHT EXPID TILEID ... EFFTIME_BRIGHT_GFA EFFTIME_BACKUP_GFA\n", - " int32 int32 int32 ... float64 float64 \n", - "-------- ------ ------ ... ------------------ ------------------\n", - "20200219 50986 63075 ... 0.0 0.0\n", - "20200219 50988 70004 ... 0.0 0.0\n", - "20200219 50991 63075 ... 0.0 0.0\n", - "20200219 50995 70004 ... 0.0 0.0\n", - "20200219 51001 70004 ... 0.0 0.0\n", - "20200219 51002 70004 ... 0.0 0.0\n", - "20200219 51028 70005 ... 0.0 0.0\n", - "20200219 51029 70005 ... 0.0 0.0\n", - "20200219 51030 70005 ... 0.0 0.0\n", - "20200219 51031 70005 ... 0.0 0.0\n", - " ... ... ... ... ... ...\n", - "20240811 247528 6951 ... 1087.2171669571308 1177.2436004852325\n", - "20240811 247529 10040 ... 476.4885777853104 563.4197035038846\n", - "20240811 247530 3815 ... 966.8927272969829 999.3082350790254\n", - "20240811 247531 10051 ... 1131.4206408069429 1225.4939056252717\n", - "20240811 247532 2238 ... 1020.6841519652768 1115.7333645631868\n", - "20240811 247533 2257 ... 1053.2316075764418 1179.0196901751244\n", - "20240811 247534 11643 ... 860.0327572123894 967.0168042167019\n", - "20240811 247535 3623 ... 728.8823471134752 837.8630329669646\n", - "20240811 247536 21004 ... 243.16951620049647 325.19085591350307\n", - "20240811 247537 22564 ... 196.75697506196457 384.09250395416865" - ] - }, - "execution_count": 19, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "daily_exposures_patched = daily_exposures.copy()\n", - "# for column in jura_exposures.colnames:\n", - "# for column in ('NIGHT', 'EXPID', 'TILEID', 'TILERA', 'TILEDEC', 'MJD', 'SURVEY', 'PROGRAM', 'FAPRGRM', 'FAFLAVOR', 'EXPTIME', 'GOALTIME', 'GOALTYPE', 'MINTFRAC', 'AIRMASS', 'EBV', 'SEEING_ETC', 'EFFTIME_ETC',\n", - "# 'TRANSPARENCY_GFA', 'SEEING_GFA', 'FIBER_FRACFLUX_GFA', 'FIBER_FRACFLUX_ELG_GFA', 'FIBER_FRACFLUX_BGS_GFA', 'FIBERFAC_GFA', 'FIBERFAC_ELG_GFA', 'FIBERFAC_BGS_GFA', 'AIRMASS_GFA', 'SKY_MAG_AB_GFA',\n", - "# 'EFFTIME_GFA', 'EFFTIME_DARK_GFA', 'EFFTIME_BRIGHT_GFA', 'EFFTIME_BACKUP_GFA'):\n", - "for column in ('TILERA', 'TILEDEC', 'MJD', 'SURVEY'):\n", + "can_patch = ('NIGHT', 'EXPID', 'TILEID', 'TILERA', 'TILEDEC', 'MJD', 'SURVEY', 'PROGRAM', 'FAPRGRM', 'FAFLAVOR', 'EXPTIME', 'GOALTIME', 'GOALTYPE', 'MINTFRAC', 'AIRMASS', 'EBV', 'SEEING_ETC', 'EFFTIME_ETC',\n", + " 'TRANSPARENCY_GFA', 'SEEING_GFA', 'FIBER_FRACFLUX_GFA', 'FIBER_FRACFLUX_ELG_GFA', 'FIBER_FRACFLUX_BGS_GFA', 'FIBERFAC_GFA', 'FIBERFAC_ELG_GFA', 'FIBERFAC_BGS_GFA', 'AIRMASS_GFA', 'SKY_MAG_AB_GFA',\n", + " 'EFFTIME_GFA', 'EFFTIME_DARK_GFA', 'EFFTIME_BRIGHT_GFA', 'EFFTIME_BACKUP_GFA')\n", + "for column in ['TILERA', 'TILEDEC', 'MJD', 'SURVEY'] + [c for c in daily_exposures_patched.colnames if hasattr(daily_exposures_patched[c], 'mask') and c in can_patch]:\n", + " print(f\"Patching {column}...\")\n", " daily_exposures_patched[column][daily_exposures_index] = jura_exposures[column][jura_exposures_index]\n", + " if hasattr(daily_exposures_patched[column], 'mask'):\n", + " daily_exposures_patched[column].mask[daily_exposures_index] = False\n", "daily_exposures_patched" ] }, @@ -504,7 +338,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": null, "id": "00e2e401-93f6-4d87-8307-9c1f0db767e2", "metadata": { "tags": [] @@ -522,439 +356,12 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": null, "id": "60427b0b-913d-456b-b45e-6ccc3a46866b", "metadata": { "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "INFO: tile 80618 exposure 69082 has MJD-OBS = 59204.557878 in /global/cfs/cdirs/desi/spectro/data/20201220/00069082/desi-00069082.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201220 69082 80618 59204.55787815\n", - "INFO: tile 80618 exposure 69083 has MJD-OBS = 59204.563137 in /global/cfs/cdirs/desi/spectro/data/20201220/00069083/desi-00069083.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201220 69083 80618 59204.56313729\n", - "INFO: tile 80618 exposure 69084 has MJD-OBS = 59204.568494 in /global/cfs/cdirs/desi/spectro/data/20201220/00069084/desi-00069084.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201220 69084 80618 59204.56849373\n", - "INFO: tile 80618 exposure 69085 has MJD-OBS = 59204.573527 in /global/cfs/cdirs/desi/spectro/data/20201220/00069085/desi-00069085.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201220 69085 80618 59204.57352664\n", - "INFO: tile 80617 exposure 69400 has MJD-OBS = 59206.108281 in /global/cfs/cdirs/desi/spectro/data/20201222/00069400/desi-00069400.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201222 69400 80617 59206.10828083\n", - "INFO: tile 80617 exposure 69401 has MJD-OBS = 59206.116788 in /global/cfs/cdirs/desi/spectro/data/20201222/00069401/desi-00069401.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201222 69401 80617 59206.11678777\n", - "INFO: tile 80617 exposure 69402 has MJD-OBS = 59206.125315 in /global/cfs/cdirs/desi/spectro/data/20201222/00069402/desi-00069402.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201222 69402 80617 59206.12531454\n", - "INFO: tile 80617 exposure 69403 has MJD-OBS = 59206.135059 in /global/cfs/cdirs/desi/spectro/data/20201222/00069403/desi-00069403.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201222 69403 80617 59206.13505941\n", - "INFO: tile 80617 exposure 69404 has MJD-OBS = 59206.145698 in /global/cfs/cdirs/desi/spectro/data/20201222/00069404/desi-00069404.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201222 69404 80617 59206.14569799\n", - "INFO: tile 80608 exposure 69435 has MJD-OBS = 59206.313242 in /global/cfs/cdirs/desi/spectro/data/20201222/00069435/desi-00069435.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ -------------\n", - "20201222 69435 80608 59206.3132417\n", - "INFO: tile 80608 exposure 69436 has MJD-OBS = 59206.326569 in /global/cfs/cdirs/desi/spectro/data/20201222/00069436/desi-00069436.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201222 69436 80608 59206.32656933\n", - "INFO: tile 80608 exposure 69437 has MJD-OBS = 59206.339900 in /global/cfs/cdirs/desi/spectro/data/20201222/00069437/desi-00069437.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201222 69437 80608 59206.33989997\n", - "INFO: tile 80608 exposure 69438 has MJD-OBS = 59206.353205 in /global/cfs/cdirs/desi/spectro/data/20201222/00069438/desi-00069438.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201222 69438 80608 59206.35320477\n", - "INFO: tile 80607 exposure 69440 has MJD-OBS = 59206.367353 in /global/cfs/cdirs/desi/spectro/data/20201222/00069440/desi-00069440.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201222 69440 80607 59206.36735299\n", - "INFO: tile 80607 exposure 69441 has MJD-OBS = 59206.380662 in /global/cfs/cdirs/desi/spectro/data/20201222/00069441/desi-00069441.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201222 69441 80607 59206.38066192\n", - "INFO: tile 80607 exposure 69442 has MJD-OBS = 59206.393943 in /global/cfs/cdirs/desi/spectro/data/20201222/00069442/desi-00069442.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201222 69442 80607 59206.39394324\n", - "INFO: tile 80620 exposure 69444 has MJD-OBS = 59206.409566 in /global/cfs/cdirs/desi/spectro/data/20201222/00069444/desi-00069444.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201222 69444 80620 59206.40956632\n", - "INFO: tile 80620 exposure 69445 has MJD-OBS = 59206.422851 in /global/cfs/cdirs/desi/spectro/data/20201222/00069445/desi-00069445.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201222 69445 80620 59206.42285072\n", - "INFO: tile 80620 exposure 69446 has MJD-OBS = 59206.436229 in /global/cfs/cdirs/desi/spectro/data/20201222/00069446/desi-00069446.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201222 69446 80620 59206.43622927\n", - "INFO: tile 80620 exposure 69447 has MJD-OBS = 59206.449480 in /global/cfs/cdirs/desi/spectro/data/20201222/00069447/desi-00069447.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201222 69447 80620 59206.44947983\n", - "INFO: tile 80614 exposure 69449 has MJD-OBS = 59206.468311 in /global/cfs/cdirs/desi/spectro/data/20201222/00069449/desi-00069449.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201222 69449 80614 59206.46831138\n", - "INFO: tile 80614 exposure 69450 has MJD-OBS = 59206.474771 in /global/cfs/cdirs/desi/spectro/data/20201222/00069450/desi-00069450.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201222 69450 80614 59206.47477105\n", - "INFO: tile 80614 exposure 69451 has MJD-OBS = 59206.481235 in /global/cfs/cdirs/desi/spectro/data/20201222/00069451/desi-00069451.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201222 69451 80614 59206.48123483\n", - "INFO: tile 80614 exposure 69452 has MJD-OBS = 59206.487680 in /global/cfs/cdirs/desi/spectro/data/20201222/00069452/desi-00069452.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201222 69452 80614 59206.48768029\n", - "INFO: tile 80614 exposure 69453 has MJD-OBS = 59206.494103 in /global/cfs/cdirs/desi/spectro/data/20201222/00069453/desi-00069453.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201222 69453 80614 59206.49410313\n", - "INFO: tile 80610 exposure 69455 has MJD-OBS = 59206.501778 in /global/cfs/cdirs/desi/spectro/data/20201222/00069455/desi-00069455.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201222 69455 80610 59206.50177768\n", - "INFO: tile 80610 exposure 69456 has MJD-OBS = 59206.515169 in /global/cfs/cdirs/desi/spectro/data/20201222/00069456/desi-00069456.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201222 69456 80610 59206.51516924\n", - "INFO: tile 80614 exposure 69458 has MJD-OBS = 59206.533942 in /global/cfs/cdirs/desi/spectro/data/20201222/00069458/desi-00069458.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201222 69458 80614 59206.53394194\n", - "INFO: tile 80614 exposure 69459 has MJD-OBS = 59206.540400 in /global/cfs/cdirs/desi/spectro/data/20201222/00069459/desi-00069459.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201222 69459 80614 59206.54040006\n", - "INFO: tile 80614 exposure 69460 has MJD-OBS = 59206.546853 in /global/cfs/cdirs/desi/spectro/data/20201222/00069460/desi-00069460.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201222 69460 80614 59206.54685306\n", - "INFO: tile 80623 exposure 69628 has MJD-OBS = 59207.380045 in /global/cfs/cdirs/desi/spectro/data/20201223/00069628/desi-00069628.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201223 69628 80623 59207.38004477\n", - "INFO: tile 80623 exposure 69629 has MJD-OBS = 59207.393223 in /global/cfs/cdirs/desi/spectro/data/20201223/00069629/desi-00069629.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201223 69629 80623 59207.39322287\n", - "INFO: tile 80622 exposure 69631 has MJD-OBS = 59207.407850 in /global/cfs/cdirs/desi/spectro/data/20201223/00069631/desi-00069631.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201223 69631 80622 59207.40785035\n", - "INFO: tile 80622 exposure 69632 has MJD-OBS = 59207.421005 in /global/cfs/cdirs/desi/spectro/data/20201223/00069632/desi-00069632.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20201223 69632 80622 59207.42100469\n", - "INFO: tile 80635 exposure 70543 has MJD-OBS = 59217.249417 in /global/cfs/cdirs/desi/spectro/data/20210102/00070543/desi-00070543.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ -------------\n", - "20210102 70543 80635 59217.2494171\n", - "INFO: tile 80635 exposure 70544 has MJD-OBS = 59217.255461 in /global/cfs/cdirs/desi/spectro/data/20210102/00070544/desi-00070544.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20210102 70544 80635 59217.25546107\n", - "INFO: tile 80635 exposure 70545 has MJD-OBS = 59217.261845 in /global/cfs/cdirs/desi/spectro/data/20210102/00070545/desi-00070545.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20210102 70545 80635 59217.26184494\n", - "INFO: tile 80713 exposure 71721 has MJD-OBS = 59225.094667 in /global/cfs/cdirs/desi/spectro/data/20210110/00071721/desi-00071721.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210110 71721 80713 59225.094667134\n", - "INFO: tile 80713 exposure 71722 has MJD-OBS = 59225.107224 in /global/cfs/cdirs/desi/spectro/data/20210110/00071722/desi-00071722.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210110 71722 80713 59225.107223918\n", - "INFO: tile 80713 exposure 71723 has MJD-OBS = 59225.119826 in /global/cfs/cdirs/desi/spectro/data/20210110/00071723/desi-00071723.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210110 71723 80713 59225.119825769\n", - "INFO: tile 80670 exposure 71724 has MJD-OBS = 59225.134263 in /global/cfs/cdirs/desi/spectro/data/20210110/00071724/desi-00071724.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210110 71724 80670 59225.134262648\n", - "INFO: tile 80670 exposure 71870 has MJD-OBS = 59226.161130 in /global/cfs/cdirs/desi/spectro/data/20210111/00071870/desi-00071870.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210111 71870 80670 59226.161129722\n", - "INFO: tile 80715 exposure 72498 has MJD-OBS = 59230.164165 in /global/cfs/cdirs/desi/spectro/data/20210115/00072498/desi-00072498.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210115 72498 80715 59230.164164663\n", - "INFO: tile 80715 exposure 72499 has MJD-OBS = 59230.176755 in /global/cfs/cdirs/desi/spectro/data/20210115/00072499/desi-00072499.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210115 72499 80715 59230.176755043\n", - "INFO: tile 80715 exposure 72500 has MJD-OBS = 59230.189428 in /global/cfs/cdirs/desi/spectro/data/20210115/00072500/desi-00072500.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ -------------\n", - "20210115 72500 80715 59230.1894283\n", - "INFO: tile 80687 exposure 75823 has MJD-OBS = 59260.123180 in /global/cfs/cdirs/desi/spectro/data/20210214/00075823/desi-00075823.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20210214 75823 80687 59260.12318035\n", - "INFO: tile 80687 exposure 75824 has MJD-OBS = 59260.132294 in /global/cfs/cdirs/desi/spectro/data/20210214/00075824/desi-00075824.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210214 75824 80687 59260.132294067\n", - "INFO: tile 80687 exposure 75825 has MJD-OBS = 59260.141440 in /global/cfs/cdirs/desi/spectro/data/20210214/00075825/desi-00075825.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210214 75825 80687 59260.141440081\n", - "INFO: tile 80687 exposure 75826 has MJD-OBS = 59260.150494 in /global/cfs/cdirs/desi/spectro/data/20210214/00075826/desi-00075826.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210214 75826 80687 59260.150493743\n", - "INFO: tile 80687 exposure 75827 has MJD-OBS = 59260.159721 in /global/cfs/cdirs/desi/spectro/data/20210214/00075827/desi-00075827.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210214 75827 80687 59260.159721426\n", - "INFO: tile 80687 exposure 75828 has MJD-OBS = 59260.168634 in /global/cfs/cdirs/desi/spectro/data/20210214/00075828/desi-00075828.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210214 75828 80687 59260.168633955\n", - "INFO: tile 80687 exposure 75829 has MJD-OBS = 59260.177738 in /global/cfs/cdirs/desi/spectro/data/20210214/00075829/desi-00075829.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210214 75829 80687 59260.177738254\n", - "INFO: tile 80687 exposure 75830 has MJD-OBS = 59260.186794 in /global/cfs/cdirs/desi/spectro/data/20210214/00075830/desi-00075830.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210214 75830 80687 59260.186793903\n", - "INFO: tile 80687 exposure 75831 has MJD-OBS = 59260.196030 in /global/cfs/cdirs/desi/spectro/data/20210214/00075831/desi-00075831.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210214 75831 80687 59260.196030128\n", - "INFO: tile 80687 exposure 75832 has MJD-OBS = 59260.204947 in /global/cfs/cdirs/desi/spectro/data/20210214/00075832/desi-00075832.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210214 75832 80687 59260.204947223\n", - "INFO: tile 80687 exposure 75835 has MJD-OBS = 59260.218992 in /global/cfs/cdirs/desi/spectro/data/20210214/00075835/desi-00075835.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210214 75835 80687 59260.218992112\n", - "INFO: tile 80687 exposure 75836 has MJD-OBS = 59260.228327 in /global/cfs/cdirs/desi/spectro/data/20210214/00075836/desi-00075836.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20210214 75836 80687 59260.22832683\n", - "INFO: tile 80708 exposure 75868 has MJD-OBS = 59260.515382 in /global/cfs/cdirs/desi/spectro/data/20210214/00075868/desi-00075868.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20210214 75868 80708 59260.51538167\n", - "INFO: tile 80708 exposure 75869 has MJD-OBS = 59260.524510 in /global/cfs/cdirs/desi/spectro/data/20210214/00075869/desi-00075869.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210214 75869 80708 59260.524510298\n", - "INFO: tile 80708 exposure 75870 has MJD-OBS = 59260.533663 in /global/cfs/cdirs/desi/spectro/data/20210214/00075870/desi-00075870.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210214 75870 80708 59260.533663345\n", - "INFO: tile 80733 exposure 75873 has MJD-OBS = 59260.550852 in /global/cfs/cdirs/desi/spectro/data/20210214/00075873/desi-00075873.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210214 75873 80733 59260.550852082\n", - "INFO: tile 80733 exposure 75874 has MJD-OBS = 59260.556760 in /global/cfs/cdirs/desi/spectro/data/20210214/00075874/desi-00075874.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210214 75874 80733 59260.556760477\n", - "INFO: tile 80769 exposure 76926 has MJD-OBS = 59265.098968 in /global/cfs/cdirs/desi/spectro/data/20210219/00076926/desi-00076926.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210219 76926 80769 59265.098968318\n", - "INFO: tile 80769 exposure 76949 has MJD-OBS = 59265.126700 in /global/cfs/cdirs/desi/spectro/data/20210219/00076949/desi-00076949.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210219 76949 80769 59265.126700093\n", - "INFO: tile 80769 exposure 76952 has MJD-OBS = 59265.132660 in /global/cfs/cdirs/desi/spectro/data/20210219/00076952/desi-00076952.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210219 76952 80769 59265.132659945\n", - "INFO: tile 80816 exposure 77753 has MJD-OBS = 59269.256470 in /global/cfs/cdirs/desi/spectro/data/20210223/00077753/desi-00077753.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210223 77753 80816 59269.256470218\n", - "INFO: tile 80662 exposure 77926 has MJD-OBS = 59270.253469 in /global/cfs/cdirs/desi/spectro/data/20210224/00077926/desi-00077926.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210224 77926 80662 59270.253469231\n", - "INFO: tile 80662 exposure 77929 has MJD-OBS = 59270.272156 in /global/cfs/cdirs/desi/spectro/data/20210224/00077929/desi-00077929.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210224 77929 80662 59270.272156213\n", - "INFO: tile 80639 exposure 79046 has MJD-OBS = 59274.186137 in /global/cfs/cdirs/desi/spectro/data/20210228/00079046/desi-00079046.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210228 79046 80639 59274.186137438\n", - "INFO: tile 80722 exposure 79058 has MJD-OBS = 59274.230862 in /global/cfs/cdirs/desi/spectro/data/20210228/00079058/desi-00079058.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210228 79058 80722 59274.230862343\n", - "INFO: tile 80722 exposure 79060 has MJD-OBS = 59274.264118 in /global/cfs/cdirs/desi/spectro/data/20210228/00079060/desi-00079060.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210228 79060 80722 59274.264117823\n", - "INFO: tile 80722 exposure 79061 has MJD-OBS = 59274.272239 in /global/cfs/cdirs/desi/spectro/data/20210228/00079061/desi-00079061.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210228 79061 80722 59274.272238992\n", - "INFO: tile 80722 exposure 79062 has MJD-OBS = 59274.277943 in /global/cfs/cdirs/desi/spectro/data/20210228/00079062/desi-00079062.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210228 79062 80722 59274.277943426\n", - "INFO: tile 80741 exposure 79066 has MJD-OBS = 59274.328710 in /global/cfs/cdirs/desi/spectro/data/20210228/00079066/desi-00079066.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210228 79066 80741 59274.328709963\n", - "INFO: tile 80741 exposure 79067 has MJD-OBS = 59274.343822 in /global/cfs/cdirs/desi/spectro/data/20210228/00079067/desi-00079067.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20210228 79067 80741 59274.34382233\n", - "INFO: tile 80741 exposure 79068 has MJD-OBS = 59274.358837 in /global/cfs/cdirs/desi/spectro/data/20210228/00079068/desi-00079068.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210228 79068 80741 59274.358837452\n", - "INFO: tile 80740 exposure 79069 has MJD-OBS = 59274.374192 in /global/cfs/cdirs/desi/spectro/data/20210228/00079069/desi-00079069.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210228 79069 80740 59274.374191986\n", - "INFO: tile 80740 exposure 79070 has MJD-OBS = 59274.390114 in /global/cfs/cdirs/desi/spectro/data/20210228/00079070/desi-00079070.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210228 79070 80740 59274.390114169\n", - "INFO: tile 80726 exposure 79072 has MJD-OBS = 59274.408621 in /global/cfs/cdirs/desi/spectro/data/20210228/00079072/desi-00079072.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210228 79072 80726 59274.408620889\n", - "INFO: tile 80726 exposure 79073 has MJD-OBS = 59274.423888 in /global/cfs/cdirs/desi/spectro/data/20210228/00079073/desi-00079073.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210228 79073 80726 59274.423888115\n", - "INFO: tile 80726 exposure 79074 has MJD-OBS = 59274.439179 in /global/cfs/cdirs/desi/spectro/data/20210228/00079074/desi-00079074.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210228 79074 80726 59274.439178527\n", - "INFO: tile 80721 exposure 79741 has MJD-OBS = 59282.176876 in /global/cfs/cdirs/desi/spectro/data/20210308/00079741/desi-00079741.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210308 79741 80721 59282.176876234\n", - "INFO: tile 80721 exposure 79749 has MJD-OBS = 59282.207467 in /global/cfs/cdirs/desi/spectro/data/20210308/00079749/desi-00079749.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210308 79749 80721 59282.207466672\n", - "INFO: tile 80722 exposure 80474 has MJD-OBS = 59288.188474 in /global/cfs/cdirs/desi/spectro/data/20210314/00080474/desi-00080474.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210314 80474 80722 59288.188474374\n", - "INFO: tile 80871 exposure 80481 has MJD-OBS = 59288.216706 in /global/cfs/cdirs/desi/spectro/data/20210314/00080481/desi-00080481.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210314 80481 80871 59288.216706308\n", - "INFO: tile 80702 exposure 81201 has MJD-OBS = 59294.236517 in /global/cfs/cdirs/desi/spectro/data/20210320/00081201/desi-00081201.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210320 81201 80702 59294.236516598\n", - "INFO: tile 80742 exposure 81356 has MJD-OBS = 59295.108323 in /global/cfs/cdirs/desi/spectro/data/20210321/00081356/desi-00081356.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210321 81356 80742 59295.108323264\n", - "INFO: tile 80916 exposure 81471 has MJD-OBS = 59296.117864 in /global/cfs/cdirs/desi/spectro/data/20210322/00081471/desi-00081471.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210322 81471 80916 59296.117863884\n", - "INFO: tile 80916 exposure 81478 has MJD-OBS = 59296.147124 in /global/cfs/cdirs/desi/spectro/data/20210322/00081478/desi-00081478.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210322 81478 80916 59296.147124245\n", - "INFO: tile 80916 exposure 81508 has MJD-OBS = 59296.281297 in /global/cfs/cdirs/desi/spectro/data/20210322/00081508/desi-00081508.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210322 81508 80916 59296.281297302\n", - "INFO: tile 80621 exposure 83414 has MJD-OBS = 59309.140932 in /global/cfs/cdirs/desi/spectro/data/20210404/00083414/desi-00083414.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210404 83414 80621 59309.140931599\n", - "INFO: tile 80621 exposure 83415 has MJD-OBS = 59309.154354 in /global/cfs/cdirs/desi/spectro/data/20210404/00083415/desi-00083415.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210404 83415 80621 59309.154353633\n", - "INFO: tile 80871 exposure 83976 has MJD-OBS = 59313.215656 in /global/cfs/cdirs/desi/spectro/data/20210408/00083976/desi-00083976.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210408 83976 80871 59313.215655974\n", - "INFO: tile 88 exposure 85616 has MJD-OBS = 59325.179788 in /global/cfs/cdirs/desi/spectro/data/20210420/00085616/desi-00085616.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210420 85616 88 59325.179788298\n", - "INFO: tile 80916 exposure 85983 has MJD-OBS = 59327.145040 in /global/cfs/cdirs/desi/spectro/data/20210422/00085983/desi-00085983.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210422 85983 80916 59327.145039662\n", - "INFO: tile 82052 exposure 86134 has MJD-OBS = 59328.228283 in /global/cfs/cdirs/desi/spectro/data/20210423/00086134/desi-00086134.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210423 86134 82052 59328.228283382\n", - "INFO: tile 82065 exposure 86150 has MJD-OBS = 59328.340232 in /global/cfs/cdirs/desi/spectro/data/20210423/00086150/desi-00086150.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20210423 86150 82065 59328.34023238\n", - "INFO: tile 82026 exposure 86164 has MJD-OBS = 59328.431506 in /global/cfs/cdirs/desi/spectro/data/20210423/00086164/desi-00086164.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210423 86164 82026 59328.431505944\n", - "INFO: tile 82039 exposure 86271 has MJD-OBS = 59329.414145 in /global/cfs/cdirs/desi/spectro/data/20210424/00086271/desi-00086271.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210424 86271 82039 59329.414145131\n", - "INFO: tile 81096 exposure 86615 has MJD-OBS = 59334.232449 in /global/cfs/cdirs/desi/spectro/data/20210429/00086615/desi-00086615.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210429 86615 81096 59334.232448542\n", - "INFO: tile 82039 exposure 86628 has MJD-OBS = 59334.426929 in /global/cfs/cdirs/desi/spectro/data/20210429/00086628/desi-00086628.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210429 86628 82039 59334.426928885\n", - "INFO: tile 82039 exposure 90251 has MJD-OBS = 59364.411164 in /global/cfs/cdirs/desi/spectro/data/20210529/00090251/desi-00090251.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210529 90251 82039 59364.411163769\n", - "INFO: tile 2704 exposure 96355 has MJD-OBS = 59393.181737 in /global/cfs/cdirs/desi/spectro/data/20210627/00096355/desi-00096355.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ --------------\n", - "20210627 96355 2704 59393.18173717\n", - "INFO: tile 2786 exposure 96360 has MJD-OBS = 59393.240284 in /global/cfs/cdirs/desi/spectro/data/20210627/00096360/desi-00096360.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210627 96360 2786 59393.240284236\n", - "INFO: tile 20307 exposure 97854 has MJD-OBS = 59403.475127 in /global/cfs/cdirs/desi/spectro/data/20210707/00097854/desi-00097854.fits.fz!\n", - " NIGHT EXPID TILEID MJD \n", - "-------- ----- ------ ---------------\n", - "20210707 97854 20307 59403.475127378\n" - ] - } - ], + "outputs": [], "source": [ "missing_mjd = np.where((daily_exposures_patched['NIGHT'] >= first_jura_night) & (daily_exposures_patched['EFFTIME_SPEC'] > 0) & (daily_exposures_patched['MJD'] < 50000))[0]\n", "for row in daily_exposures_patched[missing_mjd]:\n", @@ -970,33 +377,12 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": null, "id": "fdc2baa0-8cd9-4fbf-8c5f-ec83a931a72b", "metadata": { "tags": [] }, - "outputs": [ - { - "data": { - "text/html": [ - "
Table length=0\n", - "
\n", - "\n", - "\n", - "
NIGHTEXPIDTILEIDTILERATILEDECMJDSURVEYPROGRAMFAPRGRMFAFLAVOREXPTIMEEFFTIME_SPECGOALTIMEGOALTYPEMINTFRACAIRMASSEBVSEEING_ETCEFFTIME_ETCTSNR2_ELGTSNR2_QSOTSNR2_LRGTSNR2_LYATSNR2_BGSTSNR2_GPBDARKTSNR2_GPBBRIGHTTSNR2_GPBBACKUPLRG_EFFTIME_DARKELG_EFFTIME_DARKBGS_EFFTIME_BRIGHTLYA_EFFTIME_DARKGPB_EFFTIME_DARKGPB_EFFTIME_BRIGHTGPB_EFFTIME_BACKUPTRANSPARENCY_GFASEEING_GFAFIBER_FRACFLUX_GFAFIBER_FRACFLUX_ELG_GFAFIBER_FRACFLUX_BGS_GFAFIBERFAC_GFAFIBERFAC_ELG_GFAFIBERFAC_BGS_GFAAIRMASS_GFASKY_MAG_AB_GFASKY_MAG_G_SPECSKY_MAG_R_SPECSKY_MAG_Z_SPECEFFTIME_GFAEFFTIME_DARK_GFAEFFTIME_BRIGHT_GFAEFFTIME_BACKUP_GFA
int32int32int32float64float64float64bytes7bytes6bytes19bytes19float64float64float64bytes7float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64float64
" - ], - "text/plain": [ - "\n", - "NIGHT EXPID TILEID ... EFFTIME_DARK_GFA EFFTIME_BRIGHT_GFA EFFTIME_BACKUP_GFA\n", - "int32 int32 int32 ... float64 float64 float64 \n", - "----- ----- ------ ... ---------------- ------------------ ------------------" - ] - }, - "execution_count": 24, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "still_missing_mjd = np.where((daily_exposures_patched['NIGHT'] >= first_jura_night) & (daily_exposures_patched['EFFTIME_SPEC'] > 0) & (daily_exposures_patched['MJD'] < 50000))[0]\n", "daily_exposures_patched[still_missing_mjd]" @@ -1014,7 +400,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": null, "id": "76fd512d-ee77-4e0f-b6c1-3ba5eb5d77c0", "metadata": { "tags": [] @@ -1027,7 +413,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": null, "id": "7ccd960a-249f-4ea8-8e63-12ebc4aed7ec", "metadata": {}, "outputs": [], @@ -1041,7 +427,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": null, "id": "b36035cf-598f-4027-a9cd-a6fb0bb49d99", "metadata": {}, "outputs": [], @@ -1053,73 +439,10 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": null, "id": "86da04ea-06f1-4a8c-8b8e-eace0d0f286e", "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "
Table length=15328\n", - "
\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "
TILEIDLASTNIGHTEFFTIME_SPECDAILY_INDEXJURA_INDEX
int64int64float64int64int64
1202104061646.8415202
2202104071331.7460230
3202104091424.4479267
4202104101459.8511292
5202104121372.6527321
6202104171507.4611400
7202104291325.9736476
8202104301635.7748486
9202105021342.7780513
10202105031336.9800532
...............
83464202403131099.31434713833
83465202403131018.21434613832
8346620240313952.81435013838
83467202403131002.91435913847
83468202403131024.71435413839
83472202406071005.114814--
8347320240611578.514891--
83476202407121043.715173--
83477202407121012.915168--
8347820240712980.215180--
" - ], - "text/plain": [ - "\n", - "TILEID LASTNIGHT EFFTIME_SPEC DAILY_INDEX JURA_INDEX\n", - "int64 int64 float64 int64 int64 \n", - "------ --------- ------------ ----------- ----------\n", - " 1 20210406 1646.8 415 202\n", - " 2 20210407 1331.7 460 230\n", - " 3 20210409 1424.4 479 267\n", - " 4 20210410 1459.8 511 292\n", - " 5 20210412 1372.6 527 321\n", - " 6 20210417 1507.4 611 400\n", - " 7 20210429 1325.9 736 476\n", - " 8 20210430 1635.7 748 486\n", - " 9 20210502 1342.7 780 513\n", - " 10 20210503 1336.9 800 532\n", - " ... ... ... ... ...\n", - " 83464 20240313 1099.3 14347 13833\n", - " 83465 20240313 1018.2 14346 13832\n", - " 83466 20240313 952.8 14350 13838\n", - " 83467 20240313 1002.9 14359 13847\n", - " 83468 20240313 1024.7 14354 13839\n", - " 83472 20240607 1005.1 14814 --\n", - " 83473 20240611 578.5 14891 --\n", - " 83476 20240712 1043.7 15173 --\n", - " 83477 20240712 1012.9 15168 --\n", - " 83478 20240712 980.2 15180 --" - ] - }, - "execution_count": 28, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "j = join(daily_tiles_join, jura_tiles_join, join_type='outer', keys='TILEID')\n", "j" @@ -1127,7 +450,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": null, "id": "643b68a1-59b6-4030-a24a-04971f17b3c7", "metadata": {}, "outputs": [], @@ -1139,81 +462,19 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": null, "id": "070845fe-0ce6-4e1f-b7f6-da172c26da8a", "metadata": { "tags": [] }, - "outputs": [ - { - "data": { - "text/html": [ - "
Table length=15328\n", - "
\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "
TILEIDSURVEYPROGRAMFAPRGRMFAFLAVORNEXPEXPTIMETILERATILEDECEFFTIME_ETCEFFTIME_SPECEFFTIME_GFAGOALTIMEOBSSTATUSLRG_EFFTIME_DARKELG_EFFTIME_DARKBGS_EFFTIME_BRIGHTLYA_EFFTIME_DARKGOALTYPEMINTFRACLASTNIGHT
int64str7str6str16str19int64float64float64float64float64float64float64float64str8float64float64float64float64str7float64int64
70004unknown--unknownunknown43600.0116.020.70.03619.80.01000.0obsend3470.83619.83784.03056.6unknown0.920200219
70508unknown--unknownunknown61800.0133.412511.68180.0108.50.01000.0obsstart93.6108.595.750.6unknown0.920200225
70506unknown--unknownunknown3900.0133.412511.68180.061.60.01000.0obsstart53.661.654.933.7unknown0.920200225
70512unknown--unknownunknown73150.0132.8512.320.0389.80.01000.0obsstart351.9389.8364.7227.2unknown0.920200226
70514unknown--unknownunknown161680.0132.8512.320.0118.30.01000.0obsstart112.0118.3120.274.4unknown0.920200227
70502unknown--unknownunknown418415.0180.0-0.50.0358.20.01000.0obsstart317.9358.2325.0260.2unknown0.920200227
70513unknown--unknownunknown132220.0133.4211.650.03.70.01000.0obsstart3.43.73.52.5unknown0.920200229
70500unknown--unknownunknown147000.0119.050.00.01389.00.01000.0obsend1145.41389.01160.5770.4unknown0.920200303
70005unknown--unknownunknown1713500.0158.025.00.08463.10.01000.0obsend8088.58463.18858.69174.7unknown0.920200303
70003unknown--unknownunknown2821670.0214.7553.40.018263.60.01000.0obsend17933.318263.619393.317007.0unknown0.920200304
...............................................................
10051maindarkdarkmaindark11018.9350.63520.8621018.51052.01271.01000.0obsend1052.01025.31030.01159.2dark0.8520240811
2257maindarkdarkmaindark11030.0358.61614.5191015.01091.41139.81000.0obsend1091.41056.81094.01422.1dark0.8520240811
3815maindarkdarkmaindark11345.6347.36418.4121007.21127.61078.51000.0obsend1127.61127.21084.11069.0dark0.8520240811
1852maindarkdarkmaindark11351.9318.4711.6521006.31008.81114.61000.0obsend1008.8972.91008.91119.8dark0.8520240811
8071maindarkdarkmaindark11129.5334.9110.1011009.51017.71105.41000.0obsend1017.7984.01011.61179.8dark0.8520240811
2238maindarkdarkmaindark11259.9354.07618.2351009.41063.51128.41000.0obsend1063.51051.71060.11292.7dark0.8520240811
3623maindarkdarkmaindark1815.18.03715.235697.6709.8760.11000.0obsstart709.8697.2719.5714.3dark0.8520240811
41072mainbackupbackupmainbackup42439.7267.1820.51925.334.641.560.0obsstart48.859.349.16.0backup0.8520240811
22564mainbrightbrightmainbright1802.816.36911.416159.1200.0196.8180.0obsend175.9210.9200.0115.6bright0.8520240811
7771maindarkdarkmaindark22131.0272.36572.439969.4998.11003.11000.0obsend998.1956.41038.51178.9dark0.8520240811
" - ], - "text/plain": [ - "\n", - "TILEID SURVEY PROGRAM FAPRGRM ... LYA_EFFTIME_DARK GOALTYPE MINTFRAC LASTNIGHT\n", - "int64 str7 str6 str16 ... float64 str7 float64 int64 \n", - "------ ------- ------- ------- ... ---------------- -------- -------- ---------\n", - " 70004 unknown -- unknown ... 3056.6 unknown 0.9 20200219\n", - " 70508 unknown -- unknown ... 50.6 unknown 0.9 20200225\n", - " 70506 unknown -- unknown ... 33.7 unknown 0.9 20200225\n", - " 70512 unknown -- unknown ... 227.2 unknown 0.9 20200226\n", - " 70514 unknown -- unknown ... 74.4 unknown 0.9 20200227\n", - " 70502 unknown -- unknown ... 260.2 unknown 0.9 20200227\n", - " 70513 unknown -- unknown ... 2.5 unknown 0.9 20200229\n", - " 70500 unknown -- unknown ... 770.4 unknown 0.9 20200303\n", - " 70005 unknown -- unknown ... 9174.7 unknown 0.9 20200303\n", - " 70003 unknown -- unknown ... 17007.0 unknown 0.9 20200304\n", - " ... ... ... ... ... ... ... ... ...\n", - " 10051 main dark dark ... 1159.2 dark 0.85 20240811\n", - " 2257 main dark dark ... 1422.1 dark 0.85 20240811\n", - " 3815 main dark dark ... 1069.0 dark 0.85 20240811\n", - " 1852 main dark dark ... 1119.8 dark 0.85 20240811\n", - " 8071 main dark dark ... 1179.8 dark 0.85 20240811\n", - " 2238 main dark dark ... 1292.7 dark 0.85 20240811\n", - " 3623 main dark dark ... 714.3 dark 0.85 20240811\n", - " 41072 main backup backup ... 6.0 backup 0.85 20240811\n", - " 22564 main bright bright ... 115.6 bright 0.85 20240811\n", - " 7771 main dark dark ... 1178.9 dark 0.85 20240811" - ] - }, - "execution_count": 30, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "daily_tiles_patched = daily_tiles.copy()\n", "# for column in jura_tiles.colnames:\n", "# for column in ('TILEID', 'SURVEY', 'PROGRAM', 'FAPRGRM', 'FAFLAVOR', 'TILERA', 'TILEDEC', 'EFFTIME_ETC', 'EFFTIME_GFA', 'GOALTIME', 'GOALTYPE', 'MINTFRAC'):\n", "for column in ('PROGRAM', ):\n", " daily_tiles_patched[column][daily_tiles_index] = jura_tiles[column][jura_tiles_index]\n", + " daily_tiles_patched[column].mask[daily_tiles_index] = False\n", "daily_tiles_patched" ] }, @@ -1229,65 +490,12 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": null, "id": "ebf610ad-ca54-4545-b001-f32f37cd3c9e", "metadata": { "tags": [] }, - "outputs": [ - { - "data": { - "text/html": [ - "
Table length=16\n", - "
\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "\n", - "
TILEIDSURVEYPROGRAMFAPRGRMFAFLAVORNEXPEXPTIMETILERATILEDECEFFTIME_ETCEFFTIME_SPECEFFTIME_GFAGOALTIMEOBSSTATUSLRG_EFFTIME_DARKELG_EFFTIME_DARKBGS_EFFTIME_BRIGHTLYA_EFFTIME_DARKGOALTYPEMINTFRACLASTNIGHT
int64str7str6str16str19int64float64float64float64float64float64float64float64str8float64float64float64float64str7float64int64
80713sv1--m31sv1m3132700.210.1741.380.0758.6771.81000.0obsstart727.8758.6789.8645.0unknown0.920210110
80715sv1--m31sv1m3132700.110.1741.380.01906.81827.21000.0obsend1914.51906.82150.12216.6unknown0.920210115
80769unknown--dithfocusdithfocus7920.3111.6430.00.01.20.01000.0obsstart1.11.21.20.9unknown0.920210219
80816cmx--dithprecdithprec3540.299.066.00.014.145.21000.0obsstart11.414.111.66.8unknown0.920210223
80916unknown--dithfocusdithfocus4740.2160.050.00.063.668.81000.0obsstart59.763.666.567.5unknown0.920210422
82026unknown--dithprecdithprec1200.1251.250.40.073.159.41000.0obsstart67.573.172.764.4unknown0.920210423
82065unknown--dithfocusdithfocus1200.1220.247.80.024.827.91000.0obsstart22.424.824.525.4unknown0.920210423
82052unknown--dithfocusdithfocus1200.1190.049.50.030.117.31000.0obsstart25.430.126.114.9unknown0.920210423
81096sv2--darksv2dark11220.1180.045.00.01193.2973.81000.0obsend1111.71193.21234.41459.6dark0.920210429
82039unknown--dithprecdithprec3580.2279.050.00.0159.6131.61000.0obsstart149.0159.6158.6105.8unknown0.920210529
2704main--darkmaindark1821.0222.8974.905467.1524.1534.81000.0retired558.5524.1559.4559.7dark0.8520210627
2786main--darkmaindark1808.2240.3949.573251.3283.9260.51000.0retired273.4283.9289.1254.7dark0.8520210627
20307main--brightmainbright1448.3346.87430.79762.859.771.8180.0retired47.249.859.772.1bright0.8520210707
21273main--brightmainbright1534.4344.4552.172113.1132.8149.9180.0retired0.0133.5132.879.2bright0.8520210708
1825main--darkmaindark1770.2329.1261.365566.0547.0601.31000.0retired0.0547.0595.5597.2dark0.8520210708
82248cmx--posmappingcmxposmapping5938.9343.030.00.00.91.01000.0obsstart0.90.91.11.4unknown0.920210916
" - ], - "text/plain": [ - "\n", - "TILEID SURVEY PROGRAM FAPRGRM ... GOALTYPE MINTFRAC LASTNIGHT\n", - "int64 str7 str6 str16 ... str7 float64 int64 \n", - "------ ------- ------- ---------- ... -------- -------- ---------\n", - " 80713 sv1 -- m31 ... unknown 0.9 20210110\n", - " 80715 sv1 -- m31 ... unknown 0.9 20210115\n", - " 80769 unknown -- dithfocus ... unknown 0.9 20210219\n", - " 80816 cmx -- dithprec ... unknown 0.9 20210223\n", - " 80916 unknown -- dithfocus ... unknown 0.9 20210422\n", - " 82026 unknown -- dithprec ... unknown 0.9 20210423\n", - " 82065 unknown -- dithfocus ... unknown 0.9 20210423\n", - " 82052 unknown -- dithfocus ... unknown 0.9 20210423\n", - " 81096 sv2 -- dark ... dark 0.9 20210429\n", - " 82039 unknown -- dithprec ... unknown 0.9 20210529\n", - " 2704 main -- dark ... dark 0.85 20210627\n", - " 2786 main -- dark ... dark 0.85 20210627\n", - " 20307 main -- bright ... bright 0.85 20210707\n", - " 21273 main -- bright ... bright 0.85 20210708\n", - " 1825 main -- dark ... dark 0.85 20210708\n", - " 82248 cmx -- posmapping ... unknown 0.9 20210916" - ] - }, - "execution_count": 31, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "missing_program = np.where((daily_tiles_patched['LASTNIGHT'] >= first_jura_night) & (daily_tiles_patched['EFFTIME_SPEC'] > 0) & (daily_tiles_patched['PROGRAM'].mask))[0]\n", "daily_tiles_patched[missing_program]" @@ -1303,7 +511,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": null, "id": "ac5fdfb7-4635-4e5e-ba2d-b77dd9603554", "metadata": { "tags": [] @@ -1315,7 +523,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": null, "id": "384e6030-fcc1-453e-b990-a34688f12494", "metadata": { "tags": [] @@ -1327,7 +535,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": null, "id": "26d7bad1-f89f-4cde-bfa1-a0cbcabcf866", "metadata": { "tags": [] @@ -1339,31 +547,19 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": null, "id": "d06fcfd7-c5d9-4d9c-9989-eb313c70bc07", "metadata": { "tags": [] }, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "Filename: (No file associated with this HDUList)\n", - "No. Name Ver Type Cards Dimensions Format\n", - " 0 PRIMARY 1 PrimaryHDU 4 () \n", - " 1 EXPOSURES 1 BinTableHDU 111 23706R x 51C ['J', 'J', 'J', 'D', 'D', 'D', '7A', '6A', '19A', '19A', 'D', 'D', 'D', '7A', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D', 'D'] \n", - " 2 FRAMES 1 BinTableHDU 63 697837R x 27C ['J', 'J', 'J', 'E', 'D', 'D', '2A', 'D', 'D', 'D', 'D', '7A', '7A', '19A', 'D', 'D', 'D', 'D', '19A', 'E', 'E', 'D', 'D', 'D', 'D', 'D', 'D'] \n" - ] - } - ], + "outputs": [], "source": [ "daily_exposures_fits.info()" ] }, { "cell_type": "code", - "execution_count": 36, + "execution_count": null, "id": "d4e5751a-895b-4ca7-8c44-994a4d7d7524", "metadata": { "tags": []