Skip to content

Commit

Permalink
Merge pull request #25 from Smithsonian/dev
Browse files Browse the repository at this point in the history
Patching a bug in the new release
  • Loading branch information
dpesce authored Mar 11, 2024
2 parents 006be78 + eb6644d commit 1503ecf
Showing 1 changed file with 18 additions and 17 deletions.
35 changes: 18 additions & 17 deletions ngehtsim/obs/obs_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,23 +687,24 @@ def observe(self, input_model, addnoise=True, addgains=True, gainamp=0.04, opaci

# flag the daytime observations, if desired
if flagday:

# get location of this site
lon = const.known_longitudes[site]
lat = const.known_latitudes[site]
elev = const.known_elevations[site]
location = EarthLocation.from_geodetic(lon,lat,height=elev)

# get the altitude of the Sun over time
jd = obs.mjd + 2400000.5 + (times/24.0)
timehere = Time(jd, format='jd')
altazframe = AltAz(obstime=timehere, location=location)
sun_altaz = get_sun(timehere).transform_to(altazframe)
alt = sun_altaz.alt.value

# mark as to-be-flagged all times for which the Sun is above the horizon
ind_daytime = (((t1 == site) | (t2 == site)) & (sun_altaz.alt.value > 0.0))
uptime_mask[ind_daytime] = False
if site != 'space':

# get location of this site
lon = const.known_longitudes[site]
lat = const.known_latitudes[site]
elev = const.known_elevations[site]
location = EarthLocation.from_geodetic(lon,lat,height=elev)

# get the altitude of the Sun over time
jd = obs.mjd + 2400000.5 + (times/24.0)
timehere = Time(jd, format='jd')
altazframe = AltAz(obstime=timehere, location=location)
sun_altaz = get_sun(timehere).transform_to(altazframe)
alt = sun_altaz.alt.value

# mark as to-be-flagged all times for which the Sun is above the horizon
ind_daytime = (((t1 == site) | (t2 == site)) & (sun_altaz.alt.value > 0.0))
uptime_mask[ind_daytime] = False

# flag the times that fall outside of the specified station uptime window
if site in list(self.station_uptimes.keys()):
Expand Down

0 comments on commit 1503ecf

Please sign in to comment.