Skip to content

Commit

Permalink
Add default -1.75° true North offset + associated warning
Browse files Browse the repository at this point in the history
Ticket #88
  • Loading branch information
avigan committed Dec 19, 2020
1 parent a1c9e94 commit 7ba7cf9
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 10 deletions.
19 changes: 18 additions & 1 deletion sphere/IFS.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,22 @@ def __new__(cls, path, log_level='info', sphere_handler=None):

reduction._logger.info('Creating IFS reduction at path {}'.format(path))

#
# v1.4 - True North correction change
#
reduction._logger.warning('#################################################################')
reduction._logger.warning('Starting in the present version of the pipeline, the default ')
reduction._logger.warning('-1.75° true North offset is automatically added to the derotation')
reduction._logger.warning('angles. The offset value can be modified in the configuration of ')
reduction._logger.warning('the reduction: ')
reduction._logger.warning(' ')
reduction._logger.warning(' >>> reduction.config[\'true_north\'] = xxx ')
reduction._logger.warning(' ')
reduction._logger.warning('To avoid any issues, make sure to: ')
reduction._logger.warning(' * either reprocess data previously processed with version <1.4 ')
reduction._logger.warning(' * or take into account the offset in your astrometric analysis ')
reduction._logger.warning('#################################################################')

#
# configuration
#
Expand Down Expand Up @@ -1051,7 +1067,8 @@ def sort_frames(self):
toolbox.compute_times(frames_info, logger=self._logger)

# compute angles (ra, dec, parang)
ret = toolbox.compute_angles(frames_info, logger=self._logger)
true_north = self.config['true_north']
ret = toolbox.compute_angles(frames_info, true_north, logger=self._logger)
if ret == sphere.ERROR:
self._update_recipe_status('sort_frames', sphere.ERROR)
self._status = sphere.FATAL
Expand Down
19 changes: 18 additions & 1 deletion sphere/IRDIS/ImagingReduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,22 @@ def __new__(cls, path, log_level='info', sphere_handler=None):

reduction._logger.info('Creating IRDIS imaging reduction at path {}'.format(path))

#
# v1.4 - True North correction change
#
reduction._logger.warning('#################################################################')
reduction._logger.warning('Starting in the present version of the pipeline, the default ')
reduction._logger.warning('-1.75° true North offset is automatically added to the derotation')
reduction._logger.warning('angles. The offset value can be modified in the configuration of ')
reduction._logger.warning('the reduction: ')
reduction._logger.warning(' ')
reduction._logger.warning(' >>> reduction.config[\'true_north\'] = xxx ')
reduction._logger.warning(' ')
reduction._logger.warning('To avoid any issues, make sure to: ')
reduction._logger.warning(' * either reprocess data previously processed with version <1.4 ')
reduction._logger.warning(' * or take into account the offset in your astrometric analysis ')
reduction._logger.warning('#################################################################')

#
# configuration
#
Expand Down Expand Up @@ -674,7 +690,8 @@ def sort_frames(self):
toolbox.compute_times(frames_info, logger=self._logger)

# compute angles (ra, dec, parang)
ret = toolbox.compute_angles(frames_info, logger=self._logger)
true_north = self.config['true_north']
ret = toolbox.compute_angles(frames_info, true_north, logger=self._logger)
if ret == sphere.ERROR:
self._update_recipe_status('sort_frames', sphere.ERROR)
self._status = sphere.FATAL
Expand Down
3 changes: 2 additions & 1 deletion sphere/IRDIS/SpectroReduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,8 @@ def sort_frames(self):
toolbox.compute_times(frames_info, logger=self._logger)

# compute angles (ra, dec, parang)
ret = toolbox.compute_angles(frames_info, logger=self._logger)
true_north = self.config['true_north']
ret = toolbox.compute_angles(frames_info, true_north, logger=self._logger)
if ret == sphere.ERROR:
self._update_recipe_status('sort_frames', sphere.ERROR)
self._status = sphere.FATAL
Expand Down
3 changes: 3 additions & 0 deletions sphere/instruments/IFS.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ default_center = (290//2, 290//2)
# field orientation offset
orientation_offset = 102

# true North
true_north = -1.75

#
# default reduction parameters
#
Expand Down
3 changes: 3 additions & 0 deletions sphere/instruments/IRDIS.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ default_center = ((485, 520), (486, 508))
# field orientation offset
orientation_offset = 0

# true North
true_north = -1.75

[calibration-spectro]

# LRS parameters
Expand Down
18 changes: 11 additions & 7 deletions sphere/toolbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def compute_times(frames_info, logger=_log):
frames_info['MJD'] = mjd


def compute_angles(frames_info, logger=_log):
def compute_angles(frames_info, true_north, logger=_log):
'''
Compute the various angles associated to frames: RA, DEC, parang,
pupil offset, final derotation angle
Expand All @@ -183,9 +183,11 @@ def compute_angles(frames_info, logger=_log):
frames_info : dataframe
The data frame with all the information on science frames
true_north : float
True North offset correction, in degrees
logger : logHandler object
Log handler for the reduction. Default is root logger
'''

logger.debug('> compute angles')
Expand Down Expand Up @@ -262,11 +264,13 @@ def compute_angles(frames_info, logger=_log):
#
# Derotation angles
#
# PA_on-sky = PA_detector + PARANGLE + True_North + PUP_OFFSET + INSTRUMENT_OFFSET
# PUP_OFFSET = -135.99 ± 0.11
# PA_on-sky = PA_detector + PARANGLE + True_North + PUP_OFFSET + INSTRUMENT_OFFSET + TRUE_NORTH
#
# PUP_OFFSET = +135.99 ± 0.11
# INSTRUMENT_OFFSET
# IFS = +100.48 ± 0.10
# IRD = 0.00 ± 0.00
# * IFS = -100.48 ± 0.10
# * IRD = 0.00 ± 0.00
# TRUE_NORTH = -1.75 ± 0.08
#
if len(instrument) != 1:
logger.error('Sequence is mixing different instruments: {0}'.format(instrument))
Expand Down Expand Up @@ -298,7 +302,7 @@ def compute_angles(frames_info, logger=_log):
frames_info['PUPIL OFFSET'] = pupoff + instru_offset

# final derotation value
frames_info['DEROT ANGLE'] = frames_info['PARANG'] + pupoff + instru_offset
frames_info['DEROT ANGLE'] = frames_info['PARANG'] + pupoff + instru_offset + true_north

return sphere.SUCCESS

Expand Down

0 comments on commit 7ba7cf9

Please sign in to comment.