website

api_views.py

Defines the views for the jwql REST API.

The functions within serve as views for the jwql REST API. Currently, the following services are available:

  • Return a list of all proposals (api/proposals/)

  • Return a list of proposals for a given instrument (/api/<instrument>/proposals/)

  • Return a list of filenames for a given proposal (/api/<proposal>/filenames/)

  • Return a list of filenames for a given rootname (/api/<rootname>/filenames/)

  • Return a list of preview images for a given instrument (/api/<instrument>/preview_images/)

  • Return a list of preview images for a given proposal (/api/<proposal>/preview_images/)

  • Return a list of preview images for a given rootname (/api/<rootname>/preview_images/)

  • Return a list of thumbnails for a given instrument (/api/<instrument>/thumbnails/)

  • Return a list of thumbnails for a given proposal (/api/<proposal>/thumbnails/)

  • Return a list of thumbnails for a given rootname (/api/<rootname>/thumbnails/)

Where <instrument> is the instrument of interest (e.g. NIRCam), <proposal> is the five-digit proposal number of interest (e.g. 86600), and <rootname> is the rootname of interest (e.g. jw86600008001_02101_00007_guider2). Note that <rootname> need not be the full rootname, but can be any shortened version, (e.g. jw8660000801_02101, or jw8660); using an abbreviated version will return all filenames associated with the rootname up to that point.

Authors

  • Matthew Bourque

  • Teagan King

Use

This module is called in urls.py as such:

from django.urls import path
from . import api_views
urlpatterns = [path('web/path/to/view/', api_views.view_name, name='view_name')]

References

For more information please see:

https://docs.djangoproject.com/en/2.0/topics/http/views/

jwql.website.apps.jwql.api_views.all_proposals(request)[source]

Return a list of proposals for the mission

Parameters:
requestHttpRequest object

Incoming request from the webpage

Returns:
JsonResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.api_views.filenames_by_proposal(request, proposal)[source]

Return a list of filenames for the given proposal

Parameters:
requestHttpRequest object

Incoming request from the webpage

proposalstr

The five-digit proposal number (e.g. 88600)

Returns:
JsonResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.api_views.filenames_by_rootname(request, rootname)[source]

Return a list of filenames for the given rootname

Parameters:
requestHttpRequest object

Incoming request from the webpage

rootnamestr

The rootname of interest (e.g. jw86600008001_02101_00007_guider2).

Returns:
JsonResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.api_views.instrument_proposals(request, inst)[source]

Return a list of proposals for the given instrument

Parameters:
requestHttpRequest object

Incoming request from the webpage

inststr

The instrument of interest. The name of the instrument must mach one of the following: (nircam, NIRCam, niriss, NIRISS, nirspec, NIRSpec, miri, MIRI, fgs, FGS).

Returns:
JsonResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.api_views.preview_images_by_instrument(request, inst)[source]

Return a list of available preview images in the filesystem for the given instrument.

Parameters:
requestHttpRequest object

Incoming request from the webpage

inststr

The instrument of interest. The name of the instrument must mach one of the following: (nircam, NIRCam, niriss, NIRISS, nirspec, NIRSpec, miri, MIRI, fgs, FGS).

Returns:
JsonResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.api_views.preview_images_by_proposal(request, proposal)[source]

Return a list of available preview images in the filesystem for the given proposal.

Parameters:
requestHttpRequest object

Incoming request from the webpage

proposalstr

The five-digit proposal number (e.g. 88600)

Returns:
JsonResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.api_views.preview_images_by_rootname(request, rootname)[source]

Return a list of available preview images in the filesystem for the given rootname.

Parameters:
requestHttpRequest object

Incoming request from the webpage

rootnamestr

The rootname of interest (e.g. jw86600008001_02101_00007_guider2).

Returns:
JsonResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.api_views.thumbnails_by_instrument(request, inst)[source]

Return a list of available thumbnails in the filesystem for the given instrument.

Parameters:
requestHttpRequest object

Incoming request from the webpage

inststr

The instrument of interest. The name of the instrument must match one of the following: (nircam, NIRCam, niriss, NIRISS, nirspec, NIRSpec, miri, MIRI, fgs, FGS).

Returns:
JsonResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.api_views.thumbnails_by_proposal(request, proposal)[source]

Return a list of available thumbnails in the filesystem for the given proposal.

Parameters:
requestHttpRequest object

Incoming request from the webpage

proposalstr

The five-digit proposal number (e.g. 88600)

Returns:
JsonResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.api_views.thumbnails_by_rootname(request, rootname)[source]

Return a list of available thumbnails in the filesystem for the given rootname.

Parameters:
requestHttpRequest object

Incoming request from the webpage

rootnamestr

The rootname of interest (e.g. jw86600008001_02101_00007_guider2).

Returns:
JsonResponse object

Outgoing response sent to the webpage

bokeh_dashboard.py

Bokeh based dashboard to monitor the status of the JWQL Application. The dashboard tracks a variety of metrics including number of total files per day, number of files per instrument, filesystem storage space, etc.

The dashboard also includes a timestamp parameter. This allows users to narrow metrics displayed by the dashboard to within a specific date range.

Authors

  • Mees B. Fix

Use

The dashboard can be called from a python environment via the following import statements:

from bokeh_dashboard impoer GeneralDashboard
from monitor_template import secondary_function

Dependencies

The user must have a configuration file named config.json placed in the jwql directory.

class jwql.website.apps.jwql.bokeh_dashboard.GeneralDashboard(delta_t=None)[source]
dashboard_anomaly_per_instrument()[source]

Create figure for number of anamolies for each JWST instrument.

Parameters:
None
Returns:
tabsbokeh.models.widgets.widget.Widget

A figure with tabs for each instrument.

dashboard_exposure_count_by_filter()[source]

Create figure for number of files per filter for each JWST instrument.

Parameters:
None
Returns:
tabsbokeh.models.widgets.widget.Widget

A figure with tabs for each instrument.

dashboard_files_per_day()[source]

Scatter of number of files per day added to JWQLDB

Parameters:
None
Returns:
tabsbokeh.models.widgets.widget.Widget

A figure with tabs for each instrument.

dashboard_filetype_bar_chart()[source]

Build bar chart of files based off of type

Parameters:
None
Returns:
tabsbokeh.models.widgets.widget.Widget

A figure with tabs for each instrument.

dashboard_instrument_pie_chart()[source]

Create piechart showing number of files per instrument

Parameters:
None
Returns:
plotbokeh.plotting.figure

Pie chart figure

dashboard_monitor_tracking()[source]

Build bokeh table to show status and when monitors were run.

Parameters:
None
Returns:
table_columnsnumpy.ndarray

Numpy array of column names from monitor table.

table_valuesnumpy.ndarray

Numpy array of column values from monitor table.

