Skip to content

Commit

Permalink
added updating rms root location when state is loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
dvida committed Apr 24, 2024
1 parent bf50c14 commit 2b99b74
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Utils/SkyFit2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, \
Expand Down Expand Up @@ -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"):
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 2b99b74

Please sign in to comment.