Skip to content

Commit

Permalink
Merge branch 'develop' into fix-authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
bourque authored Oct 16, 2020
2 parents d84c4d5 + 0f49c08 commit 0b7edeb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The JWST Quicklook Application (`JWQL`) is a database-driven web application and

Official API documentation can be found on [ReadTheDocs](https://jwql.readthedocs.io)

The `jwql` application is currently under heavy development. The `1.0` release is expected in 2019. Currently, a development version of the web application can be found at [https://dljwql.stsci.edu](https://dljwql.stsci.edu).
The `jwql` application is currently under heavy development. The `1.0` release is expected in 2021. Currently, a development version of the web application can be found at [https://dljwql.stsci.edu](https://dljwql.stsci.edu).

## Installation for Users

Expand Down
25 changes: 7 additions & 18 deletions jwql/instrument_monitors/common_monitors/dark_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,31 +441,20 @@ def most_recent_search(self):
Date (in MJD) of the ending range of the previous MAST query
where the dark monitor was run.
"""
query = session.query(self.query_table).filter(self.query_table.aperture==self.aperture). \
filter(self.query_table.run_monitor==True)

sub_query = session.query(self.query_table.aperture,
func.max(self.query_table.end_time_mjd).label('maxdate')
).group_by(self.query_table.aperture).subquery('t2')
dates = np.zeros(0)
for instance in query:
dates = np.append(dates, instance.end_time_mjd)

# Note that "self.query_table.run_monitor == True" below is
# intentional. Switching = to "is" results in an error in the query.
query = session.query(self.query_table).join(
sub_query,
and_(
self.query_table.aperture == self.aperture,
self.query_table.end_time_mjd == sub_query.c.maxdate,
self.query_table.run_monitor == True
)
).all()

query_count = len(query)
query_count = len(dates)
if query_count == 0:
query_result = 57357.0 # a.k.a. Dec 1, 2015 == CV3
logging.info(('\tNo query history for {}. Beginning search date will be set to {}.'
.format(self.aperture, query_result)))
elif query_count > 1:
raise ValueError('More than one "most recent" query?')
else:
query_result = query[0].end_time_mjd
query_result = np.max(dates)

return query_result

Expand Down

0 comments on commit 0b7edeb

Please sign in to comment.