make_panel(x_value, top, instrument, title, x_axis_label)[source]

Make tab panel for tablulated figure.

Parameters:
x_valuestr

Name of value for bar chart.

topint

Sum associated with x_label

instrumentstr

Title for the tab

titlestr

Figure title

x_axis_labelstr

Name of the x axis.

Returns:
tabbokeh.models.widgets.widget.Widget

Return single instrument panel

jwql.website.apps.jwql.bokeh_dashboard.disable_scientific_notation(figure)[source]

Disable y axis scientific notation.

Parameters:
figure: bokeh figure object
Returns:
None

context_processors.py

Provides functions that define context inherent to all views.

The functions within this module define context that will be included in requests, in addition to any specific context provided in the view.

Authors

  • Matthew Bourque

Use

This module is defined under the TEMPLATES.OPTIONS setting in settings.py, e.g.:

TEMPLATES = [
    {'OPTIONS': {'context_processors': ['jwql.website.apps.jwql.context_processors.base_context'],},}
]

As such, it will automatically be executed upon each request.

jwql.website.apps.jwql.context_processors.base_context(request)[source]

Provide the context needed for the base.html template.

Parameters:
requestHttpRequest object

Incoming request from the webpage

Returns:
contextdict

A dictionary containing data needed to render the base.html template

data_containers.py

Various functions to collect data to be used by the views of the jwql app.

This module contains several functions that assist in collecting and producing various data to be rendered in views.py for use by the jwql app.

Authors

  • Lauren Chambers

  • Matthew Bourque

  • Teagan King

Use

The functions within this module are intended to be imported and used by views.py, e.g.:

::

from .data_containers import get_proposal_info

jwql.website.apps.jwql.data_containers.build_table(tablename)[source]

Create Pandas dataframe from JWQLDB table.

Parameters:
tablenamestr

Name of JWQL database table name.

Returns:
table_meta_datapandas.DataFrame

Pandas data frame version of JWQL database table.

Container for Miri datatrending dashboard and components

Returns:
variablesint

nonsense

dashboardlist

A list containing the JavaScript and HTML content for the dashboard

jwql.website.apps.jwql.data_containers.get_acknowledgements()[source]

Returns a list of individuals who are acknowledged on the about page.

The list is generated by reading in the contents of the jwql README file. In this way, the website will automatically update with updates to the README file.

Returns:
acknowledgementslist

A list of individuals to be acknowledged.

jwql.website.apps.jwql.data_containers.get_all_proposals()[source]

Return a list of all proposals that exist in the filesystem.

Returns:
proposalslist

A list of proposal numbers for all proposals that exist in the filesystem

jwql.website.apps.jwql.data_containers.get_current_flagged_anomalies(rootname, instrument)[source]

Return a list of currently flagged anomalies for the given rootname

Parameters:
rootnamestr

The rootname of interest (e.g. jw86600008001_02101_00001_guider2/)

Returns:
current_anomalieslist

A list of currently flagged anomalies for the given rootname (e.g. ['snowball', 'crosstalk'])

jwql.website.apps.jwql.data_containers.get_dashboard_components(request)[source]

Build and return dictionaries containing components and html needed for the dashboard.

Returns:
dashboard_componentsdict

A dictionary containing components needed for the dashboard.

dashboard_htmldict

A dictionary containing full HTML needed for the dashboard.

jwql.website.apps.jwql.data_containers.get_edb_components(request)[source]

Return dictionary with content needed for the EDB page.

Parameters:
requestHttpRequest object

Incoming request from the webpage

Returns:
edb_componentsdict

Dictionary with the required components

jwql.website.apps.jwql.data_containers.get_expstart(instrument, rootname)[source]

Return the exposure start time (expstart) for the given rootname.

The expstart is gathered from a query to the astroquery.mast service.

Parameters:
instrumentstr

The instrument of interest (e.g. FGS).

rootnamestr

The rootname of the observation of interest (e.g. jw86700006001_02101_00006_guider1).

Returns:
expstartfloat

The exposure start time of the observation (in MJD).

jwql.website.apps.jwql.data_containers.get_filenames_by_instrument(instrument, restriction='all')[source]

Returns a list of filenames that match the given instrument.

Parameters:
instrumentstr

The instrument of interest (e.g. FGS).

restrictionstr

If all, all filenames will be returned. If public, only publicly-available filenames will be returned. If proprietary, only proprietary filenames will be returned.

Returns:
filenameslist

A list of files that match the given instrument.

jwql.website.apps.jwql.data_containers.get_filenames_by_proposal(proposal)[source]

Return a list of filenames that are available in the filesystem for the given proposal.

Parameters:
proposalstr

The one- to five-digit proposal number (e.g. 88600).

Returns:
filenameslist

A list of filenames associated with the given proposal.

jwql.website.apps.jwql.data_containers.get_filenames_by_rootname(rootname)[source]

Return a list of filenames that are part of the given rootname.

Parameters:
rootnamestr

The rootname of interest (e.g. jw86600008001_02101_00007_guider2).

Returns:
filenameslist

A list of filenames associated with the given rootname.

jwql.website.apps.jwql.data_containers.get_header_info(filename)[source]

Return the header information for a given filename.

Parameters:
filenamestr

The name of the file of interest, without the extension (e.g. 'jw86600008001_02101_00007_guider2_uncal').

Returns:
header_infodict

The FITS headers of the extensions in the given file.

jwql.website.apps.jwql.data_containers.get_image_info(file_root, rewrite)[source]

Build and return a dictionary containing information for a given file_root.

Parameters:
file_rootstr

The rootname of the file of interest (e.g. jw86600008001_02101_00007_guider2).

rewritebool

True if the corresponding JPEG needs to be rewritten, False if not.

Returns:
image_infodict

A dictionary containing various information for the given file_root.

jwql.website.apps.jwql.data_containers.get_instrument_proposals(instrument)[source]

Return a list of proposals for the given instrument

Parameters:
instrumentstr

Name of the JWST instrument, with first letter capitalized (e.g. Fgs)

Returns:
proposalslist

List of proposals for the given instrument

jwql.website.apps.jwql.data_containers.get_jwqldb_table_view_components(request)[source]

Renders view for JWQLDB table viewer.

Parameters:
requestHttpRequest object

Incoming request from the webpage

Returns:
table_datapandas.DataFrame

Pandas data frame of JWQL database table

table_namestr

Name of database table selected by user

jwql.website.apps.jwql.data_containers.get_preview_images_by_instrument(inst)[source]

Return a list of preview images available in the filesystem for the given instrument.

Parameters:
inststr

The instrument of interest (e.g. NIRCam).

Returns:
preview_imageslist

A list of preview images available in the filesystem for the given instrument.

jwql.website.apps.jwql.data_containers.get_preview_images_by_proposal(proposal)[source]

Return a list of preview images available in the filesystem for the given proposal.

