Skip to content

Fitting_Process.cal_astrometry does not work when there is no Sersic component #8

@TakumiSTanaka

Description

@TakumiSTanaka

Fitting_Process.cal_astrometry() does not work when the model is composed only of Sersic components.

457 self.final_result_ps[i]['wcs_RaDec'] = target_ra, target_dec
458 self.final_result_ps[i]['position_xy'] = x, y
460 for i in range(len(self.final_result_galaxy)):
461 x, y = -self.final_result_galaxy[i]['center_x']/deltaPix, self.final_result_galaxy[i]['center_y']/deltaPix
462 x_orgframe = x + target_pos[0] + 1

AttributeError: 'FittingProcess' object has no attribute 'final_result_galaxy'

This error is likely because the code is refering self.final_result_galaxy at line 460, but the Sersic component is not included in the model. Similarly, the same issue might occur when the point source component is not included in the model (this case, an error should be occur at line 452). To resolve this, how about adding conditional checks just before lines 452 and 460 to compute the astrometry only if the point source and Sersic components are included in the model?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions