Skip to content

Commit

Permalink
pep8speaks
Browse files Browse the repository at this point in the history
  • Loading branch information
mfixstsci committed Oct 13, 2023
1 parent 385ec3d commit 6cdb3f7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 deletions.
2 changes: 1 addition & 1 deletion jwql/website/apps/jwql/monitor_pages/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .monitor_cosmic_rays_bokeh import CosmicRayMonitor
from .monitor_cosmic_rays_bokeh import CosmicRayMonitor
34 changes: 16 additions & 18 deletions jwql/website/apps/jwql/monitor_pages/monitor_readnoise_bokeh.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,28 @@

class ReadnoiseMonitorData():
"""Class to hold bias data to be plotted
Parameters
----------
instrument : str
Instrument name (e.g. nircam)
Attributes
----------
instrument : str
Instrument name (e.g. nircam)
aperture : str
Aperture name (e.g. apername)
"""

def __init__(self, instrument, aperture):
self.instrument = instrument
self.aperture = aperture
self.load_data()


def identify_tables(self):
"""Determine which database tables to use for the given instrument"""

Expand Down Expand Up @@ -96,7 +95,7 @@ def __init__(self, instrument):


class ReadNoisePlotTab():
"""Class to make instrument/aperture panels
"""Class to make instrument/aperture panels
"""
def __init__(self, instrument, aperture):
self.instrument = instrument
Expand All @@ -108,10 +107,10 @@ def __init__(self, instrument, aperture):
self.plot_readnoise_difference_image()
self.plot_readnoise_histogram()

self.tab = Panel(child=column(row(*self.amp_plots),
self.diff_image_plot,
self.readnoise_histogram),
title= self.aperture)
self.tab = Panel(child=column(row(*self.amp_plots),
self.diff_image_plot,
self.readnoise_histogram),
title=self.aperture)

def plot_readnoise_amplifers(self):

Expand All @@ -122,7 +121,7 @@ def plot_readnoise_amplifers(self):
amp_plot.xaxis[0].ticker.desired_num_ticks = 4

readnoise_vals = np.array([getattr(result, 'amp{}_mean'.format(amp)) for result in self.db.query_results])

filenames = [os.path.basename(result.uncal_filename).replace('_uncal.fits', '') for result in self.db.query_results]
expstarts_iso = np.array([result.expstart for result in self.db.query_results])
expstarts = np.array([datetime.strptime(date, '%Y-%m-%dT%H:%M:%S.%f') for date in expstarts_iso])
Expand All @@ -138,10 +137,10 @@ def plot_readnoise_amplifers(self):
))

amp_plot.add_tools(HoverTool(tooltips=[("file", "@file"),
("time", "@expstarts"),
("nints", "@nints"),
("ngroups", "@ngroups"),
("readnoise", "@readnoise")]))
("time", "@expstarts"),
("nints", "@nints"),
("ngroups", "@ngroups"),
("readnoise", "@readnoise")]))

amp_plot.circle(x='expstarts', y='readnoise', source=source)

Expand All @@ -155,7 +154,7 @@ def plot_readnoise_difference_image(self):

# Update the readnoise difference image and histogram, if data exists

self.diff_image_plot = figure(title='Readnoise Difference (most recent dark - pipeline reffile)',
self.diff_image_plot = figure(title='Readnoise Difference (most recent dark - pipeline reffile)',
height=500, width=500, sizing_mode='scale_width')

if len(self.db.query_results) != 0:
Expand Down Expand Up @@ -185,7 +184,6 @@ def plot_readnoise_histogram(self):
y_range=(hist_yr_start, hist_yr_end),
sizing_mode='scale_width')


source = ColumnDataSource(data=dict(
x=diff_image_bin_centers,
y=diff_image_n,
Expand Down
2 changes: 1 addition & 1 deletion jwql/website/apps/jwql/monitor_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def bad_pixel_monitor(request, inst):

context = {
'inst': inst,
}
}

return render(request, template, context)

Expand Down

0 comments on commit 6cdb3f7

Please sign in to comment.