Parameters:
proposalstr

The one- to five-digit proposal number (e.g. 88600).

Returns:
preview_imageslist

A list of preview images available in the filesystem for the given proposal.

jwql.website.apps.jwql.data_containers.get_preview_images_by_rootname(rootname)[source]

Return a list of preview images available in the filesystem for the given rootname.

Parameters:
rootnamestr

The rootname of interest (e.g. jw86600008001_02101_00007_guider2).

Returns:
preview_imageslist

A list of preview images available in the filesystem for the given rootname.

jwql.website.apps.jwql.data_containers.get_proposal_info(filepaths)[source]

Builds and returns a dictionary containing various information about the proposal(s) that correspond to the given filepaths.

The information returned contains such things as the number of proposals, the paths to the corresponding thumbnails, and the total number of files.

Parameters:
filepathslist

A list of full paths to files of interest.

Returns:
proposal_infodict

A dictionary containing various information about the proposal(s) and files corresponding to the given filepaths.

jwql.website.apps.jwql.data_containers.get_thumbnails_all_instruments(parameters)[source]

Return a list of thumbnails available in the filesystem for all instruments given requested MAST parameters and queried anomalies.

Parameters:
parameters: dict
A dictionary containing the following keys, some of which are dictionaries:

instruments apertures filters detector effexptm_min effexptm_max anomalies

Returns:
thumbnailslist

A list of thumbnails available in the filesystem for the given instrument.

jwql.website.apps.jwql.data_containers.get_thumbnails_by_instrument(inst)[source]

Return a list of thumbnails available in the filesystem for the given instrument.

Parameters:
inststr

The instrument of interest (e.g. NIRCam).

Returns:
preview_imageslist

A list of thumbnails available in the filesystem for the given instrument.

jwql.website.apps.jwql.data_containers.get_thumbnails_by_proposal(proposal)[source]

Return a list of thumbnails available in the filesystem for the given proposal.

Parameters:
proposalstr

The one- to five-digit proposal number (e.g. 88600).

Returns:
thumbnailslist

A list of thumbnails available in the filesystem for the given proposal.

jwql.website.apps.jwql.data_containers.get_thumbnails_by_rootname(rootname)[source]

Return a list of preview images available in the filesystem for the given rootname.

Parameters:
rootnamestr

The rootname of interest (e.g. jw86600008001_02101_00007_guider2).

Returns:
thumbnailslist

A list of preview images available in the filesystem for the given rootname.

jwql.website.apps.jwql.data_containers.log_into_mast(request)[source]

Login via astroquery.mast if user authenticated in web app.

Parameters:
requestHttpRequest object

Incoming request from the webpage

Container for Miri datatrending dashboard and components

Returns:
variablesint

nonsense

dashboardlist

A list containing the JavaScript and HTML content for the dashboard

jwql.website.apps.jwql.data_containers.random_404_page()[source]

Randomly select one of the various 404 templates for JWQL

Returns:
random_templatestr

Filename of the selected template

jwql.website.apps.jwql.data_containers.thumbnails_ajax(inst, proposal=None)[source]

Generate a page that provides data necessary to render the thumbnails template.

Parameters:
inststr

Name of JWST instrument

proposalstr (optional)

Number of APT proposal to filter

Returns:
data_dictdict

Dictionary of data needed for the thumbnails template

jwql.website.apps.jwql.data_containers.thumbnails_query_ajax(rootnames)[source]

Generate a page that provides data necessary to render the thumbnails template.

Parameters:
rootnameslist of strings (optional)

Rootname of APT proposal to filter

Returns:
data_dictdict

Dictionary of data needed for the thumbnails template

db.py

Connects to the jwql database.

This module is the primary interface between the jwql webapp and the jwql database. It uses SQLAlchemy to start a session with the database, and provides class methods that perform useful queries on that database (for example, getting the names of all the files associated with a certain instrument).

Authors

  • Lauren Chambers

Use

This module can be used as such:

from db import DatabaseConnection
db_connect = DatabaseConnection()
data = db_connect.get_filenames_for_instrument('NIRCam')

Dependencies

The user must have a configuration file named config.json placed in jwql/utils/ directory.

class jwql.website.apps.jwql.db.DatabaseConnection(db_type, instrument=None)[source]

Facilitates connection with the jwql database.

Attributes:
ObservationWebtestobj

Class instance in an “automap” schema corresponding to the observationwebtest database table

sessionobj

Session with the database that enables querying

get_files_for_instrument(instrument)[source]

Given an instrument, query the database for all filenames and paths associated with said instrument

Parameters:
instrumentstr

Name of JWST instrument

Returns:
filepaths: list

List of all filepaths in database for the provided instrument

filenames: list

List of all filenames in database for the provided instrument

init_MAST(instrument=None)[source]

Determine the necessary service string to query the MAST database.

init_SQL()[source]

Start SQLAlchemy session with the jwql database

forms.py

Defines the forms for the jwql web app.

Django allows for an object-oriented model representation of forms for users to provide input through HTTP POST methods. This module defines all of the forms that are used across the various webpages used for the JWQL application.

Authors

  • Lauren Chambers

  • Johannes Sahlmann

  • Matthew Bourque

  • Teagan King

Use

This module is used within views.py as such:

from .forms import FileSearchForm
def view_function(request):
    form = FileSearchForm(request.POST or None)

    if request.method == 'POST':
        if form.is_valid():
            # Process form input and redirect
            return redirect(new_url)

    template = 'some_template.html'
    context = {'form': form, ...}
    return render(request, template, context)

References

For more information please see:

https://docs.djangoproject.com/en/2.1/topics/forms/

Dependencies

