Skip to content

Commit

Permalink
correct calculation for atlas forced phot limits
Browse files Browse the repository at this point in the history
  • Loading branch information
griffin-h committed Apr 9, 2024
1 parent a647c17 commit 40aeeb7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tom_dataproducts/processors/atlas_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from astropy import units
import astropy.io.ascii
from astropy.time import Time, TimezoneInfo
import numpy as np

from tom_dataproducts.data_processor import DataProcessor
from tom_dataproducts.exceptions import InvalidFileFormatException
Expand Down Expand Up @@ -63,17 +64,16 @@ def _process_photometry_from_plaintext(self, data_product):
value = {
'timestamp': time.to_datetime(timezone=utc),
'filter': str(datum['F']),
'error': float(datum['dm']),
'telescope': 'ATLAS',
}
# If the signal is in the noise, set the non-detection limit to the
# absolute value of the reported magnitude.
# If the signal is in the noise, calculate the non-detection limit from the reported flux uncertainty.
# see https://fallingstar-data.com/forcedphot/resultdesc/
signal_to_noise = abs(float(datum['uJy']))/abs(float(datum['duJy']))
signal_to_noise = float(datum['uJy']) / float(datum['duJy'])
if signal_to_noise <= signal_to_noise_cutoff:
value['limit'] = abs(float(datum['m']))
value['limit'] = 23.9 - 2.5 * np.log10(signal_to_noise_cutoff * float(datum['duJy']))
else:
value['magnitude'] = abs(float(datum['m']))
value['magnitude'] = float(datum['m'])
value['error'] = float(datum['dm'])

photometry.append(value)
except Exception as e:
Expand Down

0 comments on commit 40aeeb7

Please sign in to comment.