Skip to content

Commit

Permalink
Merge pull request #45 from laurenmarietta/web-app-dev
Browse files Browse the repository at this point in the history
Integrate Django web application
  • Loading branch information
laurenmarietta authored Aug 16, 2018
2 parents a0315b2 + 6c288ab commit 10e6bfc
Show file tree
Hide file tree
Showing 58 changed files with 2,889 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
*.pyc
*.fits
*.ipynb_checkpoints/
utils/config.json
/jwql/utils/config.json
build/
dist/
jwql.egg-info/
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ python setup.py develop

or, if you would rather use `SSH` instead of `https`, type
```
git clone [email protected]:spacetelescope/jwql.git
git clone [email protected]:spacetelescope/jwql.git
cd jwql
python setup.py develop
```
Expand Down Expand Up @@ -122,7 +122,7 @@ Any questions about the `jwql` project or its software can be directed to `jwql@
- Catherine Gosmeyer (INS) [@cgosmeyer](https://github.com/cgosmeyer)
- Phil Grant (ITSD)
- Dean Hines (INS)
- Sherrie Holfeltz (INS) [@stholfeltz](https://github.com/stholfeltz)
- Sherie Holfeltz (INS) [@stholfeltz](https://github.com/stholfeltz)
- Joe Hunkeler (OED) [@jhunkeler](https://github.com/jhunkeler)
- Catherine Kaleida (OED)
- Mark Kyprianou (OED) [@mkyp](https://github.com/mkyp)
Expand Down
1 change: 1 addition & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies:
- astroquery=0.3.8
- bokeh=0.12.5
- django=2.0.5
- jinja2=2.10
- jwst=0.7.8rc9
- matplotlib=2.1.1
- numpy=1.14.0
Expand Down
17 changes: 16 additions & 1 deletion jwql/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,24 @@

__location__ = os.path.realpath(os.path.join(os.getcwd(), os.path.dirname(__file__)))

JWST_INSTRUMENTS = ['NIRISS', 'NIRCam', 'NIRSpec', 'MIRI', 'FGS']
JWST_INSTRUMENTS = sorted(['NIRISS', 'NIRCam', 'NIRSpec', 'MIRI', 'FGS'])
JWST_DATAPRODUCTS = ['IMAGE', 'SPECTRUM', 'SED', 'TIMESERIES', 'VISIBILITY',
'EVENTLIST', 'CUBE', 'CATALOG', 'ENGINEERING', 'NULL']
MONITORS = {
'FGS': ['Bad Pixel Monitor'],
'MIRI': ['Dark Current Monitor',
'Bad Pixel Monitor', 'Cosmic Ray Monitor', 'Photometry Monitor',
'TA Failure Monitor', 'Blind Pointing Accuracy Monitor',
'Filter and Calibration Lamp Monitor', 'Thermal Emission Monitor'],
'NIRCam': ['Bias Monitor',
'Readnoise Monitor', 'Gain Level Monitor',
'Mean Dark Current Rate Monitor', 'Photometric Stability Monitor'],
'NIRISS': ['Bad Pixel Monitor',
'Readnoise Monitor', 'AMI Calibrator Monitor', 'TSO RMS Monitor'],
'NIRSpec': ['Optical Short Monitor', 'Target Acquisition Monitor',
'Detector Health Monitor', 'Ref Pix Monitor',
'Internal Lamp Monitor', 'Instrument Model Updates',
'Failed-open Shutter Monitor']}

def get_config():
"""Return a dictionary that holds the contents of the ``jwql``
Expand Down
Empty file added website/__init__.py
Empty file.
Empty file added website/apps/__init__.py
Empty file.
Empty file added website/apps/jwql/__init__.py
Empty file.
32 changes: 32 additions & 0 deletions website/apps/jwql/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""Customizes the ``jwql`` web app administrative page.
** CURRENTLY NOT IN USE **
Used to customize django's admin interface, and how the data contained
in specific models is portrayed.
Authors
-------
- Lauren Chambers
References
----------
For more information please see:
``https://docs.djangoproject.com/en/2.0/ref/contrib/admin/``
"""

from django.contrib import admin

from .models import ImageData


class ImageDataAdmin(admin.ModelAdmin):
# fieldsets = [('Filepath', {'fields': ['filepath']}),
# ('Instrument', {'fields': ['inst']}),
# ('Date information', {'fields': ['pub_date']})]
list_display = ('filename', 'inst', 'pub_date')
list_filter = ['pub_date']

admin.site.register(ImageData, ImageDataAdmin)
32 changes: 32 additions & 0 deletions website/apps/jwql/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""Customizes the ``jwql`` app settings.
** CURRENTLY NOT IN USE **
Optionally defines an ``AppConfig`` class that can be called in
``INSTALLED_APPS`` in settings.py to configure the web app.
Authors
-------
- Lauren Chambers
Use
---
This module is called in ``settings.py`` as such:
::
INSTALLED_APPS = ['apps.jwql.PlotsExampleConfig',
...
]
References
----------
For more information please see:
``https://docs.djangoproject.com/en/2.0/ref/applications/``
"""

from django.apps import AppConfig


class PlotsExampleConfig(AppConfig):
name = 'jwql'
Loading

0 comments on commit 10e6bfc

Please sign in to comment.