Step-by-step reduction#
The most common way to use IOP4 is by launching the iop4 command to
automatically reduce some nights. However, you might be interested in reducing
some images step by step (when debugging problems, or implementing new
instruments). In this notebook we will do exactly that, which is more or less
what iop4.py does when launched from the command line.
%autoawait off
%matplotlib inline
%run 01_notebook_configuration.py
Fetching the data from the telescope archive.#
We might be interested in downloading all files from one night, or just a single night. In any case, you can directly do
# warning: this might clean flags and some other fields:
from iop4lib.db import Epoch
epoch = Epoch.create(epochname="OSN-T090/2022-09-18")
epoch
2026-02-24 05:20 - pid 3560 - [epoch.py:262] - DEBUG - Epoch for OSN-T090/2022-09-18 already exists in the DB, it will be used instead.
2026-02-24 05:20 - pid 3560 - [rawfit.py:235] - DEBUG - DB entry for OSN-T090/2022-09-18/Bias_2x2-0003.fit already exists, it will be used instead.
2026-02-24 05:20 - pid 3560 - [rawfit.py:235] - DEBUG - DB entry for OSN-T090/2022-09-18/Bias_2x2-0007.fit already exists, it will be used instead.
2026-02-24 05:20 - pid 3560 - [rawfit.py:235] - DEBUG - DB entry for OSN-T090/2022-09-18/Bias_2x2-0008.fit already exists, it will be used instead.
2026-02-24 05:20 - pid 3560 - [rawfit.py:235] - DEBUG - DB entry for OSN-T090/2022-09-18/Bias_2x2-0011.fit already exists, it will be used instead.
2026-02-24 05:20 - pid 3560 - [rawfit.py:235] - DEBUG - DB entry for OSN-T090/2022-09-18/Bias_2x2-0009.fit already exists, it will be used instead.
2026-02-24 05:20 - pid 3560 - [rawfit.py:235] - DEBUG - DB entry for OSN-T090/2022-09-18/Bias_2x2-0002.fit already exists, it will be used instead.
2026-02-24 05:20 - pid 3560 - [rawfit.py:235] - DEBUG - DB entry for OSN-T090/2022-09-18/Bias_2x2-0005.fit already exists, it will be used instead.
2026-02-24 05:20 - pid 3560 - [rawfit.py:235] - DEBUG - DB entry for OSN-T090/2022-09-18/Bias_2x2-0004.fit already exists, it will be used instead.
2026-02-24 05:20 - pid 3560 - [rawfit.py:235] - DEBUG - DB entry for OSN-T090/2022-09-18/Bias_2x2-0001.fit already exists, it will be used instead.
2026-02-24 05:20 - pid 3560 - [rawfit.py:235] - DEBUG - DB entry for OSN-T090/2022-09-18/Bias_2x2-0010.fit already exists, it will be used instead.
2026-02-24 05:20 - pid 3560 - [rawfit.py:235] - DEBUG - DB entry for OSN-T090/2022-09-18/BLLac-0001R.fit already exists, it will be used instead.
2026-02-24 05:20 - pid 3560 - [rawfit.py:235] - DEBUG - DB entry for OSN-T090/2022-09-18/Bias_2x2-0006.fit already exists, it will be used instead.
2026-02-24 05:20 - pid 3560 - [rawfit.py:273] - DEBUG - <RawFit 136 | OSN-T090/2022-09-18/Bias_2x2-0003.fit>: procuring local file.
2026-02-24 05:20 - pid 3560 - [rawfit.py:306] - DEBUG - <RawFit 136 | OSN-T090/2022-09-18/Bias_2x2-0003.fit>: classifying
2026-02-24 05:20 - pid 3560 - [osn_cameras.py:136] - DEBUG - Band is not R, assuming it is photometry.
2026-02-24 05:20 - pid 3560 - [rawfit.py:273] - DEBUG - <RawFit 137 | OSN-T090/2022-09-18/Bias_2x2-0007.fit>: procuring local file.
2026-02-24 05:20 - pid 3560 - [rawfit.py:306] - DEBUG - <RawFit 137 | OSN-T090/2022-09-18/Bias_2x2-0007.fit>: classifying
2026-02-24 05:20 - pid 3560 - [osn_cameras.py:136] - DEBUG - Band is not R, assuming it is photometry.
2026-02-24 05:20 - pid 3560 - [rawfit.py:273] - DEBUG - <RawFit 138 | OSN-T090/2022-09-18/Bias_2x2-0008.fit>: procuring local file.
2026-02-24 05:20 - pid 3560 - [rawfit.py:306] - DEBUG - <RawFit 138 | OSN-T090/2022-09-18/Bias_2x2-0008.fit>: classifying
2026-02-24 05:20 - pid 3560 - [osn_cameras.py:136] - DEBUG - Band is not R, assuming it is photometry.
2026-02-24 05:20 - pid 3560 - [rawfit.py:273] - DEBUG - <RawFit 139 | OSN-T090/2022-09-18/Bias_2x2-0011.fit>: procuring local file.
2026-02-24 05:20 - pid 3560 - [rawfit.py:306] - DEBUG - <RawFit 139 | OSN-T090/2022-09-18/Bias_2x2-0011.fit>: classifying
2026-02-24 05:20 - pid 3560 - [osn_cameras.py:136] - DEBUG - Band is not R, assuming it is photometry.
2026-02-24 05:20 - pid 3560 - [rawfit.py:273] - DEBUG - <RawFit 140 | OSN-T090/2022-09-18/Bias_2x2-0009.fit>: procuring local file.
2026-02-24 05:20 - pid 3560 - [rawfit.py:306] - DEBUG - <RawFit 140 | OSN-T090/2022-09-18/Bias_2x2-0009.fit>: classifying
2026-02-24 05:20 - pid 3560 - [osn_cameras.py:136] - DEBUG - Band is not R, assuming it is photometry.
2026-02-24 05:20 - pid 3560 - [rawfit.py:273] - DEBUG - <RawFit 141 | OSN-T090/2022-09-18/Bias_2x2-0002.fit>: procuring local file.
2026-02-24 05:20 - pid 3560 - [rawfit.py:306] - DEBUG - <RawFit 141 | OSN-T090/2022-09-18/Bias_2x2-0002.fit>: classifying
2026-02-24 05:20 - pid 3560 - [osn_cameras.py:136] - DEBUG - Band is not R, assuming it is photometry.
2026-02-24 05:20 - pid 3560 - [rawfit.py:273] - DEBUG - <RawFit 142 | OSN-T090/2022-09-18/Bias_2x2-0005.fit>: procuring local file.
2026-02-24 05:20 - pid 3560 - [rawfit.py:306] - DEBUG - <RawFit 142 | OSN-T090/2022-09-18/Bias_2x2-0005.fit>: classifying
2026-02-24 05:20 - pid 3560 - [osn_cameras.py:136] - DEBUG - Band is not R, assuming it is photometry.
2026-02-24 05:20 - pid 3560 - [rawfit.py:273] - DEBUG - <RawFit 143 | OSN-T090/2022-09-18/Bias_2x2-0004.fit>: procuring local file.
2026-02-24 05:20 - pid 3560 - [rawfit.py:306] - DEBUG - <RawFit 143 | OSN-T090/2022-09-18/Bias_2x2-0004.fit>: classifying
2026-02-24 05:20 - pid 3560 - [osn_cameras.py:136] - DEBUG - Band is not R, assuming it is photometry.
2026-02-24 05:20 - pid 3560 - [rawfit.py:273] - DEBUG - <RawFit 144 | OSN-T090/2022-09-18/Bias_2x2-0001.fit>: procuring local file.
2026-02-24 05:20 - pid 3560 - [rawfit.py:306] - DEBUG - <RawFit 144 | OSN-T090/2022-09-18/Bias_2x2-0001.fit>: classifying
2026-02-24 05:20 - pid 3560 - [osn_cameras.py:136] - DEBUG - Band is not R, assuming it is photometry.
2026-02-24 05:20 - pid 3560 - [rawfit.py:273] - DEBUG - <RawFit 145 | OSN-T090/2022-09-18/Bias_2x2-0010.fit>: procuring local file.
2026-02-24 05:20 - pid 3560 - [rawfit.py:306] - DEBUG - <RawFit 145 | OSN-T090/2022-09-18/Bias_2x2-0010.fit>: classifying
2026-02-24 05:20 - pid 3560 - [osn_cameras.py:136] - DEBUG - Band is not R, assuming it is photometry.
2026-02-24 05:20 - pid 3560 - [rawfit.py:273] - DEBUG - <RawFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: procuring local file.
2026-02-24 05:20 - pid 3560 - [rawfit.py:306] - DEBUG - <RawFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: classifying
2026-02-24 05:21 - pid 3560 - [rawfit.py:273] - DEBUG - <RawFit 147 | OSN-T090/2022-09-18/Bias_2x2-0006.fit>: procuring local file.
2026-02-24 05:21 - pid 3560 - [rawfit.py:306] - DEBUG - <RawFit 147 | OSN-T090/2022-09-18/Bias_2x2-0006.fit>: classifying
2026-02-24 05:21 - pid 3560 - [osn_cameras.py:136] - DEBUG - Band is not R, assuming it is photometry.
- telescope: OSN-T090
- night: 2022-09-18
- 12 rawfits: 11 bias, 0 flat, 1 light
- summary status: CLASSIFIED, BUILT_REDUCED, DOWNLOADED
When an epoch is created and auto_link_rawfits=True, IOP4 first attempts to
list the remote telescope archive, then it reads the local archive. It tries
to download missing files. If it cannot list the remote, but finds the
local folder for that epoch, it will just give a warning. If it fails at
both, it will return an error. This behavior can be tuned with
check_remote_list, force_redownload and fallback_to_local arguments to
create(). Keep in mind that this will create the corresponding RawFit
instances if necessary.
If you only want to fetch or create a raw fit instance you can equivalently do it with
from iop4lib.db import RawFit
rf = RawFit.create(fileloc="OSN-T090/2022-09-18/BLLac-0001R.fit")
rf
2026-02-24 05:21 - pid 3560 - [rawfit.py:224] - INFO - Setting epoch to <Epoch 11 | OSN-T090/2022-09-18>.
2026-02-24 05:21 - pid 3560 - [rawfit.py:235] - DEBUG - DB entry for OSN-T090/2022-09-18/BLLac-0001R.fit already exists, it will be used instead.
2026-02-24 05:21 - pid 3560 - [rawfit.py:273] - DEBUG - <RawFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: procuring local file.
2026-02-24 05:21 - pid 3560 - [rawfit.py:306] - DEBUG - <RawFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: classifying
- telescope: OSN-T090
- night: 2022-09-18
- filename: BLLac-0001R.fit
- instrument: AndorT90
- imgtype: LIGHT
- size: 1024x1024
- obsmode: PHOTOMETRY
- band: R
- exptime: 60.0
- flags: DOWNLOADED,CLASSIFIED,BUILT_REDUCED
Since this file was already created by the previous Epoch.create command, it gives a DEBUG message that the entry for this file already exists and re-uses it.
In this examples, epochname and fileloc are simply shorthands for
specifying telescope,night and telescope,night,filename,
in a way that matches the archive directory structure. These params uniquely
identify the observing epoch and the raw fits file, respectively.
Creating calibration frames#
Next step on a normal calibration process would be creating the master frames for the current night. This can be done with
epoch.build_master_biases()
epoch.build_master_darks()
epoch.build_master_flats()
2026-02-24 05:21 - pid 3560 - [epoch.py:394] - DEBUG - margs={'epoch': Epoch.objects.get(id=11), 'instrument': 'AndorT90', 'imgsize': '1024x1024'}
2026-02-24 05:21 - pid 3560 - [epoch.py:396] - INFO - Building Master Bias for OSN-T090/2022-09-18 | AndorT90 | 1024x1024.
2026-02-24 05:21 - pid 3560 - [masterbias.py:136] - DEBUG - DB entry for <MasterBias 11 | OSN-T090/2022-09-18 | AndorT90 | 1024x1024> already exists, using it instead.
2026-02-24 05:21 - pid 3560 - [masterbias.py:144] - DEBUG - Found 11 bias raw files for <MasterBias 11 | OSN-T090/2022-09-18 | AndorT90 | 1024x1024>.
2026-02-24 05:21 - pid 3560 - [epoch.py:387] - ERROR - No Master Dark will be built for this epoch since there are no files for it.
2026-02-24 05:21 - pid 3560 - [epoch.py:387] - ERROR - No Master Flat will be built for this epoch since there are no files for it.
This will use all existing biases, darks and flats in epoch to create all
calibration frames (for each filter, etc) using as many images as possible.
After this, we can create the reduced images for all images in the night
epoch.reduce()
2026-02-24 05:21 - pid 3560 - [reducedfit.py:121] - DEBUG - DB entry of ReducedFit for OSN-T090/2022-09-18/BLLac-0001R.fit already exists, it will be used instead.
2026-02-24 05:21 - pid 3560 - [instrument.py:391] - WARNING - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: masterflat in this epoch could not be found, attemptying adjacent epochs.
2026-02-24 05:21 - pid 3560 - [epoch.py:491] - INFO - No files to build.
or just for our image of interest
from iop4lib.db import ReducedFit
redf = ReducedFit.create(rawfit=rf)
redf
2026-02-24 05:21 - pid 3560 - [reducedfit.py:121] - DEBUG - DB entry of ReducedFit for OSN-T090/2022-09-18/BLLac-0001R.fit already exists, it will be used instead.
2026-02-24 05:21 - pid 3560 - [instrument.py:391] - WARNING - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: masterflat in this epoch could not be found, attemptying adjacent epochs.
- telescope: OSN-T090
- night: 2022-09-18
- filename: BLLac-0001R.fit
- instrument: AndorT90
- imgtype: LIGHT
- size: 1024x1024
- obsmode: PHOTOMETRY
- band: R
- exptime: 60.0
- flags: DOWNLOADED,CLASSIFIED,BUILT_REDUCED
This will automatically select the appropriate master calibration frames from its night (if they exist) or from the closest night. Otherwise, you can specify which files to use by passing it as an argument to the creation function.
By default, ReducedFit.create will not create the reduced FITS file unless
you explicitly pass auto_build=True. If you didn’t, you can do it with
redf.build_file()
2026-02-24 05:21 - pid 3560 - [instrument.py:498] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: building file
2026-02-24 05:21 - pid 3560 - [instrument.py:404] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: applying masters
2026-02-24 05:21 - pid 3560 - [instrument.py:413] - WARNING - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: no masterdark found, assuming dark current = 0, is this a CCD camera and it's cold?
2026-02-24 05:21 - pid 3560 - [instrument.py:504] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: performing astrometric calibration
2026-02-24 05:21 - pid 3560 - [astrometry.py:214] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: 27 different combinations of parameters to try.
2026-02-24 05:21 - pid 3560 - [astrometry.py:217] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: attempt 1 / 27, ({'position_hint': PositionHint(ra_deg=330.7291666666667, dec_deg=42.26611111111111, radius_deg=0.32999999999999996), 'keep_n_seg': 150, 'border_margin_px': 5, 'output_logodds_threshold': 14, 'n_rms_seg': 6.0, 'bkg_filter_size': 11, 'bkg_box_size': 16, 'seg_fwhm': 1.0, 'seg_kernel_size': None, 'npixels': 32}) ...
2026-02-24 05:21 - pid 3560 - [astrometry.py:299] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: len(pos_seg)=187
2026-02-24 05:21 - pid 3560 - [astrometry.py:302] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: Keeping only 150 brightest segments.
2026-02-24 05:21 - pid 3560 - [astrometry.py:306] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: Removing segments within 5 px from border.
2026-02-24 05:21 - pid 3560 - [astrometry.py:349] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: trying to solve astrometry with Seg Pos (n=147) (output_logodds_threshold=14).
2026-02-24 05:21 - pid 3590 - [__init__.py:215] - INFO - loaded 240 index files
2026-02-24 05:21 - pid 3590 - [__init__.py:297] - INFO - solve 1: start
2026-02-24 05:21 - pid 3590 - [__init__.py:297] - INFO - solve 1: slice=[0, 25) (1 / 5), index="5200/index-5200-14.fits" (1 / 5)
2026-02-24 05:21 - pid 3590 - [__init__.py:297] - INFO - solve 1: logodds=380.916, matches=141, conflicts=0, distractors=2, ra=330.695, dec=42.2697, scale=0.773671, index="5200/index-5200-14.fits"
2026-02-24 05:21 - pid 3560 - [astrometry.py:364] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: Seg Pos (n=147) worked.
2026-02-24 05:21 - pid 3560 - [astrometry.py:365] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: bm.index_path=PosixPath('/mnt/astrometry_cache/5200/index-5200-14.fits')
2026-02-24 05:21 - pid 3560 - [astrometry.py:366] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: bm.center_ra_deg=330.6954314398751
2026-02-24 05:21 - pid 3560 - [astrometry.py:367] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: bm.center_dec_deg=42.26972920042598
2026-02-24 05:21 - pid 3560 - [astrometry.py:368] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: bm.scale_arcsec_per_pixel=0.7736712092056637
2026-02-24 05:21 - pid 3560 - [astrometry.py:369] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: bm.logodds=380.9163513183594
2026-02-24 05:21 - pid 3560 - [astrometry.py:222] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: WCS built with attempt 1 / 27 ({'position_hint': PositionHint(ra_deg=330.7291666666667, dec_deg=42.26611111111111, radius_deg=0.32999999999999996), 'keep_n_seg': 150, 'border_margin_px': 5, 'output_logodds_threshold': 14, 'n_rms_seg': 6.0, 'bkg_filter_size': 11, 'bkg_box_size': 16, 'seg_fwhm': 1.0, 'seg_kernel_size': None, 'npixels': 32}).
2026-02-24 05:21 - pid 3560 - [astrometry.py:234] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: building summary images.
2026-02-24 05:21 - pid 3560 - [plotting.py:477] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: plotting astrometry summary image of background substraction results
2026-02-24 05:21 - pid 3560 - [plotting.py:489] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: plotting astrometry summary image of segmentation results
2026-02-24 05:21 - pid 3560 - [plotting.py:589] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: plotting astrometry summary image of astrometry results
2026-02-24 05:21 - pid 3560 - [plotting.py:215] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: found 5 catalog sources in field: [AstroSource.objects.get(name='2200+420'), AstroSource.objects.get(name='BL Lacertae C'), AstroSource.objects.get(name='BL Lacertae H'), AstroSource.objects.get(name='BL Lacertae test 2'), AstroSource.objects.get(name='BL Lacertae test 4')]
2026-02-24 05:21 - pid 3560 - [connectionpool.py:1049] - DEBUG - Starting new HTTPS connection (1): simbad.cds.unistra.fr:443
2026-02-24 05:21 - pid 3560 - [connectionpool.py:544] - DEBUG - https://simbad.cds.unistra.fr:443 "GET /simbad/sim-tap/capabilities HTTP/1.1" 200 None
2026-02-24 05:21 - pid 3560 - [connectionpool.py:544] - DEBUG - https://simbad.cds.unistra.fr:443 "POST /simbad/sim-tap/sync HTTP/1.1" 200 None
2026-02-24 05:21 - pid 3560 - [connectionpool.py:544] - DEBUG - https://simbad.cds.unistra.fr:443 "POST /simbad/sim-tap/sync HTTP/1.1" 200 None
2026-02-24 05:21 - pid 3560 - [connectionpool.py:544] - DEBUG - https://simbad.cds.unistra.fr:443 "POST /simbad/sim-tap/sync HTTP/1.1" 200 None
2026-02-24 05:21 - pid 3560 - [logger.py:235] - WARNING - AstropyDeprecationWarning: "epoch" was deprecated in version 0.4.8 and will be removed in a future version.
2026-02-24 05:21 - pid 3560 - [connectionpool.py:544] - DEBUG - https://simbad.cds.unistra.fr:443 "POST /simbad/sim-tap/sync HTTP/1.1" 200 None
2026-02-24 05:21 - pid 3560 - [instrument.py:443] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: saving WCSs to FITS header.
2026-02-24 05:21 - pid 3560 - [instrument.py:515] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: astrometric calibration was successful.
2026-02-24 05:21 - pid 3560 - [instrument.py:518] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: searching for sources in field...
2026-02-24 05:21 - pid 3560 - [instrument.py:521] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: found 5 sources in field.
WARNING: AstropyDeprecationWarning: "epoch" was deprecated in version 0.4.8 and will be removed in a future version. [iop4lib.utils]
This will create the reduced FITS file by applying the calibration frames to
the raw image, and will give it an appropriate WCS. To check the result, with
the astrometry included, you can use the utility function
plot_preview_astrometry:
from iop4lib.utils.plotting import plot_preview_astrometry
plot_preview_astrometry(redf)
2026-02-24 05:21 - pid 3560 - [plotting.py:215] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: found 5 catalog sources in field: [AstroSource.objects.get(name='2200+420'), AstroSource.objects.get(name='BL Lacertae C'), AstroSource.objects.get(name='BL Lacertae H'), AstroSource.objects.get(name='BL Lacertae test 2'), AstroSource.objects.get(name='BL Lacertae test 4')]
In the images, we can see the coordiante frames the positions of the sources in the catalog that appear in the image.
Since the image it is a photometry image, we can directly compute the relative photometry results with
redf.compute_relative_photometry()
from iop4lib.db import PhotoPolResult
PhotoPolResult.objects.filter(reducedfits__in=[redf]).first()
2026-02-24 05:21 - pid 3560 - [instrument.py:772] - DEBUG - astrosource_S={AstroSource.objects.get(name='BL Lacertae test 2'), AstroSource.objects.get(name='BL Lacertae test 4'), AstroSource.objects.get(name='2200+420'), AstroSource.objects.get(name='BL Lacertae C'), AstroSource.objects.get(name='BL Lacertae H')}
2026-02-24 05:21 - pid 3560 - [instrument.py:781] - DEBUG - target=AstroSource.objects.get(name='2200+420')
2026-02-24 05:21 - pid 3560 - [instrument.py:816] - DEBUG - box_size=17
2026-02-24 05:21 - pid 3560 - [instrument.py:836] - DEBUG - ReducedFit 146: 2200+420 O: WCS centroid distance = 1.3 px
2026-02-24 05:21 - pid 3560 - [instrument.py:844] - DEBUG - ReducedFit 146 [2200+420] Gaussian FWHM: 3.0805366153278237 px
2026-02-24 05:21 - pid 3560 - [instrument.py:663] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: computing aperture photometries for <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit> (target_fwhm = 3.1 px, aperpix = 3.9 px, r_in = 6.5 px, r_out = 11.8 px).
2026-02-24 05:21 - pid 3560 - [instrument.py:559] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: computing aperture photometry for <AstroSource 2200+420> O
2026-02-24 05:21 - pid 3560 - [instrument.py:587] - DEBUG - box_size=17
2026-02-24 05:21 - pid 3560 - [instrument.py:607] - DEBUG - ReducedFit 146: 2200+420 O: WCS centroid distance = 1.3 px
2026-02-24 05:21 - pid 3560 - [aperphotresult.py:78] - DEBUG - AperPhotResult for <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>, <AstroSource 2200+420>, 3.9245503559750823, O already exists, it will be used instead.
2026-02-24 05:21 - pid 3560 - [instrument.py:559] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: computing aperture photometry for <AstroSource BL Lacertae C> O
2026-02-24 05:21 - pid 3560 - [instrument.py:587] - DEBUG - box_size=17
2026-02-24 05:21 - pid 3560 - [instrument.py:607] - DEBUG - ReducedFit 146: BL Lacertae C O: WCS centroid distance = 2.2 px
2026-02-24 05:21 - pid 3560 - [aperphotresult.py:78] - DEBUG - AperPhotResult for <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>, <AstroSource BL Lacertae C>, 3.9245503559750823, O already exists, it will be used instead.
2026-02-24 05:21 - pid 3560 - [instrument.py:559] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: computing aperture photometry for <AstroSource BL Lacertae H> O
2026-02-24 05:21 - pid 3560 - [instrument.py:587] - DEBUG - box_size=17
2026-02-24 05:21 - pid 3560 - [instrument.py:607] - DEBUG - ReducedFit 146: BL Lacertae H O: WCS centroid distance = 2.0 px
2026-02-24 05:21 - pid 3560 - [aperphotresult.py:78] - DEBUG - AperPhotResult for <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>, <AstroSource BL Lacertae H>, 3.9245503559750823, O already exists, it will be used instead.
2026-02-24 05:21 - pid 3560 - [instrument.py:559] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: computing aperture photometry for <AstroSource BL Lacertae test 2> O
2026-02-24 05:21 - pid 3560 - [instrument.py:587] - DEBUG - box_size=17
2026-02-24 05:21 - pid 3560 - [instrument.py:607] - DEBUG - ReducedFit 146: BL Lacertae test 2 O: WCS centroid distance = 1.0 px
2026-02-24 05:21 - pid 3560 - [aperphotresult.py:78] - DEBUG - AperPhotResult for <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>, <AstroSource BL Lacertae test 2>, 3.9245503559750823, O already exists, it will be used instead.
2026-02-24 05:21 - pid 3560 - [instrument.py:559] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: computing aperture photometry for <AstroSource BL Lacertae test 4> O
2026-02-24 05:21 - pid 3560 - [instrument.py:587] - DEBUG - box_size=17
2026-02-24 05:21 - pid 3560 - [instrument.py:607] - DEBUG - ReducedFit 146: BL Lacertae test 4 O: WCS centroid distance = 1.6 px
2026-02-24 05:21 - pid 3560 - [aperphotresult.py:78] - DEBUG - AperPhotResult for <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>, <AstroSource BL Lacertae test 4>, 3.9245503559750823, O already exists, it will be used instead.
2026-02-24 05:21 - pid 3560 - [instrument.py:669] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: computing relative photometry.
2026-02-24 05:21 - pid 3560 - [photopolresult.py:205] - DEBUG - Db entry for photopolresult already exists for reducedfits=[ReducedFit.objects.get(id=146)], astrosource=AstroSource.objects.get(name='2200+420') and reduction=REDUCTIONMETHODS.RELPHOT, using it instead.
2026-02-24 05:21 - pid 3560 - [photopolresult.py:205] - DEBUG - Db entry for photopolresult already exists for reducedfits=[ReducedFit.objects.get(id=146)], astrosource=AstroSource.objects.get(name='BL Lacertae C') and reduction=REDUCTIONMETHODS.RELPHOT, using it instead.
2026-02-24 05:21 - pid 3560 - [photopolresult.py:205] - DEBUG - Db entry for photopolresult already exists for reducedfits=[ReducedFit.objects.get(id=146)], astrosource=AstroSource.objects.get(name='BL Lacertae H') and reduction=REDUCTIONMETHODS.RELPHOT, using it instead.
2026-02-24 05:21 - pid 3560 - [photopolresult.py:205] - DEBUG - Db entry for photopolresult already exists for reducedfits=[ReducedFit.objects.get(id=146)], astrosource=AstroSource.objects.get(name='BL Lacertae test 2') and reduction=REDUCTIONMETHODS.RELPHOT, using it instead.
2026-02-24 05:21 - pid 3560 - [photopolresult.py:205] - DEBUG - Db entry for photopolresult already exists for reducedfits=[ReducedFit.objects.get(id=146)], astrosource=AstroSource.objects.get(name='BL Lacertae test 4') and reduction=REDUCTIONMETHODS.RELPHOT, using it instead.
2026-02-24 05:21 - pid 3560 - [instrument.py:738] - DEBUG - <ReducedFit 146 | OSN-T090/2022-09-18/BLLac-0001R.fit>: calibrating <PhotoPolResult 17 | PHOTOMETRY R 2200+420 JD 2459841.461865625>
2026-02-24 05:21 - pid 3560 - [__init__.py:541] - DEBUG - calibrating 2200+420 with 4 calibrators
2026-02-24 05:21 - pid 3560 - [__init__.py:542] - DEBUG - calib_mag_zp_array=array([25.9888068 , 25.9503289 , 25.92426876, 25.99256664])
2026-02-24 05:21 - pid 3560 - [__init__.py:543] - DEBUG - calib_mag_zp_array_err=array([0.05005056, 0.06004021, 0.02978732, 0.01520347])
2026-02-24 05:21 - pid 3560 - [__init__.py:463] - DEBUG - zp_avg=25.963992774977985, zp_std=0.028270572757198777
2026-02-24 05:21 - pid 3560 - [__init__.py:514] - DEBUG - zp_avg=25.963992774977985, zp_std=0.028270572757198777
2026-02-24 05:21 - pid 3560 - [__init__.py:557] - DEBUG - result.mag=13.355979088606063, result.mag_err=0.03541387818529953
<PhotoPolResult(id: 17
reducedfits: [146]
AndorT90 PHOTOMETRY R / 2200+420
JD: 2459841.46187 (2022-09-18 23:05:05.190)
mag: 13.356 ± 0.035)>
These results can already be inspected in the web interface.