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.
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_looks(request, inst, status=None)[source]¶
Return a table of looks information for the given instrument.
‘Viewed’ indicates whether an observation is new or has been reviewed for QA. In addition to ‘filename’, and ‘viewed’, observation descriptors from the Django models may be added to the table. Keys are specified by instrument in the REPORT_KEYS_PER_INSTRUMENT constant.
- Parameters:
- requestHttpRequest object
Incoming request from the webpage.
- inststr
The JWST instrument of interest.
- statusstr, optional
If set to None, all viewed values are returned. If set to ‘viewed’, only viewed data is returned. If set to ‘new’, only new data is returned.
- Returns:
- JsonResponse
Outgoing response sent to the webpage, depending on return_type.
- 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_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.thumbnail_by_rootname(request, rootname)[source]¶
Return the best available thumbnail 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_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
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
Bryan Hilbert
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 thejwql
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.
- Returns:
- tabsbokeh.models.widgets.widget.Widget
A figure with tabs for each instrument.
- dashboard_central_store_data_volume()[source]¶
Create trending plot of data volume for various JWQL-related areas on disk. These plots show data volumes calculated by walking over subdirectories/files in the JWQL-specific directories. So these plots may not include the total used disk volume, in the cases where JWQL is sharing a disk with other projects. These plots are useful for monitoring the total volume of e.g. our preview images.
- Returns:
- tabsbokeh.models.widgets.widget.Widget
A figure with tabs for each central store area
- dashboard_disk_usage()[source]¶
Create trending plot of data volume for various disks. Here we are plotting the results of a “df -hk” call for top-level directories. The results (i.e. on central store) may contain contributions from non-JWQL files, since JWQL can share disks with other projects. These plots are useful for tracking disk usage and requesting more disk space if needed.
- Returns:
- tabsbokeh.models.widgets.widget.Widget
Set of tabs containing plots of the used and available disk space
- dashboard_exposure_count_by_filter()[source]¶
Create figure for number of files per filter for each JWST instrument.
- 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
- 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
- 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
- Returns:
- plotbokeh.plotting.figure
Pie chart figure
- dashboard_monitor_tracking()[source]¶
Build bokeh table to show status and when monitors were run.
- 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.build_table_latest_entry(tablename)[source]¶
Create Pandas dataframe from the most recent entry of a JWQLDB table.
- Parameters:
- tablenamestr
Name of JWQL database table name.
- Returns:
- table_meta_datapandas.DataFrame
Pandas data frame version of JWQL database table.
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 insettings.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.
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
Bryan Hilbert
Maria Pena-Guerrero
Bradley Sappington
Melanie Clarke
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.
- jwql.website.apps.jwql.data_containers.create_archived_proposals_context(inst)[source]¶
Generate and save a json file containing the information needed to create an instrument’s archive page.
- Parameters:
- inststr
Name of JWST instrument
- jwql.website.apps.jwql.data_containers.filter_root_files(instrument=None, proposal=None, obsnum=None, sort_as=None, look=None, exp_type=None, cat_type=None, detector=None)[source]¶
Retrieve and filter root file table entries.
- Parameters:
- instrumentstr, optional
Name of the JWST instrument.
- proposalstr, optional
Proposal to match. Used as a ‘starts with’ filter.
- obsnumstr, optional
Observation number to match.
- sort_as{‘ascending’, ‘descending’, ‘recent’, ‘oldest’}, optional
Sorting method for output table. Ascending and descending options refer to root file name; recent and oldest sort by exposure start time.
- look{‘new’, ‘viewed’}, optional
If set to None, all viewed values are returned. If set to ‘viewed’, only viewed data is returned. If set to ‘new’, only new data is returned.
- exp_typestr, optional
Set to filter by exposure type.
- cat_typestr, optional
Set to filter by proposal category.
- detectorstr, optional
Set to filter by detector name.
- Returns:
- root_file_infoQuerySet
List of RootFileInfo entries matching input criteria.
- 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 theREADME
file.- Returns:
- acknowledgementslist
A list of individuals to be acknowledged.
- jwql.website.apps.jwql.data_containers.get_additional_exposure_info(root_file_infos, image_info)[source]¶
Create dictionaries of basic exposure information from an exposure’s RootFileInfo entry, as well as header information. Originally designed to be used in jwql.website.apps.jwql.views.view_image()
- Parameters:
- root_file_infosjwql.website.apps.jwql.models.RootFileInfo or django.db.models.query.QuerySet
RootFileInfo for a particular file base name, or a QuerySet of RootFileInfos for an exposure base name.
- image_info: dict
A dictionary containing various information for the given
file_root
.
- Returns:
- basic_infodict
Dictionary of information about the file/exposure
- additional_infodict
Dictionary of extra information about the file/exposure
- 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_anomaly_form(request, inst, file_root)[source]¶
Generate form data for context
- Parameters:
- requestHttpRequest object
Incoming request from the webpage
- inststr
Name of JWST instrument
- file_rootstr
FITS filename of selected image in filesystem. May be a file or group root name.
- Returns:
- InstrumentAnomalySubmitForm object
form object to be sent with context to template
- jwql.website.apps.jwql.data_containers.get_available_suffixes(all_suffixes, return_untracked=True)[source]¶
Put available suffixes in a consistent order.
Any suffixes not recognized are returned at the end of the suffix list, in random order.
- Parameters:
- all_suffixeslist of str
List of all data product suffixes found for a given file root.
- return_untrackedbool, optional
If set, a set of untracked suffixes is also returned, for logging or diagnostic purposes.
- Returns:
- suffixeslist of str
All available unique suffixes in standard order.
- untracked_suffixesset of str, optional
Any suffixes that were not recognized.
- jwql.website.apps.jwql.data_containers.get_current_flagged_anomalies(rootfileinfo_set)[source]¶
Return a list of currently flagged anomalies for the given
rootname
This function may be used to retrieve the current anomalies for single rootfileinfo or sets of rootfileinfos in an exposure group. Group anomalies are returned if they are true in every rootfileinfo in the set. For single files, any anomaly present for the file is a current anomaly.
- Parameters:
- rootfileinfo_setRootFileInfo Queryset
A query set of 1 or more RootFileInfos of interest Must be iterable, even if only one RootFileInfo.
- Returns:
- current_anomalieslist of str
A list of currently flagged anomalies for the given rootfileinfo_set (e.g.
['snowball', 'crosstalk']
)
- jwql.website.apps.jwql.data_containers.get_dashboard_components(request)[source]¶
Build and return a Dashboard class.
- Returns:
- dashboard_componentsGeneralDashboard
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_explorer_extension_names(fits_file, filetype)[source]¶
Return a list of Extensions that can be explored interactively
- Parameters:
- filenamestr
The name of the file of interest, without the extension (e.g.
'jw86600008001_02101_00007_guider2_uncal'
).- filetypestr
The type of the file of interest, (e.g.
'uncal'
)
- Returns:
- extensionslist
List of Extensions found in header and allowed to be Explored (extension type “IMAGE”)
- jwql.website.apps.jwql.data_containers.get_expstart(instrument, rootname)[source]¶
Return the exposure start time (
expstart
) for the givenrootname
.The
expstart
is gathered from a query to theastroquery.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, proposal, observation_id=None, restriction='all', query_file=None, query_response=None, other_columns=None)[source]¶
Returns a list of filenames that match the given
instrument
.- Parameters:
- instrumentstr
The instrument of interest (e.g. FGS).
- proposalstr
Proposal number to filter the results
- observation_idstr
Observation number to filter the results
- restrictionstr
If
all
, all filenames will be returned. Ifpublic
, only publicly-available filenames will be returned. Ifproprietary
, only proprietary filenames will be returned.- query_filestr
Name of a file containing a list of filenames. If provided, the filenames in this file will be used rather than calling mask_query_filenames_by_instrument. This can save a significant amount of time when the number of files is large.
- query_responsedict
Dictionary with “data” key containing a list of filenames. This is assumed to essentially be the returned value from a call to mast_query_filenames_by_instrument. If this is provided, the call to that function is skipped, which can save a significant amount of time.
- other_columnslist
List of other columns to retrieve from the MAST query
- Returns:
- filenameslist
A list of files that match the given instrument.
- col_datadict
Dictionary of other attributes returned from MAST. Keys are the attribute names e.g. ‘exptime’, and values are lists of the value for each filename. e.g. [‘59867.6, 59867.601’]
- 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_filesystem_filenames(proposal=None, rootname=None, file_types=None, full_path=False, sort_names=True)[source]¶
Return a list of filenames on the filesystem.
One of proposal or rootname must be specified. If both are specified, only proposal is used.
- Parameters:
- proposalstr, optional
The one- to five-digit proposal number (e.g.
88600
).- rootnamestr, optional
The rootname of interest (e.g.
jw86600008001_02101_00007_guider2
).- file_typeslist of str, optional
If provided, only matching file extension types will be returned (e.g. [‘fits’, ‘jpg’]).
- full_pathbool, optional
If set, the full path to the file will be returned instead of the basename.
- sort_namesbool, optional
If set, the returned files are sorted.
- Returns:
- filenameslist
A list of filenames associated with the given
rootname
.
- jwql.website.apps.jwql.data_containers.get_header_info(filename, filetype)[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'
).- filetypestr
The type of the file of interest, (e.g.
'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)[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
).
- Returns:
- image_infodict
A dictionary containing various information for the given
file_root
.
- jwql.website.apps.jwql.data_containers.get_instrument_looks(instrument, sort_as=None, proposal=None, look=None, exp_type=None, cat_type=None, additional_keys=None)[source]¶
Return a table of looks information for the given instrument.
- Parameters:
- instrumentstr
Name of the JWST instrument.
- sort_as{‘ascending’, ‘descending’, ‘recent’}
Sorting method for output table. Ascending and descending options refer to root file name; recent sorts by observation start.
- proposalstr, optional
Proposal to match. Used as a ‘starts with’ filter.
- look{‘new’, ‘viewed’}, optional
If set to None, all viewed values are returned. If set to ‘viewed’, only viewed data is returned. If set to ‘new’, only new data is returned.
- exp_typestr, optional
Set to filter by exposure type.
- cat_typestr, optional
Set to filter by proposal category.
- additional_keyslist of str, optional
Additional model attribute names for information to return.
- Returns:
- keyslist of str
Report values returned for the given instrument.
- lookslist of dict
List of looks information by root file for the given instrument.
- 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:
- inst_proposalslist
List of proposals 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_proposals_by_category(instrument)[source]¶
Return a dictionary of program numbers and category type Parameters ———- instrument : str
Name of the JWST instrument, with first letter capitalized (e.g.
Fgs
)Returns¶
- category_sorted_dictdict
Dictionary with program number as the key and program category as the value
- jwql.website.apps.jwql.data_containers.get_rootnames_for_proposal(proposal)[source]¶
Return a list of rootnames for the given proposal (all instruments)
- Parameters:
- proposalint or str
Proposal ID number
- Returns:
- rootnameslist
List of rootnames for the given instrument and proposal number
- jwql.website.apps.jwql.data_containers.get_rootnames_from_query(parameters)[source]¶
Return a query_set of RootFileInfo given requested filter parameters.
- Parameters:
- parameters: dict
A dictionary containing keys of QUERY_CONFIG_KEYS, some of which are dictionaries:
- Returns:
- filtered_rootnameslist
A list of all root filenames filtered from the given parameters
- jwql.website.apps.jwql.data_containers.get_thumbnail_by_rootname(rootname)[source]¶
Return the most appropriate existing thumbnail basename available in the filesystem for the given
rootname
. We generate thumbnails only for ‘rate’ and ‘dark’ files. Check if these files exist in the thumbnail filesystem. In the case where neither rate nor dark thumbnails are present, revert to ‘none’- Parameters:
- rootnamestr
The rootname of interest (e.g.
jw86600008001_02101_00007_guider2
).
- Returns:
- thumbnail_basenamestr
A thumbnail_basename available in the filesystem for the given
rootname
.
- 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.log_into_mast(request)[source]¶
Login via astroquery.mast if user authenticated in web app.
- Parameters:
- requestHttpRequest object
Incoming request from the webpage
- jwql.website.apps.jwql.data_containers.mast_query_by_rootname(instrument, rootname)[source]¶
Query MAST for all columns given an instrument and rootname. Return the dict of the ‘data’ column
- Parameters:
- instrumentstr
The instrument of interest (e.g. FGS).
- rootnamestr
The Rootname of Interest
- Returns:
- resultdict
Dictionary of rootname data
- jwql.website.apps.jwql.data_containers.mast_query_filenames_by_instrument(instrument, proposal_id, observation_id=None, other_columns=None)[source]¶
Query MAST for filenames for the given instrument. Return the json response from MAST.
- Parameters:
- instrumentstr
The instrument of interest (e.g. FGS).
- proposal_idstr
Proposal ID number to use to filter the results
- observation_idstr
Observation ID number to use to filter the results. If None, all files for the
proposal_id
are retrieved- other_columnslist
List of other columns to return from the MAST query
- Returns:
- resultdict
Dictionary of file information
- jwql.website.apps.jwql.data_containers.proposal_rootnames_by_instrument(proposal)[source]¶
Retrieve the rootnames for a given proposal for all instruments and return as a dictionary with instrument names as keys. Instruments not used in the proposal will not be present in the dictionary.
- proposalint or str
Proposal ID number
- Returns:
- rootnamesdict
Dictionary of rootnames with instrument names as keys
- 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.retrieve_filelist(filename)[source]¶
Return a list of all thumbnail files in the filesystem from a list file.
- Parameters:
- filenamestr
Name of a text file containing a list of files
- jwql.website.apps.jwql.data_containers.text_scrape(prop_id)[source]¶
Scrapes the Proposal Information Page.
- Parameters:
- prop_idint
Proposal ID
- Returns:
- program_metadict
Dictionary containing information about program
- jwql.website.apps.jwql.data_containers.thumbnails_ajax(inst, proposal, obs_num=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
- obs_numstr (optional)
Observation number
- Returns:
- data_dictdict
Dictionary of data needed for the
thumbnails
template
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
Mike Engesser
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 thejwql
directory.
- 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>}¶
- clean_search()[source]¶
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 forfiletype
input in a form field.- base_fields = {'filetype': <django.forms.fields.MultipleChoiceField object>}¶
- 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'], ['segm', 'segm'], ['c1d', 'c1d']]¶
- item = ['c1d', 'c1d']¶
- 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 = {}¶
- declared_fields = {}¶
- property media¶
Return all media required to render the widgets on this form.
- update_anomaly_table(rootfileinfo, user, anomaly_choices)[source]¶
Update the
Anomalies
model associated with the sent RootFileInfo. All ‘anomaly_choices’ should be marked ‘True’ and the rest should be ‘False’- Parameters:
- rootfileinfoRootFileInfo
The RootFileInfo model object of the image to update
- 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.JwqlQueryForm(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 JWQL Query viewing tool
- anomaly = 'needs_discussion'¶
- aperture = 'FGS2_FULL'¶
- base_fields = {'date_range': <django.forms.fields.CharField 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_pupil': <django.forms.fields.MultipleChoiceField object>, 'fgs_readpatt': <django.forms.fields.MultipleChoiceField object>, 'fgs_subarray': <django.forms.fields.MultipleChoiceField object>, 'instrument': <django.forms.fields.MultipleChoiceField object>, 'look_status': <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_pupil': <django.forms.fields.MultipleChoiceField object>, 'miri_readpatt': <django.forms.fields.MultipleChoiceField object>, 'miri_subarray': <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_pupil': <django.forms.fields.MultipleChoiceField object>, 'nircam_readpatt': <django.forms.fields.MultipleChoiceField object>, 'nircam_subarray': <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_pupil': <django.forms.fields.MultipleChoiceField object>, 'niriss_readpatt': <django.forms.fields.MultipleChoiceField object>, 'niriss_subarray': <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_pupil': <django.forms.fields.MultipleChoiceField object>, 'nirspec_readpatt': <django.forms.fields.MultipleChoiceField object>, 'nirspec_subarray': <django.forms.fields.MultipleChoiceField object>, 'num_per_page': <django.forms.fields.ChoiceField object>, 'proposal_category': <django.forms.fields.MultipleChoiceField object>, 'sort_type': <django.forms.fields.ChoiceField object>}¶
- calculate_submit = <UnboundField(SubmitField, (), {})>¶
- cat_choices = [('AR', 'AR'), ('CAL', 'CAL'), ('COM', 'COM'), ('DD', 'DD'), ('ENG', 'ENG'), ('GO', 'GO'), ('GTO', 'GTO'), ('NASA', 'NASA'), ('SURVEY', 'SURVEY')]¶
- declared_fields = {'date_range': <django.forms.fields.CharField 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_pupil': <django.forms.fields.MultipleChoiceField object>, 'fgs_readpatt': <django.forms.fields.MultipleChoiceField object>, 'fgs_subarray': <django.forms.fields.MultipleChoiceField object>, 'instrument': <django.forms.fields.MultipleChoiceField object>, 'look_status': <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_pupil': <django.forms.fields.MultipleChoiceField object>, 'miri_readpatt': <django.forms.fields.MultipleChoiceField object>, 'miri_subarray': <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_pupil': <django.forms.fields.MultipleChoiceField object>, 'nircam_readpatt': <django.forms.fields.MultipleChoiceField object>, 'nircam_subarray': <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_pupil': <django.forms.fields.MultipleChoiceField object>, 'niriss_readpatt': <django.forms.fields.MultipleChoiceField object>, 'niriss_subarray': <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_pupil': <django.forms.fields.MultipleChoiceField object>, 'nirspec_readpatt': <django.forms.fields.MultipleChoiceField object>, 'nirspec_subarray': <django.forms.fields.MultipleChoiceField object>, 'num_per_page': <django.forms.fields.ChoiceField object>, 'proposal_category': <django.forms.fields.MultipleChoiceField object>, 'sort_type': <django.forms.fields.ChoiceField object>}¶
- detector = 'GUIDER2'¶
- exptype = 'FGS DARK'¶
- filt = 'P750L'¶
- grating = 'MIRROR'¶
- item = ['NEEDS DISCUSSION', 'NEEDS DISCUSSION']¶
- look_choices = [('NEW', 'NEW'), ('VIEWED', 'VIEWED')]¶
- property media¶
Return all media required to render the widgets on this form.
- num_choices = [(50, 50), (100, 100), (200, 200), (500, 500)]¶
- params = {'fgs': {'anomalies_list': [['DIFFRACTION SPIKE', 'DIFFRACTION SPIKE'], ['EXCESSIVE SATURATION', 'EXCESSIVE SATURATION'], ['PERSISTENCE', 'PERSISTENCE'], ['CROSSTALK', 'CROSSTALK'], ['DATA TRANSFER ERROR', 'DATA TRANSFER ERROR'], ['GHOST', 'GHOST'], ['GUIDESTAR FAILURE', 'GUIDESTAR FAILURE'], ['UNUSUAL COSMIC RAYS', 'UNUSUAL COSMIC RAYS'], ['UNUSUAL SNOWBALLS', 'UNUSUAL SNOWBALLS'], ['OTHER', 'OTHER'], ['NEEDS DISCUSSION', 'NEEDS DISCUSSION']], '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': [], 'pupil_list': [], 'readpatt_list': [['FGS', 'FGS'], ['FGSRAPID', 'FGSRAPID'], ['FGS60', 'FGS60'], ['FGS840', 'FGS840'], ['FGS8370', 'FGS8370']], 'subarray_list': [['FULL', 'FULL'], ['128X128', '128X128'], ['2048X64', '2048X64'], ['32X32', '32X32'], ['8X8', '8X8'], ['SUB128CNTR', 'SUB128CNTR'], ['SUB128DIAG', 'SUB128DIAG'], ['SUB128LL', 'SUB128LL'], ['SUB32CNTR', 'SUB32CNTR'], ['SUB32DIAG', 'SUB32DIAG'], ['SUB32LL', 'SUB32LL'], ['SUB8CNTR', 'SUB8CNTR'], ['SUB8DIAG', 'SUB8DIAG'], ['SUB8LL', 'SUB8LL'], ['SUBIDSTRIPCENTER', 'SUBIDSTRIPCENTER'], ['SUBIDSTRIPLL', 'SUBIDSTRIPLL'], ['SUBTUNE32CENTERG1', 'SUBTUNE32CENTERG1'], ['SUBTUNE32CENTERG2', 'SUBTUNE32CENTERG2'], ['SUBTUNE32LLG1', 'SUBTUNE32LLG1'], ['SUBTUNE32LLG2', 'SUBTUNE32LLG2']]}, 'miri': {'anomalies_list': [['DIFFRACTION SPIKE', 'DIFFRACTION SPIKE'], ['EXCESSIVE SATURATION', 'EXCESSIVE SATURATION'], ['PERSISTENCE', 'PERSISTENCE'], ['GUIDESTAR FAILURE', 'GUIDESTAR FAILURE'], ['COSMIC RAY SHOWER', 'COSMIC RAY SHOWER'], ['COLUMN PULL UP', 'COLUMN PULL UP'], ['COLUMN PULL DOWN', 'COLUMN PULL DOWN'], ['MRS GLOW', 'MRS GLOW'], ['MRS ZIPPER', 'MRS ZIPPER'], ['INTERNAL REFLECTION', 'INTERNAL REFLECTION'], ['ROW PULL UP', 'ROW PULL UP'], ['ROW PULL DOWN', 'ROW PULL DOWN'], ['LRS CONTAMINATION', 'LRS CONTAMINATION'], ['TREE RINGS', 'TREE RINGS'], ['OTHER', 'OTHER'], ['NEEDS DISCUSSION', 'NEEDS DISCUSSION']], 'aperture_list': [], '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': [['F560W', 'F560W'], ['F770W', 'F770W'], ['F1000W', 'F1000W'], ['F1065C', 'F1065C'], ['F1130W', 'F1130W'], ['F1140C', 'F1140C'], ['F1280W', 'F1280W'], ['F1500W', 'F1500W'], ['F1550C', 'F1550C'], ['F1800W', 'F1800W'], ['F2100W', 'F2100W'], ['F2300C', 'F2300C'], ['F2550W', 'F2550W'], ['F2550WR', 'F2550WR'], ['FLENS', 'FLENS'], ['FND', 'FND'], ['OPAQUE', 'OPAQUE'], ['P750L', 'P750L']], 'grating_list': [], 'pupil_list': [], 'readpatt_list': [['FAST', 'FAST'], ['FASTR1', 'FASTR1'], ['SLOW', 'SLOW'], ['SLOWR1', 'SLOWR1'], ['FASTGRPAVG', 'FASTGRPAVG'], ['FASTGRPAVG8', 'FASTGRPAVG8'], ['FASTGRPAVG16', 'FASTGRPAVG16'], ['FASTGRPAVG32', 'FASTGRPAVG32'], ['FASTGRPAVG64', 'FASTGRPAVG64'], ['FASTR100', 'FASTR100']], 'subarray_list': [['FULL', 'FULL'], ['BRIGHTSKY', 'BRIGHTSKY'], ['MASK1065', 'MASK1065'], ['MASK1140', 'MASK1140'], ['MASK1550', 'MASK1550'], ['MASKLYOT', 'MASKLYOT'], ['SLITLESSPRISM', 'SLITLESSPRISM'], ['SUB128', 'SUB128'], ['SUB256', 'SUB256'], ['SUB64', 'SUB64'], ['SUBPRISM', 'SUBPRISM']]}, 'nircam': {'anomalies_list': [['DIFFRACTION SPIKE', 'DIFFRACTION SPIKE'], ['EXCESSIVE SATURATION', 'EXCESSIVE SATURATION'], ['PERSISTENCE', 'PERSISTENCE'], ['CROSSTALK', 'CROSSTALK'], ['DATA TRANSFER ERROR', 'DATA TRANSFER ERROR'], ['GHOST', 'GHOST'], ['GUIDESTAR FAILURE', 'GUIDESTAR FAILURE'], ['UNUSUAL COSMIC RAYS', 'UNUSUAL COSMIC RAYS'], ['UNUSUAL SNOWBALLS', 'UNUSUAL SNOWBALLS'], ['DRAGONS BREATH', 'DRAGONS BREATH'], ['SCATTERED LIGHT', 'SCATTERED LIGHT'], ['CLAWS', 'CLAWS'], ['WISPS', 'WISPS'], ['TILT EVENT', 'TILT EVENT'], ['OTHER', 'OTHER'], ['NEEDS DISCUSSION', 'NEEDS DISCUSSION']], 'aperture_list': [], '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'], ['WLP4', 'WLP4'], ['F277W', 'F277W'], ['F356W', 'F356W'], ['F444W', 'F444W'], ['F300M', 'F300M'], ['F335M', 'F335M'], ['F360M', 'F360M'], ['F410M', 'F410M'], ['F430M', 'F430M'], ['F460M', 'F460M'], ['F480M', 'F480M'], ['F250M', 'F250M'], ['F322W2', 'F322W2']], 'grating_list': [], 'pupil_list': [['CLEAR', 'CLEAR'], ['FLAT', 'FLAT'], ['F162M', 'F162M'], ['F164N', 'F164N'], ['GDHS0', 'GDHS0'], ['GDHS60', 'GDHS60'], ['MASKBAR', 'MASKBAR'], ['MASKIPR', 'MASKIPR'], ['MASKRND', 'MASKRND'], ['PINHOLES', 'PINHOLES'], ['WLM8', 'WLM8'], ['WLP8', 'WLP8'], ['F323N', 'F323N'], ['F405N', 'F405N'], ['F466N', 'F466N'], ['F470N', 'F470N'], ['GRISMC', 'GRISMC'], ['GRISMR', 'GRISMR'], ['GRISMV2', 'GRISMV2'], ['GRISMV3', 'GRISMV3']], 'readpatt_list': [['RAPID', 'RAPID'], ['SHALLOW2', 'SHALLOW2'], ['BRIGHT2', 'BRIGHT2'], ['MEDIUM2', 'MEDIUM2'], ['SHALLOW4', 'SHALLOW4'], ['MEDIUM8', 'MEDIUM8'], ['BRIGHT1', 'BRIGHT1'], ['DEEP2', 'DEEP2'], ['DEEP8', 'DEEP8']], 'subarray_list': [['FULL', 'FULL'], ['FULLP', 'FULLP'], ['MASK210R', 'MASK210R'], ['MASK335R', 'MASK335R'], ['MASK430R', 'MASK430R'], ['MASKLWB', 'MASKLWB'], ['MASKSWB', 'MASKSWB'], ['SUB160', 'SUB160'], ['SUB160P', 'SUB160P'], ['SUB320', 'SUB320'], ['SUB320A335R', 'SUB320A335R'], ['SUB320A430R', 'SUB320A430R'], ['SUB320B335R', 'SUB320B335R'], ['SUB320B430R', 'SUB320B430R'], ['SUB320BLWB', 'SUB320BLWB'], ['SUB32TATS', 'SUB32TATS'], ['SUB32TATSGRISM', 'SUB32TATSGRISM'], ['SUB400P', 'SUB400P'], ['SUB400X256ALWB', 'SUB400X256ALWB'], ['SUB640', 'SUB640'], ['SUB640A210R', 'SUB640A210R'], ['SUB640ASWB', 'SUB640ASWB'], ['SUB640B210R', 'SUB640B210R'], ['SUB640BSWB', 'SUB640BSWB'], ['SUB64FP1A', 'SUB64FP1A'], ['SUB64FP1B', 'SUB64FP1B'], ['SUB64P', 'SUB64P'], ['SUB8FP1A', 'SUB8FP1A'], ['SUB8FP1B', 'SUB8FP1B'], ['SUB96DHSPILA', 'SUB96DHSPILA'], ['SUB96DHSPILB', 'SUB96DHSPILB'], ['SUBFSA210R', 'SUBFSA210R'], ['SUBFSA335R', 'SUBFSA335R'], ['SUBFSA430R', 'SUBFSA430R'], ['SUBFSALWB', 'SUBFSALWB'], ['SUBFSASWB', 'SUBFSASWB'], ['SUBGRISM128', 'SUBGRISM128'], ['SUBGRISM256', 'SUBGRISM256'], ['SUBGRISM64', 'SUBGRISM64'], ['SUBNDA210R', 'SUBNDA210R'], ['SUBNDA335R', 'SUBNDA335R'], ['SUBNDA430R', 'SUBNDA430R'], ['SUBNDALWBL', 'SUBNDALWBL'], ['SUBNDALWBS', 'SUBNDALWBS'], ['SUBNDASWBL', 'SUBNDASWBL'], ['SUBNDASWBS', 'SUBNDASWBS'], ['SUBNDB210R', 'SUBNDB210R'], ['SUBNDB335R', 'SUBNDB335R'], ['SUBNDB430R', 'SUBNDB430R'], ['SUBNDBLWBL', 'SUBNDBLWBL'], ['SUBNDBLWBS', 'SUBNDBLWBS'], ['SUBNDBSWBL', 'SUBNDBSWBL'], ['SUBNDBSWBS', 'SUBNDBSWBS']]}, 'niriss': {'anomalies_list': [['DIFFRACTION SPIKE', 'DIFFRACTION SPIKE'], ['EXCESSIVE SATURATION', 'EXCESSIVE SATURATION'], ['PERSISTENCE', 'PERSISTENCE'], ['CROSSTALK', 'CROSSTALK'], ['DATA TRANSFER ERROR', 'DATA TRANSFER ERROR'], ['GHOST', 'GHOST'], ['GUIDESTAR FAILURE', 'GUIDESTAR FAILURE'], ['UNUSUAL COSMIC RAYS', 'UNUSUAL COSMIC RAYS'], ['UNUSUAL SNOWBALLS', 'UNUSUAL SNOWBALLS'], ['SCATTERED LIGHT', 'SCATTERED LIGHT'], ['LIGHT SABER', 'LIGHT SABER'], ['OTHER', 'OTHER'], ['NEEDS DISCUSSION', 'NEEDS DISCUSSION']], 'aperture_list': [], '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': [['F090W', 'F090W'], ['F115W', 'F115W'], ['F140M', 'F140M'], ['F150W', 'F150W'], ['F200W', 'F200W'], ['F277W', 'F277W'], ['F356W', 'F356W'], ['F380M', 'F380M'], ['F430M', 'F430M'], ['F444W', 'F444W'], ['F480M', 'F480M'], ['GR150C', 'GR150C'], ['GR150R', 'GR150R']], 'grating_list': [], 'pupil_list': [['CLEARP', 'CLEARP'], ['F090W', 'F090W'], ['F115W', 'F115W'], ['F140M', 'F140M'], ['F150W', 'F150W'], ['F158M', 'F158M'], ['F200W', 'F200W'], ['GR700XD', 'GR700XD'], ['NRM', 'NRM']], 'readpatt_list': [['NISRAPID', 'NISRAPID'], ['NIS', 'NIS']], 'subarray_list': [['FULL', 'FULL'], ['SUB128', 'SUB128'], ['SUB256', 'SUB256'], ['SUB64', 'SUB64'], ['SUB80', 'SUB80'], ['SUBAMPCAL', 'SUBAMPCAL'], ['SUBSTRIP256', 'SUBSTRIP256'], ['SUBSTRIP96', 'SUBSTRIP96'], ['SUBTAAMI', 'SUBTAAMI'], ['SUBTASOSS', 'SUBTASOSS'], ['WFSS128C', 'WFSS128C'], ['WFSS128R', 'WFSS128R'], ['WFSS64C', 'WFSS64C'], ['WFSS64R', 'WFSS64R']]}, 'nirspec': {'anomalies_list': [['DIFFRACTION SPIKE', 'DIFFRACTION SPIKE'], ['EXCESSIVE SATURATION', 'EXCESSIVE SATURATION'], ['PERSISTENCE', 'PERSISTENCE'], ['UNUSUAL COSMIC RAYS', 'UNUSUAL COSMIC RAYS'], ['UNUSUAL SNOWBALLS', 'UNUSUAL SNOWBALLS'], ['NOTICEABLE MSA LEAKAGE', 'NOTICEABLE MSA LEAKAGE'], ['NEW SHORT', 'NEW SHORT'], ['SCATTERED LIGHT', 'SCATTERED LIGHT'], ['TRANSIENT SHORT', 'TRANSIENT SHORT'], ['SUBSEQUENTLY MASKED SHORT', 'SUBSEQUENTLY MASKED SHORT'], ['MONITORED SHORT', 'MONITORED SHORT'], ['BRIGHT OBJECT NOT A SHORT', 'BRIGHT OBJECT NOT A SHORT'], ['OTHER', 'OTHER'], ['NEEDS DISCUSSION', 'NEEDS DISCUSSION']], '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': [['CLEAR', 'CLEAR'], ['F070LP', 'F070LP'], ['F100LP', 'F100LP'], ['F110W', 'F110W'], ['F140X', 'F140X'], ['F170LP', 'F170LP'], ['F290LP', 'F290LP'], ['OPAQUE', 'OPAQUE'], ['P750L', 'P750L']], 'grating_list': [['G140M', 'G140M'], ['G235M', 'G235M'], ['G395M', 'G395M'], ['G140H', 'G140H'], ['G235H', 'G235H'], ['G395H', 'G395H'], ['PRISM', 'PRISM'], ['MIRROR', 'MIRROR']], 'pupil_list': [], 'readpatt_list': [['NRS', 'NRS'], ['NRSRAPID', 'NRSRAPID'], ['NRSIRS2RAPID', 'NRSIRS2RAPID'], ['NRSRAPIDD2', 'NRSRAPIDD2'], ['NRSRAPIDD6', 'NRSRAPIDD6']], 'subarray_list': [['FULL', 'FULL'], ['ALLSLITS', 'ALLSLITS'], ['SUB1024A', 'SUB1024A'], ['SUB1024B', 'SUB1024B'], ['SUB2048', 'SUB2048'], ['SUB32', 'SUB32'], ['SUB512', 'SUB512'], ['SUB512S', 'SUB512S'], ['SUBS200A1', 'SUBS200A1'], ['SUBS200A2', 'SUBS200A2'], ['SUBS200B1', 'SUBS200B1'], ['SUBS400A1', 'SUBS400A1']]}}¶
- pupil = 'GRISMV3'¶
- readpatt = 'FGS8370'¶
- sort_choices = [('Ascending', 'Ascending'), ('Descending', 'Descending'), ('Recent', 'Recent'), ('Oldest', 'Oldest')]¶
- subarray = 'SUBTUNE32LLG2'¶
- 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
- clean_search()[source]¶
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='datetime' value=2024-03-19 15:39:44.189748>¶
- default_mnemonic_identifier = 'IMIR_HK_ICE_SEC_VOLT4'¶
- default_start_time = <Time object: scale='utc' format='datetime' value=2024-03-19 16:39:44.189748>¶
- property media¶
Return all media required to render the widgets on this form.
- now = <Time object: scale='utc' format='datetime' value=2024-03-19 15:39:44.189748>¶
- production_mode = True¶
- 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>}¶
- clean_search()[source]¶
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 runserverTo start the interactive shellL:
python manage.py shellTo 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¶
monitor_models¶
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 thejwql/utils/
directory.
urls.py¶
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
Bryan Hilbert
Maria Pena-Guerrero
Bradley Sappington
Melanie Clarke
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 thejwql
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.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_ajax(request, inst, proposal, observation=None)[source]¶
Generate the page listing archived images by proposal.
- Parameters:
- requestHttpRequest object
Incoming request from the webpage
- inststr
Name of JWST instrument
- proposalstr
Number of observing proposal
- observationstr
Observation number within the proposal
- Returns:
- JsonResponse object
Outgoing response sent to the webpage
- jwql.website.apps.jwql.views.archive_thumbnails_per_observation(request, inst, proposal, observation)[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
- observationstr
- Observation number within the proposal
- Returns:
- HttpResponse object
Outgoing response sent to the webpage
- jwql.website.apps.jwql.views.archive_thumbnails_query_ajax(request)[source]¶
Generate the page listing archived images by query parameters.
- 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 dashboard page
- Parameters:
- requestHttpRequest object
Incoming request from the webpage
- Returns:
- HttpResponse object
Outgoing response sent to the webpage
- jwql.website.apps.jwql.views.download_report(request, inst)[source]¶
Download data report by look status.
- Parameters:
- requestHttpRequest object
Incoming request from the webpage.
- inststr
The JWST instrument of interest.
- Returns:
- responseHttpResponse 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.explore_image(request, inst, file_root, filetype)[source]¶
Generate the explore image page.
- Parameters:
- requestHttpRequest object
Incoming request from the webpage
- inststr
Name of JWST instrument
- file_rootstr
FITS file_root of selected image in filesystem
- filetypestr
Type of file (e.g.
uncal
)
- Returns:
- HttpResponse object
Outgoing response sent to the webpage
- jwql.website.apps.jwql.views.explore_image_ajax(request, inst, file_root, filetype, line_plots='false', low_lim=None, high_lim=None, ext_name='SCI', int1_nr=None, grp1_nr=None, int2_nr=None, grp2_nr=None)[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
- file_rootstr
FITS file_root of selected image in filesystem
- filetypestr
Type of file (e.g.
uncal
)- line_plotsstr
If ‘true’, column and row plots will be computed and shown with the image.
- low_limstr
Signal value to use as the lower limit of the displayed image. If “None”, it will be calculated using the ZScale function
- high_limstr
Signal value to use as the upper limit of the displayed image. If “None”, it will be calculated using the ZScale function
- ext_namestr
Extension to implement in interactive preview image (“SCI”, “DQ”, “GROUPDQ”, “PIXELDQ”, “ERR”…)
- Returns:
- JsonResponse 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
- jwql.website.apps.jwql.views.log_view(request)[source]¶
Access JWQL monitoring logs from the web app.
- 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.save_image_group_ajax(request)[source]¶
Save the latest selected group type in the session.
- Parameters:
- requestHttpRequest
The incoming request.
- Returns:
- JsonResponse
Object containing the group value as set in the session (key: ‘item’).
- jwql.website.apps.jwql.views.save_image_sort_ajax(request)[source]¶
Save the latest selected sort type in the session.
- Parameters:
- requestHttpRequest
The incoming request.
- Returns:
- JsonResponse
Object containing the sort value as set in the session (key: ‘item’).
Save the data from the current page in the session.
Enables navigating to the next or previous page. Current sort options are Ascending/Descending, and Recent/Oldest.
- Parameters:
- request: HttpRequest object
- data: dictionary
the data dictionary to be returned from the calling view function
- nav_by_date_range: boolean
when viewing an image, will the next/previous buttons be sorted by date? (the other option is rootname)
Takes a bracketless string of rootnames and expstarts, and saves it as a session dictionary
- Parameters:
- request: HttpRequest object
Incoming request from the webpage
- Returns:
- HttpResponse object
Outgoing response sent to the webpage
- jwql.website.apps.jwql.views.set_viewed_ajax(request, group_root, status)[source]¶
Update the model’s “viewed” field for a group of files
- Parameters:
- requestHttpRequest object
Incoming request from the webpage
- group_rootstr
Group root name, matching filename roots up to but not including the detector.
- status{‘new’, ‘viewed’}
Value to set: ‘new’ for viewed=False, ‘viewed’ for viewed=True.
- Returns:
- JsonResponse object
Outgoing response sent to the webpage
- jwql.website.apps.jwql.views.toggle_viewed_ajax(request, file_root)[source]¶
Update the model’s “mark_viewed” field and save in the database
- Parameters:
- requestHttpRequest object
Incoming request from the webpage
- file_rootstr
FITS file_root of selected image in filesystem
- Returns:
- JsonResponse 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_exposure(request, inst, group_root)[source]¶
Generate the exposure view page.
- Parameters:
- requestHttpRequest object
Incoming request from the webpage.
- inststr
Name of JWST instrument.
- group_rootstr
Exposure group, matching file root names up to but not including the detector.
- Returns:
- HttpResponse object
Outgoing response sent to the webpage
- jwql.website.apps.jwql.views.view_header(request, inst, filename, filetype)[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
- filetypestr
Type of file (e.g.
uncal
)
- Returns:
- HttpResponse object
Outgoing response sent to the webpage
- jwql.website.apps.jwql.views.view_image(request, inst, file_root)[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
- Returns:
- HttpResponse object
Outgoing response sent to the webpage