diff --git a/Utils/SkyFit2.py b/Utils/SkyFit2.py index 10ce4369a..c984ac8f4 100644 --- a/Utils/SkyFit2.py +++ b/Utils/SkyFit2.py @@ -15,6 +15,7 @@ import matplotlib.pyplot as plt import pyqtgraph as pg +import RMS from RMS.Astrometry.ApplyAstrometry import xyToRaDecPP, raDecToXYPP, \ rotationWrtHorizon, rotationWrtHorizonToPosAngle, computeFOVSize, photomLine, photometryFit, \ rotationWrtStandard, rotationWrtStandardToPosAngle, correctVignetting, \ @@ -2270,6 +2271,9 @@ def loadState(self, dir_path, state_name, beginning_time=None): # Set the dir path in case it changed self.dir_path = dir_path + # Update the RMS root directory + self.config.rms_root_dir = os.path.abspath(os.path.join(os.path.dirname(RMS.__file__), os.pardir)) + # Update img_handle parameters if hasattr(self, "img_handle"): @@ -3943,6 +3947,11 @@ def loadCatalogStars(self, lim_mag): """ + # If the star catalog path doesn't exist, use the catalog available in the repository + if not os.path.isdir(self.config.star_catalog_path): + self.config.star_catalog_path = os.path.join(self.config.rms_root_dir, 'Catalogs') + print("Updated catalog path to: ", self.config.star_catalog_path) + # Load catalog stars catalog_stars, self.mag_band_string, self.config.star_catalog_band_ratios = StarCatalog.readStarCatalog( self.config.star_catalog_path, self.config.star_catalog_file, lim_mag=lim_mag,