Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

U/danielsf/fix iers interp #91

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions tests/testGalSimInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
import lsst.afw.image as afwImage
from lsst.sims.coordUtils import clean_up_lsst_camera

# Tell astropy not to download this file again, even if it's out of date.
# Tell astropy not to download the IERS tables
from astropy.utils import iers
iers.conf.auto_max_age = None
iers.conf.auto_download=False

ROOT = os.path.abspath(os.path.dirname(__file__))

Expand Down Expand Up @@ -1253,20 +1253,20 @@ def test_hour_angle(self):
BandpassDict.loadTotalBandpassesFromFiles(),
None, apply_sensor_model=False)

mjd = 59877.15107861111027887
mjd = 57780.0 # pick an MJD that does not require interpolation
ra = 55.52107440528638449
self.assertAlmostEqual(math.cos(math.radians(321.62974517903774)),
self.assertAlmostEqual(math.cos(math.radians(0.19508880821259567)),
math.cos(math.radians(gs_interpreter.getHourAngle(mjd, ra))),
places=4)

self.assertAlmostEqual(math.sin(math.radians(321.62974517903774)),
self.assertAlmostEqual(math.sin(math.radians(0.19508880821259567)),
math.sin(math.radians(gs_interpreter.getHourAngle(mjd, ra))),
places=4)

# Pick a MJD such that GAST = -observatory geodetic longitude,
# so that local hour angle = 360 - ra.
mjd = 58265.3194197049 - gs_interpreter.observatory.getLongitude().asDegrees()/360.
self.assertAlmostEqual(-ra, gs_interpreter.getHourAngle(mjd, ra),
mjd = 57779.84565546585
self.assertAlmostEqual(360.0-ra, gs_interpreter.getHourAngle(mjd, ra),
places=4)


Expand Down