import logging
from pathlib import Path
from matplotlib import rc
from IPython.display import display, HTML
from pySHOC import shocCampaign, shocHDU
# setup logging
rootlog = logging.getLogger()
rootlog.setLevel(logging.INFO)
# disable line wrapping (so tables display nicely)
display(HTML("<style>div.output_area pre {white-space: pre;}</style>"))
# set the default colourmap
rc('image', cmap='cmr.dusk')
# Load data
root_folder = Path('/media/Oceanus/UCT/Observing/data/sources/J1928-5001')
fig_folder = Path('/home/hannes/Documents/papers/dev/J1928/figures')
rc('savefig', directory=fig_folder)
run = shocCampaign.load(root_folder / 'SHOC/raw')
run
INFO:core.shocCampaign:Loaded 50 files
shocCampaign(size 50): [SHA_20150715.0002 | 20130616.0002 | 20130616.0030 | 20130616.0031 | 20130616.0032 | 20130617.0001 | 20130617.0030 | 20130617.0031 | 20130617.0032 | 20130618.0030 | 20130618.0031 | 20130618.0104 | 20130618.0105 | 202130615.0002 | 202130615.0030 | 202130615.0031 | 202130615.0032 | 202130615.0101 | SHA_20150606.0008 | SHA_20150606.0300 | SHA_20150607.0003 | SHA_20150607.0010 | SHA_20150607.0011 | SHA_20150607.0012 | SHA_20150715.0051 | SHA_20150715.0200 | SHA_20150904.0002 | SHA_20150904.0012 | SHA_20150904.0022 | SHA_20150904.0201 | SHA_20150904.0202 | SHA_20150904.0203 | SHA_20150904.0204 | SHA_20150905.0101 | SHA_20160706.0004 | SHA_20160706.0007 | SHA_20160707.0004 | SHA_20160707.0030 | SHA_20160707.0031 | SHA_20160710.0003 | SHA_20160710.0005 | SHA_20160711.0001 | SHA_20160712.0105 | SHA_20160712.0109 | SHA_20160712.0114 | SHA_20160712.0115 | SHA_20160712.0116 | SHA_20160712.0117 | SHA_20171002.0010 | SHA_20171002.0011]
# Some of the frames are labelled incorrectly.
# OBSTYPE discovery + grouping
g = run.guess_obstype()
tables = g.pprint();
# notice `shocHDU.guess_obstype` identifies frames correctly from the
# distribution of pixel values, despite incorrect header info!
INFO:table.Table:Suppressing totals line since table has only a single row of data.
⎪ shocObsGroups ⎪ ⎪instrument = SHOC 1 ⎪filters.B = ⎪ ⎪ ⎪f…⎪ ⎪ readout ⎪ timing ⎪ ⎪# ⎪ filename ⎪ tel ⎪ target ⎪obstype ⎪A ⎪ n ⎪ ishape ⎪ bin ⎪γₚᵣₑ ⎪ mode ⎪ t0 ⎪ tExp ⎪ duration ⎪ ⎪0 ⎪20130616.0030 ⎪None ⎪None ⎪None ⎪∅ ⎪ 35000⎪(128, 128) ⎪8x8 ⎪ 2.4⎪3 MHz EM: 50 ⎪2013-06-16 21:45:55.9 ⎪ 0.1 ⎪ 01ʰ02ᵐ16.6ˢ⎪ ⎫ ⎪1 ⎪20130616.0031 ⎪None ⎪None ⎪None ⎪∅ ⎪ 35000⎪(128, 128) ⎪8x8 ⎪ 2.4⎪3 MHz EM: 50 ⎪2013-06-16 22:48:41.9 ⎪ 0.1 ⎪ 01ʰ02ᵐ16.6ˢ⎪ ⎪ ⎪2 ⎪20130617.0030 ⎪None ⎪None ⎪None ⎪∅ ⎪ 35000⎪(128, 128) ⎪8x8 ⎪ 2.4⎪3 MHz EM: 50 ⎪2013-06-17 21:49:58.9 ⎪ 0.1 ⎪ 01ʰ02ᵐ16.6ˢ⎪ ⎪ ⎪3 ⎪20130617.0031 ⎪None ⎪None ⎪None ⎪∅ ⎪ 35000⎪(128, 128) ⎪8x8 ⎪ 2.4⎪3 MHz EM: 50 ⎪2013-06-17 22:52:57.9 ⎪ 0.1 ⎪ 01ʰ02ᵐ16.6ˢ⎪ ⎪ ⎪4 ⎪20130618.0030 ⎪None ⎪None ⎪None ⎪∅ ⎪ 35000⎪(128, 128) ⎪8x8 ⎪ 2.4⎪3 MHz EM: 125 ⎪2013-06-18 22:41:04.9 ⎪ 0.1 ⎪ 01ʰ02ᵐ16.6ˢ⎪ ⎪ ⎪5 ⎪20130618.0031 ⎪None ⎪None ⎪None ⎪∅ ⎪ 22999⎪(128, 128) ⎪8x8 ⎪ 2.4⎪3 MHz EM: 125 ⎪2013-06-18 23:43:58.9 ⎪ 0.1 ⎪ 00ʰ40ᵐ55.4ˢ⎪ ⎪ ⎪6 ⎪202130615.0030 ⎪None ⎪None ⎪None ⎪∅ ⎪ 20000⎪(128, 128) ⎪8x8 ⎪ 2.4⎪1 MHz EM: 50 ⎪2013-06-15 23:15:00.8 ⎪ 0.14862 ⎪ 00ʰ51ᵐ47.6ˢ⎪ ⎪ ⎪7 ⎪202130615.0031 ⎪None ⎪None ⎪None ⎪∅ ⎪ 20000⎪(128, 128) ⎪8x8 ⎪ 2.4⎪1 MHz EM: 50 ⎪2013-06-16 00:07:07.8 ⎪ 0.14862 ⎪ 00ʰ51ᵐ47.6ˢ⎪ ⎪ ⎪8 ⎪202130615.0032 ⎪None ⎪None ⎪None ⎪∅ ⎪ 10000⎪(128, 128) ⎪8x8 ⎪ 2.4⎪1 MHz EM: 50 ⎪2013-06-16 01:01:08.8 ⎪ 0.14862 ⎪ 00ʰ25ᵐ53.8ˢ⎪ ⎪ ⎪9 ⎪SHA_20150606.0300 ⎪74in ⎪CTCVJ1928-5001 ⎪object ⎪∅ ⎪ 4824⎪(128, 128) ⎪8x8 ⎪ 1.0⎪3 MHz CON ⎪2015-06-07 01:25:00.0* ⎪ 0.49324*⎪ 00ʰ40ᵐ12.0ˢ⎪ ⎬ object ⎪10 ⎪SHA_20150715.0200 ⎪74in ⎪CXOUJ1723-3734 ⎪object ⎪∅ ⎪ 3584⎪(128, 128) ⎪8x8 ⎪ 1.0⎪1 MHz CON ⎪2015-07-16 01:43:00.0* ⎪ 0.99324*⎪ 00ʰ59ᵐ44.0ˢ⎪ ⎪ ⎪11 ⎪SHA_20150904.0201 ⎪74in ⎪A 48 ⎪object ⎪I ⎪ 7201⎪(128, 128) ⎪8x8 ⎪ 1.0⎪1 MHz CON ⎪2015-09-04 19:35:00.0* ⎪ 0.99324*⎪ 02ʰ00ᵐ01.0ˢ⎪ ⎪ ⎪12 ⎪SHA_20150904.0202 ⎪74in ⎪A 48 ⎪object ⎪∅ ⎪ 9001⎪(128, 128) ⎪8x8 ⎪ 1.0⎪1 MHz CON ⎪2015-09-04 22:40:00.0* ⎪ 0.99324*⎪ 02ʰ30ᵐ01.0ˢ⎪ ⎪ ⎪13 ⎪SHA_20150905.0101 ⎪74in ⎪CTCV J1928-5001 ⎪object ⎪∅ ⎪ 12600⎪(128, 128) ⎪8x8 ⎪ 1.0⎪1 MHz CON ⎪2015-09-05 17:43:00.0* ⎪ 0.99324*⎪ 03ʰ30ᵐ00.0ˢ⎪ ⎪ ⎪14 ⎪SHA_20160706.0007 ⎪74in ⎪ ⎪flat ⎪∅ ⎪ 18253⎪(85, 85) ⎪12x12 ⎪ 4.9⎪1 MHz EM: 50 ⎪2016-07-06 23:23:07.3 ⎪ 0.5 ⎪ 02ʰ34ᵐ09.9ˢ⎪ ⎪ ⎪15 ⎪SHA_20160707.0030 ⎪74in ⎪ ⎪object ⎪∅ ⎪ 4301⎪(85, 85) ⎪12x12 ⎪ 4.9⎪1 MHz EM: 50 ⎪2016-07-07 22:18:54.3 ⎪ 0.5 ⎪ 00ʰ36ᵐ19.6ˢ⎪ ⎪ ⎪16 ⎪SHA_20160707.0031 ⎪74in ⎪ ⎪object ⎪∅ ⎪ 28000⎪(85, 85) ⎪12x12 ⎪ 4.9⎪1 MHz EM: 50 ⎪2016-07-07 22:55:20.6 ⎪ 0.25 ⎪ 01ʰ59ᵐ49.3ˢ⎪ ⎪ ⎪17 ⎪SHA_20160711.0001 ⎪74in ⎪ ⎪object ⎪∅ ⎪ 37505⎪(128, 128) ⎪8x8 ⎪ 4.9⎪1 MHz EM: 65 ⎪2016-07-11 22:51:49.9 ⎪ 0.25 ⎪ 02ʰ40ᵐ29.8ˢ⎪ ⎪ ⎪18 ⎪SHA_20171002.0010 ⎪40in ⎪J1928 ⎪object ⎪∅ ⎪ 670⎪(128, 128) ⎪8x8 ⎪ 2.4⎪1 MHz CON ⎪2017-10-02 18:35:37.7 ⎪ 0.5 ⎪ 00ʰ05ᵐ39.5ˢ⎪ ⎪ ⎪19 ⎪SHA_20171002.0011 ⎪40in ⎪J1928 ⎪object ⎪∅ ⎪ 12498⎪(128, 128) ⎪8x8 ⎪ 2.4⎪1 MHz CON ⎪2017-10-02 18:59:43.7 ⎪ 0.5 ⎪ 01ʰ45ᵐ33.5ˢ⎪ ⎭ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ 386436⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ 27ʰ23ᵐ46.9ˢ⎪ ⎪0 ⎪SHA_20150715.0002 ⎪74in ⎪SKYFLAT ⎪flat ⎪∅ ⎪ 15⎪(128, 128) ⎪8x8 ⎪ 1.0⎪1 MHz CON ⎪2015-07-15 16:07:31.7 ⎪ 0.14642⎪ 00ʰ00ᵐ02.3ˢ⎪ ⎫ ⎪1 ⎪20130616.0002 ⎪None ⎪None ⎪None ⎪∅ ⎪ 50⎪(128, 128) ⎪8x8 ⎪ 2.4⎪1 MHz CON ⎪2013-06-16 16:02:16.8 ⎪ 0.14642⎪ 00ʰ00ᵐ07.7ˢ⎪ ⎪ ⎪2 ⎪20130617.0001 ⎪None ⎪None ⎪None ⎪∅ ⎪ 100⎪(128, 128) ⎪8x8 ⎪ 2.4⎪1 MHz CON ⎪2013-06-17 16:02:29.8 ⎪ 0.14642⎪ 00ʰ00ᵐ15.3ˢ⎪ ⎪ ⎪3 ⎪202130615.0002 ⎪None ⎪None ⎪None ⎪∅ ⎪ 50⎪(128, 128) ⎪8x8 ⎪ 2.4⎪1 MHz CON ⎪2013-06-15 16:05:53.8 ⎪ 0.14642⎪ 00ʰ00ᵐ07.7ˢ⎪ ⎪ ⎪4 ⎪SHA_20150606.0008 ⎪74in ⎪ ⎪ ⎪∅ ⎪ 10⎪(128, 128) ⎪8x8 ⎪ 1.0⎪3 MHz CON ⎪2015-06-06 16:20:30.4 ⎪ 10.0⎪ 00ʰ01ᵐ40.1ˢ⎪ ⎪ ⎪5 ⎪SHA_20150607.0003 ⎪74in ⎪ ⎪flat ⎪∅ ⎪ 30⎪(128, 128) ⎪8x8 ⎪ 1.0⎪3 MHz CON ⎪2015-06-07 15:57:57.9 ⎪ 0.0558⎪ 00ʰ00ᵐ01.9ˢ⎪ ⎬ flat ⎪6 ⎪SHA_20150904.0012 ⎪74in ⎪SKYFLAT ⎪flat ⎪I ⎪ 15⎪(128, 128) ⎪8x8 ⎪ 1.0⎪1 MHz CON ⎪2015-09-04 16:34:43.2 ⎪ 0.14642⎪ 00ʰ00ᵐ02.3ˢ⎪ ⎪ ⎪7 ⎪SHA_20150904.0022 ⎪74in ⎪SKYFLAT ⎪flat ⎪∅ ⎪ 15⎪(128, 128) ⎪8x8 ⎪ 1.0⎪1 MHz CON ⎪2015-09-04 16:39:23.0 ⎪ 0.14642⎪ 00ʰ00ᵐ02.3ˢ⎪ ⎪ ⎪8 ⎪SHA_20160706.0004 ⎪74in ⎪ ⎪flat ⎪∅ ⎪ 405⎪(85, 85) ⎪12x12 ⎪ 2.4⎪1 MHz CON ⎪2016-07-06 16:14:40.9 ⎪ 0.3⎪ 00ʰ02ᵐ04.2ˢ⎪ ⎪ ⎪9 ⎪SHA_20160707.0004 ⎪74in ⎪ ⎪flat ⎪∅ ⎪ 633⎪(85, 85) ⎪12x12 ⎪ 1.0⎪1 MHz CON ⎪2016-07-07 16:11:08.0 ⎪ 0.11847⎪ 00ʰ01ᵐ19.3ˢ⎪ ⎪ ⎪10 ⎪SHA_20160710.0003 ⎪74in ⎪ ⎪flat ⎪∅ ⎪ 500⎪(128, 128) ⎪8x8 ⎪ 1.0⎪1 MHz CON ⎪2016-07-10 16:06:47.9 ⎪ 0.14642⎪ 00ʰ01ᵐ16.6ˢ⎪ ⎪ ⎪11 ⎪SHA_20160710.0005 ⎪74in ⎪ ⎪flat ⎪∅ ⎪ 500⎪(85, 85) ⎪12x12 ⎪ 1.0⎪1 MHz CON ⎪2016-07-10 16:10:53.2 ⎪ 0.11847⎪ 00ʰ01ᵐ02.6ˢ⎪ ⎭ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ 2323⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ 00ʰ08ᵐ02.2ˢ⎪ ⎪0 ⎪20130618.0104 ⎪None ⎪None ⎪None ⎪∅ ⎪ 100⎪(128, 128) ⎪8x8 ⎪ 2.4⎪3 MHz EM: 50 ⎪2013-06-19 02:13:32.9 ⎪ 0.0566⎪ 00ʰ00ᵐ06.3ˢ⎪ ⎫ ⎪1 ⎪20130618.0105 ⎪None ⎪None ⎪None ⎪∅ ⎪ 100⎪(128, 128) ⎪8x8 ⎪ 2.4⎪3 MHz EM: 125 ⎪2013-06-19 02:14:01.9 ⎪ 0.0566⎪ 00ʰ00ᵐ06.3ˢ⎪ ⎪ ⎪2 ⎪202130615.0101 ⎪None ⎪None ⎪None ⎪∅ ⎪ 50⎪(128, 128) ⎪8x8 ⎪ 2.4⎪1 MHz EM: 50 ⎪2013-06-16 04:29:56.8 ⎪ 0.14862⎪ 00ʰ00ᵐ07.8ˢ⎪ ⎪ ⎪3 ⎪SHA_20150607.0010 ⎪74in ⎪ ⎪bias ⎪∅ ⎪ 30⎪(128, 128) ⎪8x8 ⎪ 1.0⎪3 MHz CON ⎪2015-06-07 16:01:12.3 ⎪ 0.0558⎪ 00ʰ00ᵐ01.9ˢ⎪ ⎪ ⎪4 ⎪SHA_20150607.0011 ⎪74in ⎪ ⎪bias ⎪∅ ⎪ 30⎪(128, 128) ⎪8x8 ⎪ 1.0⎪3 MHz CON ⎪2015-06-07 16:01:20.7 ⎪ 0.0558⎪ 00ʰ00ᵐ01.9ˢ⎪ ⎪ ⎪5 ⎪SHA_20150607.0012 ⎪74in ⎪ ⎪bias ⎪∅ ⎪ 30⎪(128, 128) ⎪8x8 ⎪ 1.0⎪3 MHz CON ⎪2015-06-07 16:01:37.8 ⎪ 0.0558⎪ 00ʰ00ᵐ01.9ˢ⎪ ⎪ ⎪6 ⎪SHA_20150715.0051 ⎪74in ⎪BIAS ⎪bias ⎪∅ ⎪ 15⎪(128, 128) ⎪8x8 ⎪ 1.0⎪1 MHz CON ⎪2015-07-16 03:00:01.7 ⎪ 0.14642⎪ 00ʰ00ᵐ02.3ˢ⎪ ⎬ dark ⎪7 ⎪SHA_20150904.0002 ⎪74in ⎪BIAS ⎪bias ⎪I ⎪ 15⎪(128, 128) ⎪8x8 ⎪ 1.0⎪1 MHz CON ⎪2015-09-04 16:01:18.0 ⎪ 0.14642⎪ 00ʰ00ᵐ02.3ˢ⎪ ⎪ ⎪8 ⎪SHA_20160712.0105 ⎪74in ⎪ ⎪dark ⎪∅ ⎪ 1000⎪(128, 128) ⎪8x8 ⎪ 2.4⎪1 MHz CON ⎪2016-07-13 05:33:59.1 ⎪ 0.14642⎪ 00ʰ02ᵐ33.2ˢ⎪ ⎪ ⎪9 ⎪SHA_20160712.0109 ⎪74in ⎪ ⎪dark ⎪∅ ⎪ 1000⎪(128, 128) ⎪8x8 ⎪ 4.9⎪1 MHz EM: 65 ⎪2016-07-13 05:46:44.8 ⎪ 0.14862⎪ 00ʰ02ᵐ35.4ˢ⎪ ⎪ ⎪10 ⎪SHA_20160712.0114 ⎪74in ⎪ ⎪dark ⎪∅ ⎪ 1000⎪(102, 102) ⎪10x10 ⎪ 4.9⎪1 MHz EM: 50 ⎪2016-07-13 06:00:42.5 ⎪ 0.12067⎪ 00ʰ02ᵐ07.4ˢ⎪ ⎪ ⎪11 ⎪SHA_20160712.0115 ⎪74in ⎪ ⎪dark ⎪∅ ⎪ 1000⎪(85, 85) ⎪12x12 ⎪ 1.0⎪1 MHz CON ⎪2016-07-13 06:04:13.5 ⎪ 0.1002⎪ 00ʰ01ᵐ47.0ˢ⎪ ⎪ ⎪12 ⎪SHA_20160712.0116 ⎪74in ⎪ ⎪dark ⎪∅ ⎪ 1000⎪(85, 85) ⎪12x12 ⎪ 2.4⎪1 MHz CON ⎪2016-07-13 06:06:08.4 ⎪ 0.1002⎪ 00ʰ01ᵐ47.0ˢ⎪ ⎪ ⎪13 ⎪SHA_20160712.0117 ⎪74in ⎪ ⎪dark ⎪∅ ⎪ 1000⎪(85, 85) ⎪12x12 ⎪ 4.9⎪1 MHz EM: 50 ⎪2016-07-13 06:08:51.6 ⎪ 0.10242⎪ 00ʰ01ᵐ49.2ˢ⎪ ⎭ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ 6370⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ 00ʰ13ᵐ09.8ˢ⎪ ⎪0 ⎪20130616.0032 ⎪None ⎪None ⎪None ⎪∅ ⎪ 1⎪(128, 128) ⎪8x8 ⎪ 2.4⎪3 MHz EM: 5 ⎪2013-06-17 00:08:16.9 ⎪ 0.1 ⎪ 00ʰ00ᵐ00.1ˢ⎪ ⎫ ⎪1 ⎪20130617.0032 ⎪None ⎪None ⎪None ⎪∅ ⎪ 1⎪(128, 128) ⎪8x8 ⎪ 2.4⎪3 MHz CON ⎪2013-06-18 00:04:42.9 ⎪ 0.1 ⎪ 00ʰ00ᵐ00.1ˢ⎪ ⎬ bad ⎪2 ⎪SHA_20150904.0203 ⎪74in ⎪A 48 ⎪object ⎪∅ ⎪ 1⎪(128, 128) ⎪8x8 ⎪ 1.0⎪1 MHz CON ⎪2015-09-04 21:40:00.0* ⎪ 0.99324*⎪ 00ʰ00ᵐ01.0ˢ⎪ ⎪ ⎪3 ⎪SHA_20150904.0204 ⎪74in ⎪A 48 ⎪object ⎪∅ ⎪ 1⎪(128, 128) ⎪8x8 ⎪ 1.0⎪1 MHz CON ⎪2015-09-04 21:40:00.0* ⎪ 0.99324*⎪ 00ʰ00ᵐ01.0ˢ⎪ ⎭ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ 4⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ 00ʰ00ᵐ02.2ˢ⎪ * t0: timing.trigger.is_gps * tExp: timing.trigger.is_gps_loop
# Apply the guessed observation type labels (flat / dark / bad)
# Note this updates the attributes of the shocHDU's, but leaves the fits
# headers untouched
for obstype, r in g.items():
# set attributes on HDU objects - not yet in header
r.attrs.set(obstype=obstype)
# remove bad files
g.pop('bad', None)
# set the target name
run_src = g['object']
run_src.attrs.set(target='CTCV J1928-5001')
# add telescope info for old data. We will need this later
for obstype in ['object', 'flat']:
run = g[obstype]
is74in = np.equal(run.attrs('telescope'), None)
run[is74in].attrs.set(telescope='74in')
# print target observations
run_src.sort_by('date').pprint(); # todo: list by date; export to latex
⎪ shocCampaign ⎪ ⎪camera = SHOC 1 ⎪target = CTCV J1928-5001 ⎪obstype = object ⎪B = ∅ ⎪ ⎪ ⎪f…⎪ ⎪ readout ⎪ timing ⎪ ⎪# ⎪ filename ⎪ tel ⎪A ⎪ n ⎪ ishape ⎪ bin ⎪γₚᵣₑ ⎪ mode ⎪ t0 ⎪ tExp ⎪ duration ⎪ ⎪0 ⎪202130615.0030 ⎪74in ⎪∅ ⎪ 20000⎪(128, 128) ⎪8x8 ⎪ 2.4⎪1 MHz EM: 50 ⎪2013-06-15 23:15:00.8 ⎪ 0.14862 ⎪ 00ʰ51ᵐ47.6ˢ⎪ ⎪1 ⎪20130616.0030 ⎪74in ⎪∅ ⎪ 35000⎪(128, 128) ⎪8x8 ⎪ 2.4⎪3 MHz EM: 50 ⎪2013-06-16 21:45:55.9 ⎪ 0.1 ⎪ 01ʰ02ᵐ16.6ˢ⎪ ⎪2 ⎪20130616.0031 ⎪74in ⎪∅ ⎪ 35000⎪(128, 128) ⎪8x8 ⎪ 2.4⎪3 MHz EM: 50 ⎪2013-06-16 22:48:41.9 ⎪ 0.1 ⎪ 01ʰ02ᵐ16.6ˢ⎪ ⎪3 ⎪202130615.0031 ⎪74in ⎪∅ ⎪ 20000⎪(128, 128) ⎪8x8 ⎪ 2.4⎪1 MHz EM: 50 ⎪2013-06-16 00:07:07.8 ⎪ 0.14862 ⎪ 00ʰ51ᵐ47.6ˢ⎪ ⎪4 ⎪202130615.0032 ⎪74in ⎪∅ ⎪ 10000⎪(128, 128) ⎪8x8 ⎪ 2.4⎪1 MHz EM: 50 ⎪2013-06-16 01:01:08.8 ⎪ 0.14862 ⎪ 00ʰ25ᵐ53.8ˢ⎪ ⎪5 ⎪20130617.0030 ⎪74in ⎪∅ ⎪ 35000⎪(128, 128) ⎪8x8 ⎪ 2.4⎪3 MHz EM: 50 ⎪2013-06-17 21:49:58.9 ⎪ 0.1 ⎪ 01ʰ02ᵐ16.6ˢ⎪ ⎪6 ⎪20130617.0031 ⎪74in ⎪∅ ⎪ 35000⎪(128, 128) ⎪8x8 ⎪ 2.4⎪3 MHz EM: 50 ⎪2013-06-17 22:52:57.9 ⎪ 0.1 ⎪ 01ʰ02ᵐ16.6ˢ⎪ ⎪7 ⎪20130618.0030 ⎪74in ⎪∅ ⎪ 35000⎪(128, 128) ⎪8x8 ⎪ 2.4⎪3 MHz EM: 125 ⎪2013-06-18 22:41:04.9 ⎪ 0.1 ⎪ 01ʰ02ᵐ16.6ˢ⎪ ⎪8 ⎪20130618.0031 ⎪74in ⎪∅ ⎪ 22999⎪(128, 128) ⎪8x8 ⎪ 2.4⎪3 MHz EM: 125 ⎪2013-06-18 23:43:58.9 ⎪ 0.1 ⎪ 00ʰ40ᵐ55.4ˢ⎪ ⎪9 ⎪SHA_20150606.0300 ⎪74in ⎪∅ ⎪ 4824⎪(128, 128) ⎪8x8 ⎪ 1.0⎪3 MHz CON ⎪2015-06-07 01:25:00.0* ⎪ 0.49324*⎪ 00ʰ40ᵐ12.0ˢ⎪ ⎪10 ⎪SHA_20150715.0200 ⎪74in ⎪∅ ⎪ 3584⎪(128, 128) ⎪8x8 ⎪ 1.0⎪1 MHz CON ⎪2015-07-16 01:43:00.0* ⎪ 0.99324*⎪ 00ʰ59ᵐ44.0ˢ⎪ ⎪11 ⎪SHA_20150904.0201 ⎪74in ⎪I ⎪ 7201⎪(128, 128) ⎪8x8 ⎪ 1.0⎪1 MHz CON ⎪2015-09-04 19:35:00.0* ⎪ 0.99324*⎪ 02ʰ00ᵐ01.0ˢ⎪ ⎪12 ⎪SHA_20150904.0202 ⎪74in ⎪∅ ⎪ 9001⎪(128, 128) ⎪8x8 ⎪ 1.0⎪1 MHz CON ⎪2015-09-04 22:40:00.0* ⎪ 0.99324*⎪ 02ʰ30ᵐ01.0ˢ⎪ ⎪13 ⎪SHA_20150905.0101 ⎪74in ⎪∅ ⎪ 12600⎪(128, 128) ⎪8x8 ⎪ 1.0⎪1 MHz CON ⎪2015-09-05 17:43:00.0* ⎪ 0.99324*⎪ 03ʰ30ᵐ00.0ˢ⎪ ⎪14 ⎪SHA_20160706.0007 ⎪74in ⎪∅ ⎪ 18253⎪(85, 85) ⎪12x12 ⎪ 4.9⎪1 MHz EM: 50 ⎪2016-07-06 23:23:07.3 ⎪ 0.5 ⎪ 02ʰ34ᵐ09.9ˢ⎪ ⎪15 ⎪SHA_20160707.0030 ⎪74in ⎪∅ ⎪ 4301⎪(85, 85) ⎪12x12 ⎪ 4.9⎪1 MHz EM: 50 ⎪2016-07-07 22:18:54.3 ⎪ 0.5 ⎪ 00ʰ36ᵐ19.6ˢ⎪ ⎪16 ⎪SHA_20160707.0031 ⎪74in ⎪∅ ⎪ 28000⎪(85, 85) ⎪12x12 ⎪ 4.9⎪1 MHz EM: 50 ⎪2016-07-07 22:55:20.6 ⎪ 0.25 ⎪ 01ʰ59ᵐ49.3ˢ⎪ ⎪17 ⎪SHA_20160711.0001 ⎪74in ⎪∅ ⎪ 37505⎪(128, 128) ⎪8x8 ⎪ 4.9⎪1 MHz EM: 65 ⎪2016-07-11 22:51:49.9 ⎪ 0.25 ⎪ 02ʰ40ᵐ29.8ˢ⎪ ⎪18 ⎪SHA_20171002.0010 ⎪40in ⎪∅ ⎪ 670⎪(128, 128) ⎪8x8 ⎪ 2.4⎪1 MHz CON ⎪2017-10-02 18:35:37.7 ⎪ 0.5 ⎪ 00ʰ05ᵐ39.5ˢ⎪ ⎪19 ⎪SHA_20171002.0011 ⎪40in ⎪∅ ⎪ 12498⎪(128, 128) ⎪8x8 ⎪ 2.4⎪1 MHz CON ⎪2017-10-02 18:59:43.7 ⎪ 0.5 ⎪ 01ʰ45ᵐ33.5ˢ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ 386436⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ 27ʰ23ᵐ46.9ˢ⎪ * t0: timing.trigger.is_gps * tExp: timing.trigger.is_gps_loop
# Science images thumbnail grid
fig, axes, _ = run_src.sort_by('date').thumbnails()
fig.set_size_inches(9, 7)
fig
# Match calibration frames
from pySHOC import MATCH_DARKS, MATCH_FLATS
# DEBIAS
# need to debias flats & science observations
obs = g['flat'].join(g['object'])
gobs, gdark = obs.match(g['dark'], *MATCH_DARKS, keep_nulls=False, report=True)
# compute master darks
mbias = gdark.merge_combine(np.median)
# Notice that i have previously placed all the correct dark and flat
# observation files in the one folder. This is actually not necessary. If
# you already have a folder where you store all your calibration data, you can
# read all those files and select the correct ones with a few lines of code
# similar to what was done above.
# For example:
# darks = shocCampaign.load_dir('/media/Oceanus/UCT/Observing/data/darks')
#_ = run_src.match(darks, *MATCH_DARKS, keep_nulls=False, report=True)
/usr/local/lib/python3.6/dist-packages/numpy/core/_asarray.py:83: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray return array(a, dtype, copy=False, order=order)
⎪Matched Observations ⎪ ⎪exact: ('instrument', 'binning', 'readout.preAmpGain', 'readout.outAmp.mode', 'readout.frq') ⎪ ⎪closest: ('readout.outAmp.emGain', 'timing.exp') ⎪ ⎪B = ∅ ⎪ ⎪ ⎪f…⎪ ⎪ readout ⎪ timing ⎪ ⎪ filename ⎪ tel ⎪ target ⎪obstype ⎪A ⎪ n ⎪ ishape ⎪ mode ⎪ t0 ⎪ duration ⎪ ⎪ ⎪ ⎪group 0: 8x8; 1.0; CON; 3; 0; 0.0558 ⎪ ⎪SHA_20150607.0010 ⎪74in ⎪ ⎪dark ⎪∅ ⎪ 30⎪(128, 128) ⎪3 MHz CON ⎪2015-06-07 16:01:12.3 ⎪ 00ʰ00ᵐ01.9ˢ⎪ ⎪SHA_20150607.0011 ⎪74in ⎪ ⎪dark ⎪∅ ⎪ 30⎪(128, 128) ⎪3 MHz CON ⎪2015-06-07 16:01:20.7 ⎪ 00ʰ00ᵐ01.9ˢ⎪ ⎪SHA_20150607.0012 ⎪74in ⎪ ⎪dark ⎪∅ ⎪ 30⎪(128, 128) ⎪3 MHz CON ⎪2015-06-07 16:01:37.8 ⎪ 00ʰ00ᵐ01.9ˢ⎪ ⎪SHA_20150606.0008 ⎪74in ⎪ ⎪flat ⎪∅ ⎪ 10⎪(128, 128) ⎪3 MHz CON ⎪2015-06-06 16:20:30.4 ⎪ 00ʰ01ᵐ40.1ˢ⎪ ⎪SHA_20150607.0003 ⎪74in ⎪ ⎪flat ⎪∅ ⎪ 30⎪(128, 128) ⎪3 MHz CON ⎪2015-06-07 15:57:57.9 ⎪ 00ʰ00ᵐ01.9ˢ⎪ ⎪SHA_20150606.0300 ⎪74in ⎪CTCV J1928-5001 ⎪object ⎪∅ ⎪ 4824⎪(128, 128) ⎪3 MHz CON ⎪2015-06-07 01:25:00.0* ⎪ 00ʰ40ᵐ12.0ˢ⎪ ⎪ ⎪ ⎪group 1: 8x8; 2.4; CON; 1; 0; 0.14642 ⎪ ⎪SHA_20160712.0105 ⎪74in ⎪ ⎪dark ⎪∅ ⎪ 1000⎪(128, 128) ⎪1 MHz CON ⎪2016-07-13 05:33:59.1 ⎪ 00ʰ02ᵐ33.2ˢ⎪ ⎪20130616.0002 ⎪74in ⎪None ⎪flat ⎪∅ ⎪ 50⎪(128, 128) ⎪1 MHz CON ⎪2013-06-16 16:02:16.8 ⎪ 00ʰ00ᵐ07.7ˢ⎪ ⎪20130617.0001 ⎪74in ⎪None ⎪flat ⎪∅ ⎪ 100⎪(128, 128) ⎪1 MHz CON ⎪2013-06-17 16:02:29.8 ⎪ 00ʰ00ᵐ15.3ˢ⎪ ⎪202130615.0002 ⎪74in ⎪None ⎪flat ⎪∅ ⎪ 50⎪(128, 128) ⎪1 MHz CON ⎪2013-06-15 16:05:53.8 ⎪ 00ʰ00ᵐ07.7ˢ⎪ ⎪SHA_20171002.0010 ⎪40in ⎪CTCV J1928-5001 ⎪object ⎪∅ ⎪ 670⎪(128, 128) ⎪1 MHz CON ⎪2017-10-02 18:35:37.7 ⎪ 00ʰ05ᵐ39.5ˢ⎪ ⎪SHA_20171002.0011 ⎪40in ⎪CTCV J1928-5001 ⎪object ⎪∅ ⎪ 12498⎪(128, 128) ⎪1 MHz CON ⎪2017-10-02 18:59:43.7 ⎪ 01ʰ45ᵐ33.5ˢ⎪ ⎪ ⎪ ⎪group 2: 8x8; 2.4; EM; 3; 50; 0.0566 ⎪ ⎪20130618.0104 ⎪None ⎪None ⎪dark ⎪∅ ⎪ 100⎪(128, 128) ⎪3 MHz EM: 50 ⎪2013-06-19 02:13:32.9 ⎪ 00ʰ00ᵐ06.3ˢ⎪ ⎪20130616.0030 ⎪74in ⎪CTCV J1928-5001 ⎪object ⎪∅ ⎪ 35000⎪(128, 128) ⎪3 MHz EM: 50 ⎪2013-06-16 21:45:55.9 ⎪ 01ʰ02ᵐ16.6ˢ⎪ ⎪20130616.0031 ⎪74in ⎪CTCV J1928-5001 ⎪object ⎪∅ ⎪ 35000⎪(128, 128) ⎪3 MHz EM: 50 ⎪2013-06-16 22:48:41.9 ⎪ 01ʰ02ᵐ16.6ˢ⎪ ⎪20130617.0030 ⎪74in ⎪CTCV J1928-5001 ⎪object ⎪∅ ⎪ 35000⎪(128, 128) ⎪3 MHz EM: 50 ⎪2013-06-17 21:49:58.9 ⎪ 01ʰ02ᵐ16.6ˢ⎪ ⎪20130617.0031 ⎪74in ⎪CTCV J1928-5001 ⎪object ⎪∅ ⎪ 35000⎪(128, 128) ⎪3 MHz EM: 50 ⎪2013-06-17 22:52:57.9 ⎪ 01ʰ02ᵐ16.6ˢ⎪ ⎪ ⎪ ⎪group 3: 8x8; 2.4; EM; 3; 125; 0.0566 ⎪ ⎪20130618.0105 ⎪None ⎪None ⎪dark ⎪∅ ⎪ 100⎪(128, 128) ⎪3 MHz EM: 125 ⎪2013-06-19 02:14:01.9 ⎪ 00ʰ00ᵐ06.3ˢ⎪ ⎪20130618.0030 ⎪74in ⎪CTCV J1928-5001 ⎪object ⎪∅ ⎪ 35000⎪(128, 128) ⎪3 MHz EM: 125 ⎪2013-06-18 22:41:04.9 ⎪ 01ʰ02ᵐ16.6ˢ⎪ ⎪20130618.0031 ⎪74in ⎪CTCV J1928-5001 ⎪object ⎪∅ ⎪ 22999⎪(128, 128) ⎪3 MHz EM: 125 ⎪2013-06-18 23:43:58.9 ⎪ 00ʰ40ᵐ55.4ˢ⎪ ⎪ ⎪ ⎪group 4: 12x12; 1.0; CON; 1; 0; 0.1002 ⎪ ⎪SHA_20160712.0115 ⎪74in ⎪ ⎪dark ⎪∅ ⎪ 1000⎪(85, 85) ⎪1 MHz CON ⎪2016-07-13 06:04:13.5 ⎪ 00ʰ01ᵐ47.0ˢ⎪ ⎪SHA_20160707.0004 ⎪74in ⎪ ⎪flat ⎪∅ ⎪ 633⎪(85, 85) ⎪1 MHz CON ⎪2016-07-07 16:11:08.0 ⎪ 00ʰ01ᵐ19.3ˢ⎪ ⎪SHA_20160710.0005 ⎪74in ⎪ ⎪flat ⎪∅ ⎪ 500⎪(85, 85) ⎪1 MHz CON ⎪2016-07-10 16:10:53.2 ⎪ 00ʰ01ᵐ02.6ˢ⎪ ⎪ ⎪ ⎪group 5: 8x8; 1.0; CON; 1; 0; 0.14642 ⎪ ⎪SHA_20150715.0051 ⎪74in ⎪BIAS ⎪dark ⎪∅ ⎪ 15⎪(128, 128) ⎪1 MHz CON ⎪2015-07-16 03:00:01.7 ⎪ 00ʰ00ᵐ02.3ˢ⎪ ⎪SHA_20150904.0002 ⎪74in ⎪BIAS ⎪dark ⎪I ⎪ 15⎪(128, 128) ⎪1 MHz CON ⎪2015-09-04 16:01:18.0 ⎪ 00ʰ00ᵐ02.3ˢ⎪ ⎪SHA_20150715.0002 ⎪74in ⎪SKYFLAT ⎪flat ⎪∅ ⎪ 15⎪(128, 128) ⎪1 MHz CON ⎪2015-07-15 16:07:31.7 ⎪ 00ʰ00ᵐ02.3ˢ⎪ ⎪SHA_20150904.0012 ⎪74in ⎪SKYFLAT ⎪flat ⎪I ⎪ 15⎪(128, 128) ⎪1 MHz CON ⎪2015-09-04 16:34:43.2 ⎪ 00ʰ00ᵐ02.3ˢ⎪ ⎪SHA_20150904.0022 ⎪74in ⎪SKYFLAT ⎪flat ⎪∅ ⎪ 15⎪(128, 128) ⎪1 MHz CON ⎪2015-09-04 16:39:23.0 ⎪ 00ʰ00ᵐ02.3ˢ⎪ ⎪SHA_20160710.0003 ⎪74in ⎪ ⎪flat ⎪∅ ⎪ 500⎪(128, 128) ⎪1 MHz CON ⎪2016-07-10 16:06:47.9 ⎪ 00ʰ01ᵐ16.6ˢ⎪ ⎪SHA_20150715.0200 ⎪74in ⎪CTCV J1928-5001 ⎪object ⎪∅ ⎪ 3584⎪(128, 128) ⎪1 MHz CON ⎪2015-07-16 01:43:00.0* ⎪ 00ʰ59ᵐ44.0ˢ⎪ ⎪SHA_20150904.0201 ⎪74in ⎪CTCV J1928-5001 ⎪object ⎪I ⎪ 7201⎪(128, 128) ⎪1 MHz CON ⎪2015-09-04 19:35:00.0* ⎪ 02ʰ00ᵐ01.0ˢ⎪ ⎪SHA_20150904.0202 ⎪74in ⎪CTCV J1928-5001 ⎪object ⎪∅ ⎪ 9001⎪(128, 128) ⎪1 MHz CON ⎪2015-09-04 22:40:00.0* ⎪ 02ʰ30ᵐ01.0ˢ⎪ ⎪SHA_20150905.0101 ⎪74in ⎪CTCV J1928-5001 ⎪object ⎪∅ ⎪ 12600⎪(128, 128) ⎪1 MHz CON ⎪2015-09-05 17:43:00.0* ⎪ 03ʰ30ᵐ00.0ˢ⎪ ⎪ ⎪ ⎪group 6: 12x12; 4.9; EM; 1; 50; 0.10242 ⎪ ⎪SHA_20160712.0117 ⎪74in ⎪ ⎪dark ⎪∅ ⎪ 1000⎪(85, 85) ⎪1 MHz EM: 50 ⎪2016-07-13 06:08:51.6 ⎪ 00ʰ01ᵐ49.2ˢ⎪ ⎪SHA_20160706.0007 ⎪74in ⎪CTCV J1928-5001 ⎪object ⎪∅ ⎪ 18253⎪(85, 85) ⎪1 MHz EM: 50 ⎪2016-07-06 23:23:07.3 ⎪ 02ʰ34ᵐ09.9ˢ⎪ ⎪SHA_20160707.0030 ⎪74in ⎪CTCV J1928-5001 ⎪object ⎪∅ ⎪ 4301⎪(85, 85) ⎪1 MHz EM: 50 ⎪2016-07-07 22:18:54.3 ⎪ 00ʰ36ᵐ19.6ˢ⎪ ⎪SHA_20160707.0031 ⎪74in ⎪CTCV J1928-5001 ⎪object ⎪∅ ⎪ 28000⎪(85, 85) ⎪1 MHz EM: 50 ⎪2016-07-07 22:55:20.6 ⎪ 01ʰ59ᵐ49.3ˢ⎪ ⎪ ⎪ ⎪group 7: 8x8; 2.4; EM; 1; 50; 0.14862 ⎪ ⎪202130615.0101 ⎪None ⎪None ⎪dark ⎪∅ ⎪ 50⎪(128, 128) ⎪1 MHz EM: 50 ⎪2013-06-16 04:29:56.8 ⎪ 00ʰ00ᵐ07.8ˢ⎪ ⎪202130615.0030 ⎪74in ⎪CTCV J1928-5001 ⎪object ⎪∅ ⎪ 20000⎪(128, 128) ⎪1 MHz EM: 50 ⎪2013-06-15 23:15:00.8 ⎪ 00ʰ51ᵐ47.6ˢ⎪ ⎪202130615.0031 ⎪74in ⎪CTCV J1928-5001 ⎪object ⎪∅ ⎪ 20000⎪(128, 128) ⎪1 MHz EM: 50 ⎪2013-06-16 00:07:07.8 ⎪ 00ʰ51ᵐ47.6ˢ⎪ ⎪202130615.0032 ⎪74in ⎪CTCV J1928-5001 ⎪object ⎪∅ ⎪ 10000⎪(128, 128) ⎪1 MHz EM: 50 ⎪2013-06-16 01:01:08.8 ⎪ 00ʰ25ᵐ53.8ˢ⎪ ⎪ ⎪ ⎪group 8: 8x8; 4.9; EM; 1; 65; 0.14862 ⎪ ⎪SHA_20160712.0109 ⎪74in ⎪ ⎪dark ⎪∅ ⎪ 1000⎪(128, 128) ⎪1 MHz EM: 65 ⎪2016-07-13 05:46:44.8 ⎪ 00ʰ02ᵐ35.4ˢ⎪ ⎪SHA_20160711.0001 ⎪74in ⎪CTCV J1928-5001 ⎪object ⎪∅ ⎪ 37505⎪(128, 128) ⎪1 MHz EM: 65 ⎪2016-07-11 22:51:49.9 ⎪ 02ʰ40ᵐ29.8ˢ⎪ ⎪ ⎪ ⎪group 9: 12x12; 2.4; CON; 1; 0; 0.1002 ⎪ ⎪SHA_20160712.0116 ⎪74in ⎪ ⎪dark ⎪∅ ⎪ 1000⎪(85, 85) ⎪1 MHz CON ⎪2016-07-13 06:06:08.4 ⎪ 00ʰ01ᵐ47.0ˢ⎪ ⎪SHA_20160706.0004 ⎪74in ⎪ ⎪flat ⎪∅ ⎪ 405⎪(85, 85) ⎪1 MHz CON ⎪2016-07-06 16:14:40.9 ⎪ 00ʰ02ᵐ04.2ˢ⎪ * t0: timing.trigger.is_gps
# display
fig, *_ = mbias.to_list().sort_by('date').thumbnails(title=('date', 'readout'))
fig
from obstools.stats import median_scaled_median
# Science files are large and won't all fit into RAM, so needs careful handling.
# use `set_calibrators` to do calibration arithmetic on the fly when accessing
# data via `calibrated` attribute
gobj = gobs.select_by(obstype='object')
gobj.set_calibrators(mbias)
# Flat fields are small enough volume that we can safely read them into RAM.
gflat = gobs.select_by(obstype='flat')
gflat = gflat.subtract(mbias)
# Match calibrated flat fields to science observations. This grouping will be
# different to that of `gflat` above since we are now matching for closest
# dates
gobj, gflat = g['object'].match(gflat.to_list(), *MATCH_FLATS, keep_nulls=False,
report=True)
# flat field: median scale each image, then median combine images
mflat = gflat.merge_combine(median_scaled_median)
#
gobj.set_calibrators(flats=mflat)
/usr/local/lib/python3.6/dist-packages/numpy/core/_asarray.py:83: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray return array(a, dtype, copy=False, order=order)
⎪Matched Observations ⎪ ⎪exact: ('telescope', 'instrument', 'binning', 'filters') ⎪ ⎪closest: ('date',) ⎪ ⎪None ⎪ ⎪ ⎪ readout ⎪ timing ⎪ ⎪ filename ⎪ target ⎪obstype ⎪ n ⎪ ishape ⎪γₚᵣₑ ⎪ mode ⎪ t0 ⎪ tExp ⎪ duration ⎪ ⎪ ⎪ ⎪group 0: 40in; 8x8; Filters('∅', '∅') ⎪ ⎪NO MATCH ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪ ⎪SHA_20171002.0010 ⎪CTCV J1928-5001 ⎪object ⎪ 670⎪(128, 128) ⎪ 2.4⎪1 MHz CON ⎪2017-10-02 18:35:37.7 ⎪ 0.5 ⎪ 00ʰ05ᵐ39.5ˢ⎪ ⎪SHA_20171002.0011 ⎪CTCV J1928-5001 ⎪object ⎪ 12498⎪(128, 128) ⎪ 2.4⎪1 MHz CON ⎪2017-10-02 18:59:43.7 ⎪ 0.5 ⎪ 01ʰ45ᵐ33.5ˢ⎪ ⎪ ⎪ ⎪group 1: 74in; 12x12; Filters('∅', '∅'); 2016-07-07 ⎪ ⎪SHA_20160707.0004 ⎪ ⎪flat ⎪ 633⎪(85, 85) ⎪ 1.0⎪1 MHz CON ⎪2016-07-07 16:11:08.0 ⎪ 0.11847 ⎪ 00ʰ01ᵐ19.3ˢ⎪ ⎪SHA_20160707.0030 ⎪CTCV J1928-5001 ⎪object ⎪ 4301⎪(85, 85) ⎪ 4.9⎪1 MHz EM: 50 ⎪2016-07-07 22:18:54.3 ⎪ 0.5 ⎪ 00ʰ36ᵐ19.6ˢ⎪ ⎪SHA_20160707.0031 ⎪CTCV J1928-5001 ⎪object ⎪ 28000⎪(85, 85) ⎪ 4.9⎪1 MHz EM: 50 ⎪2016-07-07 22:55:20.6 ⎪ 0.25 ⎪ 01ʰ59ᵐ49.3ˢ⎪ ⎪ ⎪ ⎪group 2: 74in; 12x12; Filters('∅', '∅'); 2016-07-06 ⎪ ⎪SHA_20160706.0004 ⎪ ⎪flat ⎪ 405⎪(85, 85) ⎪ 2.4⎪1 MHz CON ⎪2016-07-06 16:14:40.9 ⎪ 0.3 ⎪ 00ʰ02ᵐ04.2ˢ⎪ ⎪SHA_20160706.0007 ⎪CTCV J1928-5001 ⎪object ⎪ 18253⎪(85, 85) ⎪ 4.9⎪1 MHz EM: 50 ⎪2016-07-06 23:23:07.3 ⎪ 0.5 ⎪ 02ʰ34ᵐ09.9ˢ⎪ ⎪ ⎪ ⎪group 3: 74in; 8x8; Filters('I', '∅'); 2015-09-04 ⎪ ⎪SHA_20150904.0012 ⎪SKYFLAT ⎪flat ⎪ 15⎪(128, 128) ⎪ 1.0⎪1 MHz CON ⎪2015-09-04 16:34:43.2 ⎪ 0.14642 ⎪ 00ʰ00ᵐ02.3ˢ⎪ ⎪SHA_20150904.0201 ⎪CTCV J1928-5001 ⎪object ⎪ 7201⎪(128, 128) ⎪ 1.0⎪1 MHz CON ⎪2015-09-04 19:35:00.0* ⎪ 0.99324*⎪ 02ʰ00ᵐ01.0ˢ⎪ ⎪ ⎪ ⎪group 4: 74in; 8x8; Filters('∅', '∅'); 2015-06-07 ⎪ ⎪SHA_20150607.0003 ⎪ ⎪flat ⎪ 30⎪(128, 128) ⎪ 1.0⎪3 MHz CON ⎪2015-06-07 15:57:57.9 ⎪ 0.0558 ⎪ 00ʰ00ᵐ01.9ˢ⎪ ⎪SHA_20150606.0300 ⎪CTCV J1928-5001 ⎪object ⎪ 4824⎪(128, 128) ⎪ 1.0⎪3 MHz CON ⎪2015-06-07 01:25:00.0* ⎪ 0.49324*⎪ 00ʰ40ᵐ12.0ˢ⎪ ⎪ ⎪ ⎪group 5: 74in; 8x8; Filters('∅', '∅'); 2013-06-16 ⎪ ⎪20130616.0002 ⎪None ⎪flat ⎪ 50⎪(128, 128) ⎪ 2.4⎪1 MHz CON ⎪2013-06-16 16:02:16.8 ⎪ 0.14642 ⎪ 00ʰ00ᵐ07.7ˢ⎪ ⎪20130616.0030 ⎪CTCV J1928-5001 ⎪object ⎪ 35000⎪(128, 128) ⎪ 2.4⎪3 MHz EM: 50 ⎪2013-06-16 21:45:55.9 ⎪ 0.1 ⎪ 01ʰ02ᵐ16.6ˢ⎪ ⎪20130616.0031 ⎪CTCV J1928-5001 ⎪object ⎪ 35000⎪(128, 128) ⎪ 2.4⎪3 MHz EM: 50 ⎪2013-06-16 22:48:41.9 ⎪ 0.1 ⎪ 01ʰ02ᵐ16.6ˢ⎪ ⎪202130615.0031 ⎪CTCV J1928-5001 ⎪object ⎪ 20000⎪(128, 128) ⎪ 2.4⎪1 MHz EM: 50 ⎪2013-06-16 00:07:07.8 ⎪ 0.14862 ⎪ 00ʰ51ᵐ47.6ˢ⎪ ⎪202130615.0032 ⎪CTCV J1928-5001 ⎪object ⎪ 10000⎪(128, 128) ⎪ 2.4⎪1 MHz EM: 50 ⎪2013-06-16 01:01:08.8 ⎪ 0.14862 ⎪ 00ʰ25ᵐ53.8ˢ⎪ ⎪ ⎪ ⎪group 6: 74in; 8x8; Filters('∅', '∅'); 2013-06-17 ⎪ ⎪20130617.0001 ⎪None ⎪flat ⎪ 100⎪(128, 128) ⎪ 2.4⎪1 MHz CON ⎪2013-06-17 16:02:29.8 ⎪ 0.14642 ⎪ 00ʰ00ᵐ15.3ˢ⎪ ⎪20130617.0030 ⎪CTCV J1928-5001 ⎪object ⎪ 35000⎪(128, 128) ⎪ 2.4⎪3 MHz EM: 50 ⎪2013-06-17 21:49:58.9 ⎪ 0.1 ⎪ 01ʰ02ᵐ16.6ˢ⎪ ⎪20130617.0031 ⎪CTCV J1928-5001 ⎪object ⎪ 35000⎪(128, 128) ⎪ 2.4⎪3 MHz EM: 50 ⎪2013-06-17 22:52:57.9 ⎪ 0.1 ⎪ 01ʰ02ᵐ16.6ˢ⎪ ⎪20130618.0030 ⎪CTCV J1928-5001 ⎪object ⎪ 35000⎪(128, 128) ⎪ 2.4⎪3 MHz EM: 125 ⎪2013-06-18 22:41:04.9 ⎪ 0.1 ⎪ 01ʰ02ᵐ16.6ˢ⎪ ⎪20130618.0031 ⎪CTCV J1928-5001 ⎪object ⎪ 22999⎪(128, 128) ⎪ 2.4⎪3 MHz EM: 125 ⎪2013-06-18 23:43:58.9 ⎪ 0.1 ⎪ 00ʰ40ᵐ55.4ˢ⎪ ⎪ ⎪ ⎪group 7: 74in; 8x8; Filters('∅', '∅'); 2013-06-15 ⎪ ⎪202130615.0002 ⎪None ⎪flat ⎪ 50⎪(128, 128) ⎪ 2.4⎪1 MHz CON ⎪2013-06-15 16:05:53.8 ⎪ 0.14642 ⎪ 00ʰ00ᵐ07.7ˢ⎪ ⎪202130615.0030 ⎪CTCV J1928-5001 ⎪object ⎪ 20000⎪(128, 128) ⎪ 2.4⎪1 MHz EM: 50 ⎪2013-06-15 23:15:00.8 ⎪ 0.14862 ⎪ 00ʰ51ᵐ47.6ˢ⎪ ⎪ ⎪ ⎪group 8: 74in; 8x8; Filters('∅', '∅'); 2015-07-15 ⎪ ⎪SHA_20150715.0002 ⎪SKYFLAT ⎪flat ⎪ 15⎪(128, 128) ⎪ 1.0⎪1 MHz CON ⎪2015-07-15 16:07:31.7 ⎪ 0.14642 ⎪ 00ʰ00ᵐ02.3ˢ⎪ ⎪SHA_20150715.0200 ⎪CTCV J1928-5001 ⎪object ⎪ 3584⎪(128, 128) ⎪ 1.0⎪1 MHz CON ⎪2015-07-16 01:43:00.0* ⎪ 0.99324*⎪ 00ʰ59ᵐ44.0ˢ⎪ ⎪ ⎪ ⎪group 9: 74in; 8x8; Filters('∅', '∅'); 2015-09-04 ⎪ ⎪SHA_20150904.0022 ⎪SKYFLAT ⎪flat ⎪ 15⎪(128, 128) ⎪ 1.0⎪1 MHz CON ⎪2015-09-04 16:39:23.0 ⎪ 0.14642 ⎪ 00ʰ00ᵐ02.3ˢ⎪ ⎪SHA_20150904.0202 ⎪CTCV J1928-5001 ⎪object ⎪ 9001⎪(128, 128) ⎪ 1.0⎪1 MHz CON ⎪2015-09-04 22:40:00.0* ⎪ 0.99324*⎪ 02ʰ30ᵐ01.0ˢ⎪ ⎪SHA_20150905.0101 ⎪CTCV J1928-5001 ⎪object ⎪ 12600⎪(128, 128) ⎪ 1.0⎪1 MHz CON ⎪2015-09-05 17:43:00.0* ⎪ 0.99324*⎪ 03ʰ30ᵐ00.0ˢ⎪ ⎪ ⎪ ⎪group 10: 74in; 8x8; Filters('∅', '∅'); 2016-07-10 ⎪ ⎪SHA_20160710.0003 ⎪ ⎪flat ⎪ 500⎪(128, 128) ⎪ 1.0⎪1 MHz CON ⎪2016-07-10 16:06:47.9 ⎪ 0.14642 ⎪ 00ʰ01ᵐ16.6ˢ⎪ ⎪SHA_20160711.0001 ⎪CTCV J1928-5001 ⎪object ⎪ 37505⎪(128, 128) ⎪ 4.9⎪1 MHz EM: 65 ⎪2016-07-11 22:51:49.9 ⎪ 0.25 ⎪ 02ʰ40ᵐ29.8ˢ⎪ * t0: timing.trigger.is_gps * tExp: timing.trigger.is_gps_loop
# display master flats
fig, *_ = mflat.to_list().sort_by('date').thumbnails(title='date')
fig
# show image grid (calibrated images)
# gobj.set_calibrators(mbias) # mflat
orun = gobj.to_list().sort_by('date')
fig, *_ = orun.thumbnails(calibrated=True)
fig
# The flats for 20150606.0300.fits seem to introduce artifacts rather than
# remove them. This is most likely due to small number statistics since
# there are only 30 frames in the flat field observation..
orun = gobj.to_list().sort_by('date')
orun[9].calibrated.flat = None
# Also don't have calibration images for 1.0m data, which can't be helped
# Image registration & mosaic
# align images
reg = orun.coalign(plot=False)
# plot
mp = reg.mosaic(alpha=0.35, cmap='cmr.dusk', number_sources=True)
mp.fig
INFO:core.shocOldHDU:Computing median of 67 images (exposure depth of 10.0 seconds) for sample image from '202130615.0030.fits' INFO:core.shocOldHDU:Computing median of 99 images (exposure depth of 10.0 seconds) for sample image from '20130616.0030.fits' INFO:core.shocOldHDU:Computing median of 99 images (exposure depth of 10.0 seconds) for sample image from '20130616.0031.fits' INFO:core.shocOldHDU:Computing median of 67 images (exposure depth of 10.0 seconds) for sample image from '202130615.0031.fits' INFO:core.shocOldHDU:Computing median of 67 images (exposure depth of 10.0 seconds) for sample image from '202130615.0032.fits' INFO:core.shocOldHDU:Computing median of 99 images (exposure depth of 10.0 seconds) for sample image from '20130617.0030.fits' INFO:core.shocOldHDU:Computing median of 99 images (exposure depth of 10.0 seconds) for sample image from '20130617.0031.fits' INFO:core.shocOldHDU:Computing median of 99 images (exposure depth of 10.0 seconds) for sample image from '20130618.0030.fits' INFO:core.shocOldHDU:Computing median of 99 images (exposure depth of 10.0 seconds) for sample image from '20130618.0031.fits' INFO:core.shocNewHDU:Computing median of 20 images (exposure depth of 10.0 seconds) for sample image from 'SHA_20150606.0300.fits' INFO:core.shocNewHDU:Computing median of 10 images (exposure depth of 10.0 seconds) for sample image from 'SHA_20150715.0200.fits' INFO:core.shocNewHDU:Computing median of 10 images (exposure depth of 10.0 seconds) for sample image from 'SHA_20150904.0201.fits' INFO:core.shocNewHDU:Computing median of 10 images (exposure depth of 10.0 seconds) for sample image from 'SHA_20150904.0202.fits' INFO:core.shocNewHDU:Computing median of 10 images (exposure depth of 10.0 seconds) for sample image from 'SHA_20150905.0101.fits' INFO:core.shocFlatHDU:Computing median of 20 images (exposure depth of 10.0 seconds) for sample image from 'SHA_20160706.0007.fits' INFO:core.shocNewHDU:Computing median of 20 images (exposure depth of 10.0 seconds) for sample image from 'SHA_20160707.0030.fits' INFO:core.shocNewHDU:Computing median of 40 images (exposure depth of 10.0 seconds) for sample image from 'SHA_20160707.0031.fits' INFO:core.shocNewHDU:Computing median of 40 images (exposure depth of 10.0 seconds) for sample image from 'SHA_20160711.0001.fits' INFO:registration.ImageRegister:Aligning 18 images on image 0 INFO:image.registration:Identifying stars INFO:image.registration:Clustering 190 position measurements using: MeanShift(bandwidth=5.94811058767327, bin_seeding=False, cluster_all=False, min_bin_freq=1, n_jobs=None, seeds=None) INFO:image.registration:Identified 23 stars using 190/190 points (0 noise) INFO:image.registration:Identifying stars INFO:image.registration:Clustering 190 position measurements using: MeanShift(bandwidth=5.94811058767327, bin_seeding=False, cluster_all=False, min_bin_freq=1, n_jobs=None, seeds=None) INFO:image.registration:Identified 23 stars using 190/190 points (0 noise) INFO:registration.ImageRegister:Fitting successful 17 / 17 INFO:registration.ImageRegister:Likelihood ratio: 0.99871 INFO:registration.ImageRegister:Keeping same parameters. INFO:image.registration:Measuring cluster centres, frame xy-offsets INFO:image.registration:Ignoring 8 / 23 stars with low (<=25%) detection frequency for frame offset measurement. INFO:image.registration: ⎪ Measured star locations ⎪ ⎪# ⎪ n (%)⎪ x⎪ y⎪ ⎪1 ⎪ 18 (100%)⎪ 55.74 ± 0.10⎪ 92.01 ± 0.18⎪ ⎪2 ⎪ 18 (100%)⎪ 47.37 ± 0.16⎪ 41.56 ± 0.13⎪ ⎪3 ⎪ 18 (100%)⎪ 72.54 ± 0.13⎪ 38.54 ± 0.21⎪ ⎪4 ⎪ 18 (100%)⎪ 57.74 ± 0.15⎪ 28.44 ± 0.19⎪ ⎪5 ⎪ 14 (78%)⎪ 15.84 ± 0.07⎪ 96.26 ± 0.11⎪ ⎪6 ⎪ 13 (72%)⎪ 93.01 ± 0.11⎪ 43.19 ± 0.13⎪ ⎪7 ⎪ 12 (67%)⎪ 27.42 ± 0.52⎪ 49.33 ± 0.93⎪ ⎪8 ⎪ 11 (61%)⎪ 108.03 ± 0.13⎪ 74.48 ± 0.21⎪ ⎪9 ⎪ 8 (44%)⎪ 64.58 ± 0.56⎪ 124.94 ± 0.29⎪ ⎪10 ⎪ 8 (44%)⎪ 2.80 ± 0.24⎪ 86.53 ± 0.20⎪ ⎪11 ⎪ 8 (44%)⎪ -4.50 ± 0.13⎪ 29.69 ± 0.28⎪ ⎪12 ⎪ 7 (39%)⎪ -5.44 ± 0.20⎪ 122.24 ± 0.22⎪ ⎪13 ⎪ 7 (39%)⎪ -12.13 ± 0.14⎪ 41.26 ± 0.25⎪ ⎪14 ⎪ 5 (28%)⎪ 5.44 ± 0.44⎪ 128.03 ± 0.29⎪ ⎪15 ⎪ 5 (28%)⎪ 100.83 ± 0.18⎪ 23.85 ± 0.39⎪ ⎪16 ⎪ 4 (22%)⎪ -28.72 ± 51.63⎪ 74.77 ± 51.63⎪ ⎪17 ⎪ 3 (17%)⎪ 77.80 ± 16.79⎪ 111.12 ± 16.79⎪ ⎪18 ⎪ 3 (17%)⎪ 129.30 ± 33.93⎪ 61.32 ± 33.93⎪ ⎪19 ⎪ 3 (17%)⎪ 132.96 ± 67.83⎪ -2.68 ± 67.83⎪ ⎪20 ⎪ 2 (11%)⎪ -7.93 ± 5.80⎪ 3.65 ± 5.80⎪ ⎪21 ⎪ 2 (11%)⎪ 115.71 ± 61.59⎪ -7.47 ± 61.59⎪ ⎪22 ⎪ 2 (11%)⎪ 143.47 ± 80.92⎪ -18.37 ± 80.92⎪ ⎪23 ⎪ 1 (6%)⎪ 120.39 ± 71.78⎪ -23.16 ± 71.78⎪ ⎪ ⎪ 190 (1056%)⎪ ⎪ ⎪ n_noise = 224/414 (54.1%) INFO:registration.ImageRegister:Likelihood ratio: 0.99974 INFO:registration.ImageRegister:Keeping same parameters. INFO:core.shocNewHDU:Computing median of 20 images (exposure depth of 10.0 seconds) for sample image from 'SHA_20171002.0010.fits' INFO:core.shocNewHDU:Computing median of 20 images (exposure depth of 10.0 seconds) for sample image from 'SHA_20171002.0011.fits' INFO:registration.ImageRegister:Aligning 2 images on image 0 INFO:image.registration:Identifying stars INFO:image.registration:Clustering 21 position measurements using: MeanShift(bandwidth=2.3434870339511447, bin_seeding=False, cluster_all=False, min_bin_freq=1, n_jobs=None, seeds=None) INFO:image.registration:Identified 13 stars using 21/21 points (0 noise) INFO:image.registration:Identifying stars INFO:image.registration:Clustering 21 position measurements using: MeanShift(bandwidth=2.3434870339511447, bin_seeding=False, cluster_all=False, min_bin_freq=1, n_jobs=None, seeds=None) INFO:image.registration:Identified 13 stars using 21/21 points (0 noise) INFO:registration.ImageRegister:Fitting successful 1 / 1 INFO:registration.ImageRegister:Likelihood ratio: 0.99916 INFO:registration.ImageRegister:Keeping same parameters. INFO:image.registration:Measuring cluster centres, frame xy-offsets INFO:image.registration: ⎪ Measured star locations ⎪ ⎪# ⎪ n (%)⎪ x⎪ y⎪ ⎪1 ⎪ 2 (100%)⎪ 57.56 ± 0.02⎪ 116.71 ± 0.01⎪ ⎪2 ⎪ 2 (100%)⎪ 53.74 ± 0.01⎪ 93.79 ± 0.03⎪ ⎪3 ⎪ 2 (100%)⎪ 19.11 ± 0.07⎪ 67.73 ± 0.05⎪ ⎪4 ⎪ 2 (100%)⎪ 97.06 ± 0.04⎪ 66.52 ± 0.07⎪ ⎪5 ⎪ 2 (100%)⎪ 46.95 ± 0.06⎪ 41.71 ± 0.07⎪ ⎪6 ⎪ 2 (100%)⎪ 80.76 ± 0.09⎪ 38.67 ± 0.03⎪ ⎪7 ⎪ 2 (100%)⎪ 81.93 ± 0.09⎪ 29.36 ± 0.03⎪ ⎪8 ⎪ 2 (100%)⎪ 6.56 ± 0.04⎪ 26.95 ± 0.12⎪ ⎪9 ⎪ 1 (50%)⎪ -4.13 ± 0.00⎪ 99.71 ± 0.00⎪ ⎪10 ⎪ 1 (50%)⎪ 30.60 ± 0.00⎪ 88.42 ± 0.00⎪ ⎪11 ⎪ 1 (50%)⎪ 59.49 ± 0.00⎪ 62.37 ± 0.00⎪ ⎪12 ⎪ 1 (50%)⎪ 54.90 ± 0.00⎪ 43.18 ± 0.00⎪ ⎪13 ⎪ 1 (50%)⎪ 1.85 ± 0.00⎪ 26.52 ± 0.00⎪ ⎪ ⎪ 21 (1050%)⎪ ⎪ ⎪ n_noise = 5/26 (19.2%) INFO:registration.ImageRegister:Likelihood ratio: 0.99942 INFO:registration.ImageRegister:Keeping same parameters. INFO:image.registration:Identifying stars INFO:image.registration:Clustering 211 position measurements using: MeanShift(bandwidth=5.177471354078109, bin_seeding=False, cluster_all=False, min_bin_freq=1, n_jobs=None, seeds=None) INFO:image.registration:Identified 32 stars using 211/211 points (0 noise) INFO:registration.ImageRegister:Fitting successful 19 / 19 INFO:registration.ImageRegister:Likelihood ratio: 0.99907 INFO:registration.ImageRegister:Keeping same parameters. INFO:image.registration:Measuring cluster centres, frame xy-offsets INFO:image.registration:Ignoring 19 / 32 stars with low (<=25%) detection frequency for frame offset measurement. INFO:image.registration: ⎪ Measured star locations ⎪ ⎪# ⎪ n (%)⎪ x⎪ y⎪ ⎪1 ⎪ 20 (100%)⎪ 55.73 ± 0.11⎪ 92.03 ± 0.17⎪ ⎪2 ⎪ 20 (100%)⎪ 47.35 ± 0.15⎪ 41.53 ± 0.12⎪ ⎪3 ⎪ 18 (90%)⎪ 72.55 ± 0.13⎪ 38.53 ± 0.22⎪ ⎪4 ⎪ 18 (90%)⎪ 57.74 ± 0.14⎪ 28.44 ± 0.19⎪ ⎪5 ⎪ 14 (70%)⎪ 15.85 ± 0.08⎪ 96.25 ± 0.12⎪ ⎪6 ⎪ 13 (65%)⎪ 93.02 ± 0.10⎪ 43.18 ± 0.15⎪ ⎪7 ⎪ 12 (60%)⎪ 27.42 ± 0.50⎪ 49.32 ± 0.92⎪ ⎪8 ⎪ 11 (55%)⎪ 108.03 ± 0.12⎪ 74.46 ± 0.19⎪ ⎪9 ⎪ 9 (45%)⎪ -4.49 ± 0.19⎪ 29.66 ± 0.26⎪ ⎪10 ⎪ 8 (40%)⎪ 64.59 ± 0.60⎪ 124.93 ± 0.30⎪ ⎪11 ⎪ 8 (40%)⎪ 2.80 ± 0.23⎪ 86.53 ± 0.20⎪ ⎪12 ⎪ 7 (35%)⎪ -5.43 ± 0.24⎪ 122.23 ± 0.22⎪ ⎪13 ⎪ 7 (35%)⎪ -12.13 ± 0.12⎪ 41.26 ± 0.26⎪ ⎪14 ⎪ 5 (25%)⎪ 5.45 ± 61.37⎪ 128.02 ± 61.37⎪ ⎪15 ⎪ 5 (25%)⎪ 100.84 ± 38.57⎪ 23.84 ± 38.57⎪ ⎪16 ⎪ 4 (20%)⎪ -28.72 ± 51.63⎪ 74.79 ± 51.63⎪ ⎪17 ⎪ 4 (20%)⎪ 143.39 ± 80.89⎪ -18.43 ± 80.89⎪ ⎪18 ⎪ 3 (15%)⎪ 77.85 ± 16.81⎪ 111.14 ± 16.81⎪ ⎪19 ⎪ 3 (15%)⎪ 129.30 ± 33.94⎪ 61.30 ± 33.94⎪ ⎪20 ⎪ 3 (15%)⎪ 132.97 ± 67.84⎪ -2.69 ± 67.84⎪ ⎪21 ⎪ 2 (10%)⎪ -7.92 ± 5.80⎪ 3.64 ± 5.80⎪ ⎪22 ⎪ 2 (10%)⎪ 115.70 ± 61.60⎪ -7.49 ± 61.60⎪ ⎪23 ⎪ 2 (10%)⎪ -29.28 ± 6.60⎪ -16.09 ± 6.60⎪ ⎪24 ⎪ 2 (10%)⎪ 32.23 ± 52.90⎪ -73.57 ± 52.90⎪ ⎪25 ⎪ 2 (10%)⎪ 106.93 ± 93.61⎪ -80.29 ± 93.61⎪ ⎪26 ⎪ 2 (10%)⎪ 109.52 ± 105.19⎪ -100.87 ± 105.19⎪ ⎪27 ⎪ 2 (10%)⎪ -57.00 ± 24.59⎪ -106.19 ± 24.59⎪ ⎪28 ⎪ 1 (5%)⎪ -80.71 ± 67.63⎪ 54.55 ± 67.63⎪ ⎪29 ⎪ 1 (5%)⎪ 120.37 ± 71.78⎪ -23.20 ± 71.78⎪ ⎪30 ⎪ 1 (5%)⎪ 60.01 ± 43.96⎪ -27.91 ± 43.96⎪ ⎪31 ⎪ 1 (5%)⎪ 49.89 ± 60.10⎪ -70.32 ± 60.10⎪ ⎪32 ⎪ 1 (5%)⎪ -67.51 ± 19.82⎪ -107.15 ± 19.82⎪ ⎪ ⎪ 211 (1055%)⎪ ⎪ ⎪ n_noise = 429/640 (67.0%) INFO:registration.ImageRegister:Likelihood ratio: 1.00039 INFO:registration.ImageRegister:Accepting new parameters.
from graphing.imagine import ImageDisplay
def pixel_transform(i: int):
# scale images by source counts for source 0 and median subtract
image = reg[i]
a = image.data / image.counts[sidx[i] == 0]
return a - np.ma.median(a)
# get source indices per frame
sidx = reg.source_indices
# get mean image across stack
g, bs = reg.binned_statistic(image_func=pixel_transform, interpolate=True)
im = ImageDisplay(bs.statistic.T)
im.image.set_clim(0, 0.012)
im.figure.set_size_inches(8, 8)
im.figure