The user must have a configuration file named config.json placed in the ``jwql` directory.

class jwql.website.apps.jwql.forms.AnomalyQueryForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Form validation for the anomaly viewing tool

anomaly = 'other'
aperture = 'FGS2_FULL'
base_fields = {'exp_time_max': <django.forms.fields.DecimalField object>, 'exp_time_min': <django.forms.fields.DecimalField object>, 'fgs_anomalies': <django.forms.fields.MultipleChoiceField object>, 'fgs_aper': <django.forms.fields.MultipleChoiceField object>, 'fgs_detector': <django.forms.fields.MultipleChoiceField object>, 'fgs_exptype': <django.forms.fields.MultipleChoiceField object>, 'fgs_filt': <django.forms.fields.MultipleChoiceField object>, 'fgs_grating': <django.forms.fields.MultipleChoiceField object>, 'fgs_readpatt': <django.forms.fields.MultipleChoiceField object>, 'instrument': <django.forms.fields.MultipleChoiceField object>, 'miri_anomalies': <django.forms.fields.MultipleChoiceField object>, 'miri_aper': <django.forms.fields.MultipleChoiceField object>, 'miri_detector': <django.forms.fields.MultipleChoiceField object>, 'miri_exptype': <django.forms.fields.MultipleChoiceField object>, 'miri_filt': <django.forms.fields.MultipleChoiceField object>, 'miri_grating': <django.forms.fields.MultipleChoiceField object>, 'miri_readpatt': <django.forms.fields.MultipleChoiceField object>, 'nircam_anomalies': <django.forms.fields.MultipleChoiceField object>, 'nircam_aper': <django.forms.fields.MultipleChoiceField object>, 'nircam_detector': <django.forms.fields.MultipleChoiceField object>, 'nircam_exptype': <django.forms.fields.MultipleChoiceField object>, 'nircam_filt': <django.forms.fields.MultipleChoiceField object>, 'nircam_grating': <django.forms.fields.MultipleChoiceField object>, 'nircam_readpatt': <django.forms.fields.MultipleChoiceField object>, 'niriss_anomalies': <django.forms.fields.MultipleChoiceField object>, 'niriss_aper': <django.forms.fields.MultipleChoiceField object>, 'niriss_detector': <django.forms.fields.MultipleChoiceField object>, 'niriss_exptype': <django.forms.fields.MultipleChoiceField object>, 'niriss_filt': <django.forms.fields.MultipleChoiceField object>, 'niriss_grating': <django.forms.fields.MultipleChoiceField object>, 'niriss_readpatt': <django.forms.fields.MultipleChoiceField object>, 'nirspec_anomalies': <django.forms.fields.MultipleChoiceField object>, 'nirspec_aper': <django.forms.fields.MultipleChoiceField object>, 'nirspec_detector': <django.forms.fields.MultipleChoiceField object>, 'nirspec_exptype': <django.forms.fields.MultipleChoiceField object>, 'nirspec_filt': <django.forms.fields.MultipleChoiceField object>, 'nirspec_grating': <django.forms.fields.MultipleChoiceField object>, 'nirspec_readpatt': <django.forms.fields.MultipleChoiceField object>}
calculate_submit = <UnboundField(SubmitField, (), {})>
clean_inst()[source]
declared_fields = {'exp_time_max': <django.forms.fields.DecimalField object>, 'exp_time_min': <django.forms.fields.DecimalField object>, 'fgs_anomalies': <django.forms.fields.MultipleChoiceField object>, 'fgs_aper': <django.forms.fields.MultipleChoiceField object>, 'fgs_detector': <django.forms.fields.MultipleChoiceField object>, 'fgs_exptype': <django.forms.fields.MultipleChoiceField object>, 'fgs_filt': <django.forms.fields.MultipleChoiceField object>, 'fgs_grating': <django.forms.fields.MultipleChoiceField object>, 'fgs_readpatt': <django.forms.fields.MultipleChoiceField object>, 'instrument': <django.forms.fields.MultipleChoiceField object>, 'miri_anomalies': <django.forms.fields.MultipleChoiceField object>, 'miri_aper': <django.forms.fields.MultipleChoiceField object>, 'miri_detector': <django.forms.fields.MultipleChoiceField object>, 'miri_exptype': <django.forms.fields.MultipleChoiceField object>, 'miri_filt': <django.forms.fields.MultipleChoiceField object>, 'miri_grating': <django.forms.fields.MultipleChoiceField object>, 'miri_readpatt': <django.forms.fields.MultipleChoiceField object>, 'nircam_anomalies': <django.forms.fields.MultipleChoiceField object>, 'nircam_aper': <django.forms.fields.MultipleChoiceField object>, 'nircam_detector': <django.forms.fields.MultipleChoiceField object>, 'nircam_exptype': <django.forms.fields.MultipleChoiceField object>, 'nircam_filt': <django.forms.fields.MultipleChoiceField object>, 'nircam_grating': <django.forms.fields.MultipleChoiceField object>, 'nircam_readpatt': <django.forms.fields.MultipleChoiceField object>, 'niriss_anomalies': <django.forms.fields.MultipleChoiceField object>, 'niriss_aper': <django.forms.fields.MultipleChoiceField object>, 'niriss_detector': <django.forms.fields.MultipleChoiceField object>, 'niriss_exptype': <django.forms.fields.MultipleChoiceField object>, 'niriss_filt': <django.forms.fields.MultipleChoiceField object>, 'niriss_grating': <django.forms.fields.MultipleChoiceField object>, 'niriss_readpatt': <django.forms.fields.MultipleChoiceField object>, 'nirspec_anomalies': <django.forms.fields.MultipleChoiceField object>, 'nirspec_aper': <django.forms.fields.MultipleChoiceField object>, 'nirspec_detector': <django.forms.fields.MultipleChoiceField object>, 'nirspec_exptype': <django.forms.fields.MultipleChoiceField object>, 'nirspec_filt': <django.forms.fields.MultipleChoiceField object>, 'nirspec_grating': <django.forms.fields.MultipleChoiceField object>, 'nirspec_readpatt': <django.forms.fields.MultipleChoiceField object>}
detector = 'GUIDER2'
exptype = 'FGS DARK'
filt = 'F110W'
grating = 'PRISM'
item = ['OTHER', 'OTHER']
property media

Return all media required to render the widgets on this form.

params = {'fgs': {'anomalies_list': [['COSMIC RAY SHOWER', 'COSMIC RAY SHOWER'], ['DIFFRACTION SPIKE', 'DIFFRACTION SPIKE'], ['EXCESSIVE SATURATION', 'EXCESSIVE SATURATION'], ['GUIDESTAR FAILURE', 'GUIDESTAR FAILURE'], ['PERSISTENCE', 'PERSISTENCE'], ['CROSSTALK', 'CROSSTALK'], ['DATA TRANSFER ERROR', 'DATA TRANSFER ERROR'], ['GHOST', 'GHOST'], ['SNOWBALL', 'SNOWBALL'], ['OTHER', 'OTHER']], 'aperture_list': [['FGS1 FULL', 'FGS1 FULL'], ['FGS2 FULL', 'FGS2 FULL']], 'detector_list': [['GUIDER1', 'GUIDER1'], ['GUIDER2', 'GUIDER2']], 'exptype_list': [['FGS FOCUS', 'FGS FOCUS'], ['FGS IMAGE', 'FGS IMAGE'], ['FGS INTFLAT', 'FGS INTFLAT'], ['FGS SKYFLAT', 'FGS SKYFLAT'], ['FGS DARK', 'FGS DARK']], 'filter_list': [], 'grating_list': [], 'readpatt_list': [['FGS', 'FGS'], ['FGSRAPID', 'FGSRAPID'], ['FGS60', 'FGS60'], ['FGS840', 'FGS840'], ['FGS8370', 'FGS8370']]}, 'miri': {'anomalies_list': [['COSMIC RAY SHOWER', 'COSMIC RAY SHOWER'], ['DIFFRACTION SPIKE', 'DIFFRACTION SPIKE'], ['EXCESSIVE SATURATION', 'EXCESSIVE SATURATION'], ['GUIDESTAR FAILURE', 'GUIDESTAR FAILURE'], ['PERSISTENCE', 'PERSISTENCE'], ['COLUMN PULL UP', 'COLUMN PULL UP'], ['GLOW', 'GLOW'], ['INTERNAL REFLECTION', 'INTERNAL REFLECTION'], ['ROW PULL DOWN', 'ROW PULL DOWN'], ['OTHER', 'OTHER']], 'aperture_list': [['MIRIM SUB64', 'MIRIM SUB64'], ['MIRIM SUB128', 'MIRIM SUB128'], ['MIRIM SUB256', 'MIRIM SUB256'], ['MIRIM MASK1140', 'MIRIM MASK1140'], ['MIRIM MASK1065', 'MIRIM MASK1065'], ['MIRIM MASK1550', 'MIRIM MASK1550'], ['MIRIM MASKLYOT', 'MIRIM MASKLYOT'], ['MIRIM BRIGHTSKY', 'MIRIM BRIGHTSKY'], ['MIRIM SLITLESSPRISM', 'MIRIM SLITLESSPRISM']], 'detector_list': [['MIRIFULONG', 'MIRIFULONG'], ['MIRIFUSHORT', 'MIRIFUSHORT'], ['MIRIMAGE', 'MIRIMAGE']], 'exptype_list': [['MIR FLATMRS', 'MIR FLATMRS'], ['MIR MRS', 'MIR MRS'], ['MIR FLATIMAGE', 'MIR FLATIMAGE'], ['MIR DARK', 'MIR DARK'], ['MIR LYOT', 'MIR LYOT'], ['MIR IMAGE', 'MIR IMAGE'], ['MIR LRS-FIXEDSLIT', 'MIR LRS-FIXEDSLIT'], ['MIR LRS-SLITLESS', 'MIR LRS-SLITLESS'], ['MIR CORONCAL', 'MIR CORONCAL'], ['MIR 4QPM', 'MIR 4QPM'], ['MIR FLATIMAGE-EXT', 'MIR FLATIMAGE-EXT'], ['MIR TACQ', 'MIR TACQ'], ['MIR DARKMRS', 'MIR DARKMRS'], ['MIR DARKIMG', 'MIR DARKIMG'], ['MIR FLATMRS-EXT', 'MIR FLATMRS-EXT'], ['MIR TACONFIRM', 'MIR TACONFIRM']], 'filter_list': [['F1000W', 'F1000W'], ['F1130W', 'F1130W'], ['F1280W', 'F1280W'], ['OPAQUE', 'OPAQUE'], ['F2300C', 'F2300C'], ['F560W', 'F560W'], ['P750L', 'P750L'], ['F1500W', 'F1500W'], ['F2550W', 'F2550W'], ['F770W', 'F770W'], ['FLENS', 'FLENS'], ['FND', 'FND'], ['F2100W', 'F2100W'], ['F1800W', 'F1800W'], ['F1550C', 'F1550C'], ['F1140C', 'F1140C'], ['F2550WR', 'F2550WR'], ['F1065C', 'F1065C']], 'grating_list': [], 'readpatt_list': [['FAST', 'FAST'], ['SLOW', 'SLOW'], ['FASTGRPAVG', 'FASTGRPAVG']]}, 'nircam': {'anomalies_list': [['COSMIC RAY SHOWER', 'COSMIC RAY SHOWER'], ['DIFFRACTION SPIKE', 'DIFFRACTION SPIKE'], ['EXCESSIVE SATURATION', 'EXCESSIVE SATURATION'], ['GUIDESTAR FAILURE', 'GUIDESTAR FAILURE'], ['PERSISTENCE', 'PERSISTENCE'], ['CROSSTALK', 'CROSSTALK'], ['DATA TRANSFER ERROR', 'DATA TRANSFER ERROR'], ['GHOST', 'GHOST'], ['SNOWBALL', 'SNOWBALL'], ['DRAGONS BREATH', 'DRAGONS BREATH'], ['OTHER', 'OTHER']], 'aperture_list': [['NRCA1 FULL', 'NRCA1 FULL'], ['NRCA2 FULL', 'NRCA2 FULL'], ['NRCA3 FULL', 'NRCA3 FULL'], ['NRCA4 FULL', 'NRCA4 FULL'], ['NRCA5 FULL', 'NRCA5 FULL'], ['NRCB1 FULL', 'NRCB1 FULL'], ['NRCB2 FULL', 'NRCB2 FULL'], ['NRCB3 FULL', 'NRCB3 FULL'], ['NRCB4 FULL', 'NRCB4 FULL'], ['NRCB5 FULL', 'NRCB5 FULL']], 'detector_list': [['NRCB4', 'NRCB4'], ['NRCA4', 'NRCA4'], ['NRCA2', 'NRCA2'], ['NRCALONG', 'NRCALONG'], ['NRCBLONG', 'NRCBLONG'], ['NRCB2', 'NRCB2'], ['NRCB3', 'NRCB3'], ['NRCA1', 'NRCA1'], ['NRCA3', 'NRCA3'], ['NRCB1', 'NRCB1']], 'exptype_list': [['NRC LED', 'NRC LED'], ['NRC DARK', 'NRC DARK'], ['NRC CORON', 'NRC CORON'], ['NRC IMAGE', 'NRC IMAGE'], ['NRC FOCUS', 'NRC FOCUS'], ['NRC TSGRISM', 'NRC TSGRISM'], ['NRC TSIMAGE', 'NRC TSIMAGE'], ['NRC WFSS', 'NRC WFSS'], ['NRC TACQ', 'NRC TACQ'], ['NRC TACONFIRM', 'NRC TACONFIRM'], ['NRC FLAT', 'NRC FLAT'], ['NRC GRISM', 'NRC GRISM']], 'filter_list': [['F070W', 'F070W'], ['F090W', 'F090W'], ['F115W', 'F115W'], ['F140M', 'F140M'], ['F150W', 'F150W'], ['F150W2', 'F150W2'], ['F182M', 'F182M'], ['F187N', 'F187N'], ['F200W', 'F200W'], ['F210M', 'F210M'], ['F212N', 'F212N'], ['F250M', 'F250M'], ['F277W', 'F277W'], ['F300M', 'F300M'], ['F322W2', 'F322W2'], ['F335M', 'F335M'], ['F356W', 'F356W'], ['F360M', 'F360M'], ['F410M', 'F410M'], ['F430M', 'F430M'], ['F444W', 'F444W'], ['F460M', 'F460M'], ['F480M', 'F480M']], 'grating_list': [], 'readpatt_list': [['RAPID', 'RAPID'], ['SHALLOW2', 'SHALLOW2'], ['BRIGHT2', 'BRIGHT2'], ['MEDIUM2', 'MEDIUM2'], ['SHALLOW4', 'SHALLOW4'], ['MEDIUM8', 'MEDIUM8'], ['BRIGHT1', 'BRIGHT1'], ['DEEP2', 'DEEP2'], ['DEEP8', 'DEEP8']]}, 'niriss': {'anomalies_list': [['COSMIC RAY SHOWER', 'COSMIC RAY SHOWER'], ['DIFFRACTION SPIKE', 'DIFFRACTION SPIKE'], ['EXCESSIVE SATURATION', 'EXCESSIVE SATURATION'], ['GUIDESTAR FAILURE', 'GUIDESTAR FAILURE'], ['PERSISTENCE', 'PERSISTENCE'], ['CROSSTALK', 'CROSSTALK'], ['DATA TRANSFER ERROR', 'DATA TRANSFER ERROR'], ['GHOST', 'GHOST'], ['SNOWBALL', 'SNOWBALL'], ['OTHER', 'OTHER']], 'aperture_list': [['NIS CEN', 'NIS CEN'], ['NIS SOSSFULL', 'NIS SOSSFULL'], ['NIS AMIFULL', 'NIS AMIFULL'], ['NIS AMI1', 'NIS AMI1'], ['NIS SUBSTRIP256', 'NIS SUBSTRIP256'], ['NIS SUBSTRIP96', 'NIS SUBSTRIP96'], ['NIS SUB64', 'NIS SUB64'], ['NIS SUB128', 'NIS SUB128'], ['NIS SUB256', 'NIS SUB256']], 'detector_list': [['NIS', 'NIS']], 'exptype_list': [['NIS IMAGE', 'NIS IMAGE'], ['NIS FOCUS', 'NIS FOCUS'], ['NIS SOSS', 'NIS SOSS'], ['NIS AMI', 'NIS AMI'], ['NIS LAMP', 'NIS LAMP'], ['NIS WFSS', 'NIS WFSS'], ['NIS DARK', 'NIS DARK'], ['NIS EXTCAL', 'NIS EXTCAL'], ['NIS TACONFIRM', 'NIS TACONFIRM'], ['NIS TACQ', 'NIS TACQ']], 'filter_list': [['CLEAR', 'CLEAR'], ['F380M', 'F380M'], ['F480M', 'F480M'], ['GR150R', 'GR150R'], ['F430M', 'F430M'], ['GR150C', 'GR150C'], ['F444W', 'F444W'], ['F356W', 'F356W'], ['F277W', 'F277W']], 'grating_list': [], 'readpatt_list': [['NISRAPID', 'NISRAPID'], ['NIS', 'NIS']]}, 'nirspec': {'anomalies_list': [['COSMIC RAY SHOWER', 'COSMIC RAY SHOWER'], ['DIFFRACTION SPIKE', 'DIFFRACTION SPIKE'], ['EXCESSIVE SATURATION', 'EXCESSIVE SATURATION'], ['GUIDESTAR FAILURE', 'GUIDESTAR FAILURE'], ['PERSISTENCE', 'PERSISTENCE'], ['CROSSTALK', 'CROSSTALK'], ['DATA TRANSFER ERROR', 'DATA TRANSFER ERROR'], ['GHOST', 'GHOST'], ['SNOWBALL', 'SNOWBALL'], ['DOMINANT MSA LEAKAGE', 'DOMINANT MSA LEAKAGE'], ['OPTICAL SHORT', 'OPTICAL SHORT'], ['OTHER', 'OTHER']], 'aperture_list': [['NRS FULL MSA', 'NRS FULL MSA'], ['NRS FULL IFU', 'NRS FULL IFU'], ['NRS S200A1 SLIT', 'NRS S200A1 SLIT'], ['NRS S200A2 SLIT', 'NRS S200A2 SLIT'], ['NRS S400A1 SLIT', 'NRS S400A1 SLIT'], ['NRS S1600A1 SLIT', 'NRS S1600A1 SLIT'], ['NRS S200B1 SLIT', 'NRS S200B1 SLIT']], 'detector_list': [['NRS1', 'NRS1'], ['NRS2', 'NRS2']], 'exptype_list': [['NRS IFU', 'NRS IFU'], ['NRS MSASPEC', 'NRS MSASPEC'], ['NRS BRIGHTOBJ', 'NRS BRIGHTOBJ'], ['NRS DARK', 'NRS DARK'], ['NRS AUTOWAVE', 'NRS AUTOWAVE'], ['NRS LAMP', 'NRS LAMP'], ['NRS AUTOFLAT', 'NRS AUTOFLAT'], ['NRS IMAGE', 'NRS IMAGE'], ['NRS CONFIRM', 'NRS CONFIRM'], ['NRS FIXEDSLIT', 'NRS FIXEDSLIT'], ['NRS MIMF', 'NRS MIMF'], ['NRS FOCUS', 'NRS FOCUS'], ['NRS TACONFIRM', 'NRS TACONFIRM'], ['NRS WATA', 'NRS WATA'], ['NRS MSATA', 'NRS MSATA']], 'filter_list': [['F290LP', 'F290LP'], ['F170LP', 'F170LP'], ['OPAQUE', 'OPAQUE'], ['F100LP', 'F100LP'], ['F070LP', 'F070LP'], ['F140X', 'F140X'], ['CLEAR', 'CLEAR'], ['F110W', 'F110W']], 'grating_list': [['G140M', 'G140M'], ['G235M', 'G235M'], ['G395M', 'G395M'], ['G140H', 'G140H'], ['G235H', 'G235H'], ['G395H', 'G395H'], ['PRISM', 'PRISM']], 'readpatt_list': [['NRS', 'NRS'], ['NRSRAPID', 'NRSRAPID'], ['NRSRAPIDD2', 'NRSRAPIDD2'], ['NRSRAPIDD6', 'NRSRAPIDD6']]}}
readpatt = 'FGS8370'
class jwql.website.apps.jwql.forms.BaseForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

A generic form with target resolve built in

base_fields = {}
declared_fields = {}
property media

Return all media required to render the widgets on this form.

resolve_submit = <UnboundField(SubmitField, ('Resolve Target',), {})>
target_url = <UnboundField(StringField, ('target_url',), {'default': ''})>
targname = <UnboundField(StringField, ('targname',), {'default': ''})>
class jwql.website.apps.jwql.forms.FileSearchForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Single-field form to search for a proposal or fileroot.

base_fields = {'search': <django.forms.fields.CharField object>}

Validate the “search” field.

Check that the input is either a proposal or fileroot, and one that matches files in the filesystem.

Returns:
str

The cleaned data input into the “search” field

declared_fields = {'search': <django.forms.fields.CharField object>}
fileroot_dict = None
instrument = None
property media

Return all media required to render the widgets on this form.

redirect_to_files()[source]

Determine where to redirect the web app based on user input.

Returns:
HttpResponseRedirect object

Outgoing redirect response sent to the webpage

search_type = None
class jwql.website.apps.jwql.forms.FiletypeForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

Creates a FiletypeForm object that allows for filetype input in a form field.

base_fields = {'filetype': <django.forms.fields.MultipleChoiceField object>}
clean_filetypes()[source]
declared_fields = {'filetype': <django.forms.fields.MultipleChoiceField object>}
file_type_list = [['uncal', 'uncal'], ['cal', 'cal'], ['rateints', 'rateints'], ['rate', 'rate'], ['trapsfilled', 'trapsfilled'], ['i2d', 'i2d'], ['x1dints', 'x1dints'], ['x1d', 'x1d'], ['s2d', 's2d'], ['s3d', 's3d'], ['dark', 'dark'], ['crfints', 'crfints'], ['crf', 'crf'], ['ramp', 'ramp'], ['fitopt', 'fitopt'], ['bsubints', 'bsubints'], ['bsub', 'bsub'], ['cat', 'cat']]
item = ['cat', 'cat']
property media

Return all media required to render the widgets on this form.

class jwql.website.apps.jwql.forms.InstrumentAnomalySubmitForm(*args, **kwargs)[source]

A multiple choice field for specifying flagged anomalies.

base_fields = {}
clean_anomalies()[source]
declared_fields = {}
property media

Return all media required to render the widgets on this form.

update_anomaly_table(rootname, user, anomaly_choices)[source]

Updated the anomaly table of the database with flagged anomaly information

Parameters:
rootnamestr

The rootname of the image to flag (e.g. jw86600008001_02101_00001_guider2)

userstr

The user that is flagging the anomaly

anomaly_choiceslist

A list of anomalies that are to be flagged (e.g. ['snowball', 'crosstalk'])

class jwql.website.apps.jwql.forms.MnemonicExplorationForm(data=None, files=None, auto_id='id_%s', prefix=None, initial=None, error_class=<class 'django.forms.utils.ErrorList'>, label_suffix=None, empty_permitted=False, field_order=None, use_required_attribute=None, renderer=None)[source]

A sextuple-field form to explore the EDB mnemonic inventory.

base_fields = {'description': <django.forms.fields.CharField object>, 'sql_data_type': <django.forms.fields.CharField object>, 'subsystem': <django.forms.fields.CharField object>, 'tlm_identifier': <django.forms.fields.CharField object>, 'tlm_mnemonic': <django.forms.fields.CharField object>, 'unit': <django.forms.fields.CharField object>}
declared_fields = {'description': <django.forms.fields.CharField object>, 'sql_data_type': <django.forms.fields.CharField object>, 'subsystem': <django.forms.fields.CharField object>, 'tlm_identifier': <django.forms.fields.CharField object>, 'tlm_mnemonic': <django.forms.fields.CharField object>, 'unit': <django.forms.fields.CharField object>}
default_description = 'centroid data'
property media

Return all media required to render the widgets on this form.

class jwql.website.apps.jwql.forms.MnemonicQueryForm(*args, **kwargs)[source]

A triple-field form to query mnemonic records in the DMS EDB.

base_fields = {'end_time': <django.forms.fields.CharField object>, 'search': <django.forms.fields.CharField object>, 'start_time': <django.forms.fields.CharField object>}
clean_end_time()[source]

Validate the end time.

Returns:
str

The cleaned data input into the end_time field

Validate the “search” field.

Check that the input is a valid mnemonic identifier.

Returns:
str

The cleaned data input into the “search” field

clean_start_time()[source]

Validate the start time.

Returns:
str

The cleaned data input into the start_time field

declared_fields = {'end_time': <django.forms.fields.CharField object>, 'search': <django.forms.fields.CharField object>, 'start_time': <django.forms.fields.CharField object>}
default_end_time = <Time object: scale='utc' format='iso' value=2019-01-16 00:01:00.000>
default_mnemonic_identifier = 'IMIR_HK_ICE_SEC_VOLT4'
default_start_time = <Time object: scale='utc' format='iso' value=2019-01-16 00:00:00.000>
property media

Return all media required to render the widgets on this form.

production_mode = False
search_type = None
class jwql.website.apps.jwql.forms.MnemonicSearchForm(*args, **kwargs)[source]

A single-field form to search for a mnemonic in the DMS EDB.

base_fields = {'search': <django.forms.fields.CharField object>}

Validate the “search” field.

Check that the input is a valid mnemonic identifier.

Returns:
str

The cleaned data input into the “search” field

declared_fields = {'search': <django.forms.fields.CharField object>}
property media

Return all media required to render the widgets on this form.

search_type = None

manage.py

Utility module for administrative tasks.

A python script version of Django’s command-line utility for administrative tasks (django-admin). Additionally, puts the project package on sys.path and defines the DJANGO_SETTINGS_MODULE variable to point to the jwql settings.py file.

Generated by django-admin startproject using Django 2.0.1.

Use

To run the web app server:

python manage.py runserver

To start the interactive shellL:

python manage.py shell

To run tests for all installed apps:

python manage.py test

References

For more information please see:

https://docs.djangoproject.com/en/2.0/ref/django-admin/

monitor_views.py

Defines the views for the jwql web app instrument monitors.

Authors

  • Lauren Chambers

Use

This module is called in urls.py as such:

from django.urls import path
from . import monitor_views
urlpatterns = [path('web/path/to/view/', monitor_views.view_name,
name='view_name')]

References

For more information please see:

https://docs.djangoproject.com/en/2.0/topics/http/views/

Dependencies

The user must have a configuration file named config.json placed in the jwql directory.

jwql.website.apps.jwql.monitor_views.bad_pixel_monitor(request, inst)[source]

Generate the dark monitor page for a given instrument

Parameters:
requestHttpRequest object

Incoming request from the webpage

inststr

Name of JWST instrument

Returns:
HttpResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.monitor_views.bias_monitor(request, inst)[source]

Generate the bias monitor page for a given instrument

Parameters:
requestHttpRequest object

Incoming request from the webpage

inststr

Name of JWST instrument

Returns:
HttpResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.monitor_views.dark_monitor(request, inst)[source]

Generate the dark monitor page for a given instrument

Parameters:
requestHttpRequest object

Incoming request from the webpage

inststr

Name of JWST instrument

Returns:
HttpResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.monitor_views.readnoise_monitor(request, inst)[source]

Generate the readnoise monitor page for a given instrument

Parameters:
requestHttpRequest object

Incoming request from the webpage

inststr

Name of JWST instrument

Returns:
HttpResponse object

Outgoing response sent to the webpage

settings.py

Django settings for jwql project.

Contains essential project settings, including a list of installed apps, where to find templates, credentials for connection to the db.sqlite3 database, time zone, & locations where static files are located. Generated by django-admin startproject using Django 2.0.1.

Authors

  • Lauren Chambers

References

For more information on this file, see

https://docs.djangoproject.com/en/2.0/topics/settings/

For the full list of settings and their values, see

https://docs.djangoproject.com/en/2.0/ref/settings/

Dependencies

The user must have a configuration file named config.json placed in the jwql/utils/ directory.

urls.py

Maps URL paths to views in the jwql app.

This module connects requested URL paths to the corresponding view in views.py for each webpage in the jwql app. When django is provided a path, it searches through the urlpatterns list provided here until it finds one that matches. It then calls the assigned view to load the appropriate webpage, passing an HttpRequest object.

Authors

  • Lauren Chambers

  • Matthew Bourque

  • Johannes Sahlmann

  • Teagan King

Use

Function views
  1. Add an import: from my_app import views

  2. Add a URL to urlpatterns: path(‘’, views.home, name=’home’)

Class-based views
  1. Add an import: from other_app.views import Home

  2. Add a URL to urlpatterns: path(‘’, Home.as_view(), name=’home’)

Including another URLconf
  1. Import the include() function: from django.urls import include, path

  2. Add a URL to urlpatterns: path(‘blog/’, include(‘blog.urls’))

References

For more information please see:

https://docs.djangoproject.com/en/2.0/topics/http/urls/

Notes

Be aware that when a url is requested, it will be directed to the first matching path in the urlpatterns list that it finds. The <str:var> tag is just a placeholder. To avoid complications, users should order their paths in order from shortest to longest, and after that from most to least specific.

views.py

Defines the views for the jwql web app.

In Django, “a view function, or view for short, is simply a Python function that takes a Web request and returns a Web response” (from Django documentation). This module defines all of the views that are used to generate the various webpages used for the JWQL application. For example, these views can list the tools available to users, query the jwql database, and display images and headers.

Authors

  • Lauren Chambers

  • Johannes Sahlmann

  • Teagan King

  • Mees Fix

Use

This module is called in urls.py as such:

from django.urls import path
from . import views
urlpatterns = [path('web/path/to/view/', views.view_name,
name='view_name')]

References

For more information please see:

https://docs.djangoproject.com/en/2.0/topics/http/views/

Dependencies

The user must have a configuration file named config.json placed in the jwql directory.

jwql.website.apps.jwql.views.about(request)[source]

Generate the about page

Parameters:
requestHttpRequest object

Incoming request from the webpage

Returns:
HttpResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.views.anomaly_query(request)[source]

The anomaly query form page

jwql.website.apps.jwql.views.api_landing(request)[source]

Generate the api page

Parameters:
requestHttpRequest object

Incoming request from the webpage

Returns:
HttpResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.views.archive_thumbnails(request, inst, proposal)[source]

Generate the page listing all archived images in the database for a certain proposal

Parameters:
requestHttpRequest object

Incoming request from the webpage

inststr

Name of JWST instrument

proposalstr

Number of observing proposal

Returns:
HttpResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.views.archive_thumbnails_ajax(request, inst, proposal)[source]

Generate the page listing all archived images in the database for a certain proposal

Parameters:
requestHttpRequest object

Incoming request from the webpage

inststr

Name of JWST instrument

proposalstr

Number of observing proposal

Returns:
JsonResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.views.archive_thumbnails_query_ajax(request)[source]

Generate the page listing all archived images in the database for a certain proposal

Parameters:
requestHttpRequest object

Incoming request from the webpage

inststr

Name of JWST instrument

proposalstr

Number of observing proposal

Returns:
JsonResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.views.archived_proposals(request, inst)[source]

Generate the page listing all archived proposals in the database

Parameters:
requestHttpRequest object

Incoming request from the webpage

inststr

Name of JWST instrument

Returns:
HttpResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.views.archived_proposals_ajax(request, inst)[source]

Generate the page listing all archived proposals in the database

Parameters:
requestHttpRequest object

Incoming request from the webpage

inststr

Name of JWST instrument

Returns:
JsonResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.views.dashboard(request)[source]

Generate the dashbaord page

Parameters:
requestHttpRequest object

Incoming request from the webpage

Returns:
HttpResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.views.engineering_database(request)[source]

Generate the EDB page.

Parameters:
requestHttpRequest object

Incoming request from the webpage

Returns:
HttpResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.views.export(request, tablename)[source]

Function to export and download data from JWQLDB Table Viewer

Parameters:
requestHttpRequest object

Incoming request from the webpage

tablenamestr

Name of table to download

Returns:
responseHttpResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.views.home(request)[source]

Generate the home page

Parameters:
requestHttpRequest object

Incoming request from the webpage

Returns:
HttpResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.views.instrument(request, inst)[source]

Generate the instrument tool index page.

Parameters:
requestHttpRequest object

Incoming request from the webpage

inststr

Name of JWST instrument

Returns:
HttpResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.views.jwqldb_table_viewer(request, tablename_param=None)[source]

Generate the JWQL Table Viewer view.

Parameters:
requestHttpRequest object

Incoming request from the webpage

tablename_paramstr

Table name parameter from URL

Returns:
HttpResponse object

Outgoing response sent to the webpage

Generate the MIRI DATA-TRENDING page

Parameters:
requestHttpRequest object

Incoming request from the webpage

Returns:
HttpResponse object

Outgoing response sent to the webpage

Generate the MIRI DATA-TRENDING page

Parameters:
requestHttpRequest object

Incoming request from the webpage

Returns:
HttpResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.views.not_found(request, *kwargs)[source]

Generate a not_found page

Parameters:
requestHttpRequest object

Incoming request from the webpage

Returns:
HttpResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.views.query_submit(request)[source]

Generate the page listing all archived images in the database for a certain proposal

Parameters:
requestHttpRequest object

Incoming request from the webpage

Returns:
HttpResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.views.unlooked_images(request, inst)[source]

Generate the page listing all unlooked images in the database

Parameters:
requestHttpRequest object

Incoming request from the webpage

inststr

Name of JWST instrument

Returns:
HttpResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.views.view_header(request, inst, filename)[source]

Generate the header view page

Parameters:
requestHttpRequest object

Incoming request from the webpage

inststr

Name of JWST instrument

filenamestr

FITS filename of selected image in filesystem

Returns:
HttpResponse object

Outgoing response sent to the webpage

jwql.website.apps.jwql.views.view_image(request, inst, file_root, rewrite=False)[source]

Generate the image view page

Parameters:
requestHttpRequest object

Incoming request from the webpage

inststr

Name of JWST instrument

file_rootstr

FITS filename of selected image in filesystem

rewritebool, optional

Regenerate the jpg preview of file if it already exists?

Returns:
HttpResponse object

Outgoing response sent to the webpage