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
2025-04-04 03:28 - pid 4161 - [epoch.py:262] - DEBUG - Epoch for OSN-T090/2022-09-18 already exists in the DB, it will be used instead.
2025-04-04 03:28 - pid 4161 - [rawfit.py:229] - DEBUG - DB entry for OSN-T090/2022-09-18/Bias_2x2-0009.fit already exists, it will be used instead.
2025-04-04 03:28 - pid 4161 - [rawfit.py:229] - DEBUG - DB entry for OSN-T090/2022-09-18/Bias_2x2-0001.fit already exists, it will be used instead.
2025-04-04 03:28 - pid 4161 - [rawfit.py:229] - DEBUG - DB entry for OSN-T090/2022-09-18/Bias_2x2-0002.fit already exists, it will be used instead.
2025-04-04 03:28 - pid 4161 - [rawfit.py:229] - DEBUG - DB entry for OSN-T090/2022-09-18/Bias_2x2-0008.fit already exists, it will be used instead.
2025-04-04 03:28 - pid 4161 - [rawfit.py:229] - DEBUG - DB entry for OSN-T090/2022-09-18/Bias_2x2-0010.fit already exists, it will be used instead.
2025-04-04 03:28 - pid 4161 - [rawfit.py:229] - DEBUG - DB entry for OSN-T090/2022-09-18/Bias_2x2-0005.fit already exists, it will be used instead.
2025-04-04 03:28 - pid 4161 - [rawfit.py:229] - DEBUG - DB entry for OSN-T090/2022-09-18/BLLac-0001R.fit already exists, it will be used instead.
2025-04-04 03:28 - pid 4161 - [rawfit.py:229] - DEBUG - DB entry for OSN-T090/2022-09-18/Bias_2x2-0006.fit already exists, it will be used instead.
2025-04-04 03:28 - pid 4161 - [rawfit.py:229] - DEBUG - DB entry for OSN-T090/2022-09-18/Bias_2x2-0004.fit already exists, it will be used instead.
2025-04-04 03:28 - pid 4161 - [rawfit.py:229] - DEBUG - DB entry for OSN-T090/2022-09-18/Bias_2x2-0003.fit already exists, it will be used instead.
2025-04-04 03:28 - pid 4161 - [rawfit.py:229] - DEBUG - DB entry for OSN-T090/2022-09-18/Bias_2x2-0011.fit already exists, it will be used instead.
2025-04-04 03:28 - pid 4161 - [rawfit.py:229] - DEBUG - DB entry for OSN-T090/2022-09-18/Bias_2x2-0007.fit already exists, it will be used instead.
2025-04-04 03:28 - pid 4161 - [rawfit.py:267] - DEBUG - <RawFit 136 | OSN-T090/2022-09-18/Bias_2x2-0009.fit>: procuring local file.
2025-04-04 03:28 - pid 4161 - [rawfit.py:300] - DEBUG - <RawFit 136 | OSN-T090/2022-09-18/Bias_2x2-0009.fit>: classifying
2025-04-04 03:28 - pid 4161 - [osn_cameras.py:136] - DEBUG - Band is not R, assuming it is photometry.
2025-04-04 03:28 - pid 4161 - [rawfit.py:267] - DEBUG - <RawFit 137 | OSN-T090/2022-09-18/Bias_2x2-0001.fit>: procuring local file.
2025-04-04 03:28 - pid 4161 - [rawfit.py:300] - DEBUG - <RawFit 137 | OSN-T090/2022-09-18/Bias_2x2-0001.fit>: classifying
2025-04-04 03:28 - pid 4161 - [osn_cameras.py:136] - DEBUG - Band is not R, assuming it is photometry.
2025-04-04 03:28 - pid 4161 - [rawfit.py:267] - DEBUG - <RawFit 138 | OSN-T090/2022-09-18/Bias_2x2-0002.fit>: procuring local file.
2025-04-04 03:28 - pid 4161 - [rawfit.py:300] - DEBUG - <RawFit 138 | OSN-T090/2022-09-18/Bias_2x2-0002.fit>: classifying
2025-04-04 03:28 - pid 4161 - [osn_cameras.py:136] - DEBUG - Band is not R, assuming it is photometry.
2025-04-04 03:28 - pid 4161 - [rawfit.py:267] - DEBUG - <RawFit 139 | OSN-T090/2022-09-18/Bias_2x2-0008.fit>: procuring local file.
2025-04-04 03:28 - pid 4161 - [rawfit.py:300] - DEBUG - <RawFit 139 | OSN-T090/2022-09-18/Bias_2x2-0008.fit>: classifying
2025-04-04 03:28 - pid 4161 - [osn_cameras.py:136] - DEBUG - Band is not R, assuming it is photometry.
2025-04-04 03:28 - pid 4161 - [rawfit.py:267] - DEBUG - <RawFit 140 | OSN-T090/2022-09-18/Bias_2x2-0010.fit>: procuring local file.
2025-04-04 03:28 - pid 4161 - [rawfit.py:300] - DEBUG - <RawFit 140 | OSN-T090/2022-09-18/Bias_2x2-0010.fit>: classifying
2025-04-04 03:28 - pid 4161 - [osn_cameras.py:136] - DEBUG - Band is not R, assuming it is photometry.
2025-04-04 03:28 - pid 4161 - [rawfit.py:267] - DEBUG - <RawFit 141 | OSN-T090/2022-09-18/Bias_2x2-0005.fit>: procuring local file.
2025-04-04 03:28 - pid 4161 - [rawfit.py:300] - DEBUG - <RawFit 141 | OSN-T090/2022-09-18/Bias_2x2-0005.fit>: classifying
2025-04-04 03:28 - pid 4161 - [osn_cameras.py:136] - DEBUG - Band is not R, assuming it is photometry.
2025-04-04 03:28 - pid 4161 - [rawfit.py:267] - DEBUG - <RawFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: procuring local file.
2025-04-04 03:28 - pid 4161 - [rawfit.py:300] - DEBUG - <RawFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: classifying
2025-04-04 03:28 - pid 4161 - [rawfit.py:267] - DEBUG - <RawFit 143 | OSN-T090/2022-09-18/Bias_2x2-0006.fit>: procuring local file.
2025-04-04 03:28 - pid 4161 - [rawfit.py:300] - DEBUG - <RawFit 143 | OSN-T090/2022-09-18/Bias_2x2-0006.fit>: classifying
2025-04-04 03:28 - pid 4161 - [osn_cameras.py:136] - DEBUG - Band is not R, assuming it is photometry.
2025-04-04 03:28 - pid 4161 - [rawfit.py:267] - DEBUG - <RawFit 144 | OSN-T090/2022-09-18/Bias_2x2-0004.fit>: procuring local file.
2025-04-04 03:28 - pid 4161 - [rawfit.py:300] - DEBUG - <RawFit 144 | OSN-T090/2022-09-18/Bias_2x2-0004.fit>: classifying
2025-04-04 03:28 - pid 4161 - [osn_cameras.py:136] - DEBUG - Band is not R, assuming it is photometry.
2025-04-04 03:28 - pid 4161 - [rawfit.py:267] - DEBUG - <RawFit 145 | OSN-T090/2022-09-18/Bias_2x2-0003.fit>: procuring local file.
2025-04-04 03:28 - pid 4161 - [rawfit.py:300] - DEBUG - <RawFit 145 | OSN-T090/2022-09-18/Bias_2x2-0003.fit>: classifying
2025-04-04 03:28 - pid 4161 - [osn_cameras.py:136] - DEBUG - Band is not R, assuming it is photometry.
2025-04-04 03:28 - pid 4161 - [rawfit.py:267] - DEBUG - <RawFit 146 | OSN-T090/2022-09-18/Bias_2x2-0011.fit>: procuring local file.
2025-04-04 03:28 - pid 4161 - [rawfit.py:300] - DEBUG - <RawFit 146 | OSN-T090/2022-09-18/Bias_2x2-0011.fit>: classifying
2025-04-04 03:28 - pid 4161 - [osn_cameras.py:136] - DEBUG - Band is not R, assuming it is photometry.
2025-04-04 03:28 - pid 4161 - [rawfit.py:267] - DEBUG - <RawFit 147 | OSN-T090/2022-09-18/Bias_2x2-0007.fit>: procuring local file.
2025-04-04 03:28 - pid 4161 - [rawfit.py:300] - DEBUG - <RawFit 147 | OSN-T090/2022-09-18/Bias_2x2-0007.fit>: classifying
2025-04-04 03:28 - pid 4161 - [osn_cameras.py:136] - DEBUG - Band is not R, assuming it is photometry.
Epoch(id 11):
- telescope: OSN-T090
- night: 2022-09-18
- 12 rawfits: 11 bias, 0 flat, 1 light
- summary status: BUILT_REDUCED, CLASSIFIED, 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
2025-04-04 03:28 - pid 4161 - [rawfit.py:218] - INFO - Setting epoch to <Epoch 11 | OSN-T090/2022-09-18>.
2025-04-04 03:28 - pid 4161 - [rawfit.py:229] - DEBUG - DB entry for OSN-T090/2022-09-18/BLLac-0001R.fit already exists, it will be used instead.
2025-04-04 03:28 - pid 4161 - [rawfit.py:267] - DEBUG - <RawFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: procuring local file.
2025-04-04 03:28 - pid 4161 - [rawfit.py:300] - DEBUG - <RawFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: classifying
RawFit(id=142):
- 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()
2025-04-04 03:28 - pid 4161 - [epoch.py:394] - DEBUG - margs={'epoch': Epoch.objects.get(id=11), 'instrument': 'AndorT90', 'imgsize': '1024x1024'}
2025-04-04 03:28 - pid 4161 - [epoch.py:396] - INFO - Building Master Bias for OSN-T090/2022-09-18 | AndorT90 | 1024x1024.
2025-04-04 03:28 - pid 4161 - [masterbias.py:136] - DEBUG - DB entry for <MasterBias 11 | OSN-T090/2022-09-18 | AndorT90 | 1024x1024> already exists, using it instead.
2025-04-04 03:28 - pid 4161 - [masterbias.py:144] - DEBUG - Found 11 bias raw files for <MasterBias 11 | OSN-T090/2022-09-18 | AndorT90 | 1024x1024>.
2025-04-04 03:28 - pid 4161 - [epoch.py:387] - ERROR - No Master Dark will be built for this epoch since there are no files for it.
2025-04-04 03:28 - pid 4161 - [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()
2025-04-04 03:28 - pid 4161 - [reducedfit.py:121] - DEBUG - DB entry of ReducedFit for OSN-T090/2022-09-18/BLLac-0001R.fit already exists, it will be used instead.
2025-04-04 03:28 - pid 4161 - [instrument.py:374] - WARNING - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: masterflat in this epoch could not be found, attemptying adjacent epochs.
2025-04-04 03:28 - pid 4161 - [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
2025-04-04 03:28 - pid 4161 - [reducedfit.py:121] - DEBUG - DB entry of ReducedFit for OSN-T090/2022-09-18/BLLac-0001R.fit already exists, it will be used instead.
2025-04-04 03:28 - pid 4161 - [instrument.py:374] - WARNING - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: masterflat in this epoch could not be found, attemptying adjacent epochs.
ReducedFit(id=142):
- 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()
2025-04-04 03:28 - pid 4161 - [instrument.py:481] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: building file
2025-04-04 03:28 - pid 4161 - [instrument.py:387] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: applying masters
2025-04-04 03:28 - pid 4161 - [instrument.py:396] - WARNING - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: no masterdark found, assuming dark current = 0, is this a CCD camera and it's cold?
2025-04-04 03:28 - pid 4161 - [instrument.py:487] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: performing astrometric calibration
2025-04-04 03:28 - pid 4161 - [astrometry.py:185] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: 27 different combinations of parameters to try.
2025-04-04 03:28 - pid 4161 - [astrometry.py:188] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: attempt 1 / 27, ({'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, 'allsky': False, 'position_hint': PositionHint(ra_deg=330.7291666666667, dec_deg=42.26611111111111, radius_deg=0.32999999999999996)}) ...
2025-04-04 03:28 - pid 4161 - [astrometry.py:281] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: len(pos_seg)=187
2025-04-04 03:28 - pid 4161 - [astrometry.py:284] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: Keeping only 150 brightest segments.
2025-04-04 03:28 - pid 4161 - [astrometry.py:288] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: Removing segments within 5 px from border.
2025-04-04 03:28 - pid 4161 - [astrometry.py:318] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: trying to solve astrometry with Seg Pos (n=147) (output_logodds_threshold=14).
2025-04-04 03:28 - pid 4189 - [__init__.py:215] - INFO - loaded 240 index files
2025-04-04 03:28 - pid 4189 - [__init__.py:297] - INFO - solve 1: start
2025-04-04 03:28 - pid 4189 - [__init__.py:297] - INFO - solve 1: slice=[0, 25) (1 / 5), index="5200/index-5200-14.fits" (1 / 5)
2025-04-04 03:28 - pid 4189 - [__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"
2025-04-04 03:28 - pid 4161 - [astrometry.py:333] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: Seg Pos (n=147) worked.
2025-04-04 03:28 - pid 4161 - [astrometry.py:334] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: bm.index_path=PosixPath('/mnt/astrometry_cache/5200/index-5200-14.fits')
2025-04-04 03:28 - pid 4161 - [astrometry.py:335] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: bm.center_ra_deg=330.6954314398751
2025-04-04 03:28 - pid 4161 - [astrometry.py:336] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: bm.center_dec_deg=42.26972920042598
2025-04-04 03:28 - pid 4161 - [astrometry.py:337] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: bm.scale_arcsec_per_pixel=0.7736712092056637
2025-04-04 03:28 - pid 4161 - [astrometry.py:338] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: bm.logodds=380.9163513183594
2025-04-04 03:28 - pid 4161 - [astrometry.py:198] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: WCS built with attempt 1 / 27 ({'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, 'allsky': False, 'position_hint': PositionHint(ra_deg=330.7291666666667, dec_deg=42.26611111111111, radius_deg=0.32999999999999996)}).
2025-04-04 03:28 - pid 4161 - [astrometry.py:210] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: building summary images.
2025-04-04 03:28 - pid 4161 - [plotting.py:476] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: plotting astrometry summary image of background substraction results
2025-04-04 03:28 - pid 4161 - [plotting.py:488] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: plotting astrometry summary image of segmentation results
2025-04-04 03:28 - pid 4161 - [plotting.py:582] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: plotting astrometry summary image of astrometry results
2025-04-04 03:28 - pid 4161 - [plotting.py:214] - DEBUG - <ReducedFit 142 | 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')]
2025-04-04 03:28 - pid 4161 - [connectionpool.py:1049] - DEBUG - Starting new HTTPS connection (1): simbad.cds.unistra.fr:443
2025-04-04 03:28 - pid 4161 - [connectionpool.py:544] - DEBUG - https://simbad.cds.unistra.fr:443 "GET /simbad/sim-tap/capabilities HTTP/1.1" 200 None
2025-04-04 03:28 - pid 4161 - [connectionpool.py:544] - DEBUG - https://simbad.cds.unistra.fr:443 "POST /simbad/sim-tap/sync HTTP/1.1" 200 None
2025-04-04 03:28 - pid 4161 - [connectionpool.py:544] - DEBUG - https://simbad.cds.unistra.fr:443 "POST /simbad/sim-tap/sync HTTP/1.1" 200 None
2025-04-04 03:28 - pid 4161 - [connectionpool.py:544] - DEBUG - https://simbad.cds.unistra.fr:443 "POST /simbad/sim-tap/sync HTTP/1.1" 200 None
2025-04-04 03:28 - pid 4161 - [logger.py:235] - WARNING - AstropyDeprecationWarning: "epoch" was deprecated in version 0.4.8 and will be removed in a future version. 
2025-04-04 03:28 - pid 4161 - [connectionpool.py:544] - DEBUG - https://simbad.cds.unistra.fr:443 "POST /simbad/sim-tap/sync HTTP/1.1" 200 None
2025-04-04 03:28 - pid 4161 - [plotting.py:308] - DEBUG - Simbad query failed, ignoring: 'OTYPE'
2025-04-04 03:28 - pid 4161 - [instrument.py:426] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: saving WCSs to FITS header.
2025-04-04 03:28 - pid 4161 - [instrument.py:498] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: astrometric calibration was successful.
2025-04-04 03:28 - pid 4161 - [instrument.py:501] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: searching for sources in field...
2025-04-04 03:28 - pid 4161 - [instrument.py:504] - DEBUG - <ReducedFit 142 | 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)
2025-04-04 03:28 - pid 4161 - [plotting.py:214] - DEBUG - <ReducedFit 142 | 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')]
../_images/8e0d5b0c512fac375c44a7e700e527dd22f1831133ee8c67f33d6d996cb78f81.png

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()
2025-04-04 03:28 - pid 4161 - [instrument.py:716] - 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')}
2025-04-04 03:28 - pid 4161 - [instrument.py:734] - DEBUG - ReducedFit 142 [2200+420] Gaussian FWHM: 4.3 px
2025-04-04 03:28 - pid 4161 - [instrument.py:615] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: computing aperture photometries for <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit> (target_fwhm = 4.3 px, aperpix = 5.5 px, r_in = 9.2 px, r_out = 16.6 px).
2025-04-04 03:28 - pid 4161 - [instrument.py:535] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: computing aperture photometry for <AstroSource 2200+420>
2025-04-04 03:28 - pid 4161 - [logger.py:235] - WARNING - The fit may be unsuccessful; check fit_info['message'] for more information.
2025-04-04 03:28 - pid 4161 - [instrument.py:569] - DEBUG - ReducedFit 142: 2200+420 O: WCS centroid distance = 1.2 px
2025-04-04 03:28 - pid 4161 - [aperphotresult.py:78] - DEBUG - AperPhotResult for <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>, <AstroSource 2200+420>, 5.5305764687222165, O already exists, it will be used instead.
2025-04-04 03:28 - pid 4161 - [instrument.py:535] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: computing aperture photometry for <AstroSource BL Lacertae C>
2025-04-04 03:28 - pid 4161 - [logger.py:235] - WARNING - The fit may be unsuccessful; check fit_info['message'] for more information.
2025-04-04 03:28 - pid 4161 - [instrument.py:569] - DEBUG - ReducedFit 142: BL Lacertae C O: WCS centroid distance = 2.1 px
2025-04-04 03:28 - pid 4161 - [aperphotresult.py:78] - DEBUG - AperPhotResult for <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>, <AstroSource BL Lacertae C>, 5.5305764687222165, O already exists, it will be used instead.
2025-04-04 03:28 - pid 4161 - [instrument.py:535] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: computing aperture photometry for <AstroSource BL Lacertae H>
2025-04-04 03:28 - pid 4161 - [instrument.py:569] - DEBUG - ReducedFit 142: BL Lacertae H O: WCS centroid distance = 1.9 px
2025-04-04 03:28 - pid 4161 - [aperphotresult.py:78] - DEBUG - AperPhotResult for <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>, <AstroSource BL Lacertae H>, 5.5305764687222165, O already exists, it will be used instead.
2025-04-04 03:28 - pid 4161 - [instrument.py:535] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: computing aperture photometry for <AstroSource BL Lacertae test 2>
2025-04-04 03:28 - pid 4161 - [logger.py:235] - WARNING - The fit may be unsuccessful; check fit_info['message'] for more information.
2025-04-04 03:28 - pid 4161 - [instrument.py:569] - DEBUG - ReducedFit 142: BL Lacertae test 2 O: WCS centroid distance = 1.0 px
2025-04-04 03:28 - pid 4161 - [aperphotresult.py:78] - DEBUG - AperPhotResult for <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>, <AstroSource BL Lacertae test 2>, 5.5305764687222165, O already exists, it will be used instead.
2025-04-04 03:28 - pid 4161 - [instrument.py:535] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: computing aperture photometry for <AstroSource BL Lacertae test 4>
2025-04-04 03:28 - pid 4161 - [logger.py:235] - WARNING - The fit may be unsuccessful; check fit_info['message'] for more information.
2025-04-04 03:28 - pid 4161 - [instrument.py:569] - DEBUG - ReducedFit 142: BL Lacertae test 4 O: WCS centroid distance = 1.6 px
2025-04-04 03:28 - pid 4161 - [aperphotresult.py:78] - DEBUG - AperPhotResult for <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>, <AstroSource BL Lacertae test 4>, 5.5305764687222165, O already exists, it will be used instead.
2025-04-04 03:28 - pid 4161 - [instrument.py:621] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: computing relative photometry.
2025-04-04 03:28 - pid 4161 - [photopolresult.py:204] - DEBUG - Db entry for photopolresult already exists for reducedfits=[ReducedFit.objects.get(id=142)], astrosource=AstroSource.objects.get(name='2200+420') and reduction=REDUCTIONMETHODS.RELPHOT, using it instead.
2025-04-04 03:28 - pid 4161 - [photopolresult.py:204] - DEBUG - Db entry for photopolresult already exists for reducedfits=[ReducedFit.objects.get(id=142)], astrosource=AstroSource.objects.get(name='BL Lacertae C') and reduction=REDUCTIONMETHODS.RELPHOT, using it instead.
2025-04-04 03:28 - pid 4161 - [photopolresult.py:204] - DEBUG - Db entry for photopolresult already exists for reducedfits=[ReducedFit.objects.get(id=142)], astrosource=AstroSource.objects.get(name='BL Lacertae H') and reduction=REDUCTIONMETHODS.RELPHOT, using it instead.
2025-04-04 03:28 - pid 4161 - [photopolresult.py:204] - DEBUG - Db entry for photopolresult already exists for reducedfits=[ReducedFit.objects.get(id=142)], astrosource=AstroSource.objects.get(name='BL Lacertae test 2') and reduction=REDUCTIONMETHODS.RELPHOT, using it instead.
2025-04-04 03:28 - pid 4161 - [photopolresult.py:204] - DEBUG - Db entry for photopolresult already exists for reducedfits=[ReducedFit.objects.get(id=142)], astrosource=AstroSource.objects.get(name='BL Lacertae test 4') and reduction=REDUCTIONMETHODS.RELPHOT, using it instead.
2025-04-04 03:28 - pid 4161 - [instrument.py:688] - DEBUG - <ReducedFit 142 | OSN-T090/2022-09-18/BLLac-0001R.fit>: calibrating <PhotoPolResult 17 | PHOTOMETRY R 2200+420 JD 2459841.461865625>
2025-04-04 03:28 - pid 4161 - [__init__.py:630] - DEBUG - calibrating 2200+420 with 4 calibrators
2025-04-04 03:28 - pid 4161 - [__init__.py:631] - DEBUG - calib_mag_zp_array=array([26.03613402, 25.99995087, 25.97336358, 26.0418197 ])
2025-04-04 03:28 - pid 4161 - [__init__.py:632] - DEBUG - calib_mag_zp_array_err=array([0.05006203, 0.0600485 , 0.03017639, 0.01628214])
2025-04-04 03:28 - pid 4161 - [__init__.py:552] - DEBUG - zp_avg=26.012817042930223, zp_std=0.027870008628573348
2025-04-04 03:28 - pid 4161 - [__init__.py:603] - DEBUG - zp_avg=26.012817042930223, zp_std=0.027870008628573348
WARNING: The fit may be unsuccessful; check fit_info['message'] for more information. [astropy.modeling.fitting]
WARNING: The fit may be unsuccessful; check fit_info['message'] for more information. [astropy.modeling.fitting]
WARNING: The fit may be unsuccessful; check fit_info['message'] for more information. [astropy.modeling.fitting]
WARNING: The fit may be unsuccessful; check fit_info['message'] for more information. [astropy.modeling.fitting]
<PhotoPolResult(id: 17
    reducedfits: [142]
    AndorT90 PHOTOMETRY R / 2200+420
    JD: 2459841.46187 (2022-09-18 23:05:05.190)
    mag: 13.341 ± 0.035)>

These results can already be inspected in the web interface.