The look & feel, the behaviour and the contents of ESAP can be configured on different levels.
Admin Page
The easiest level of configuration is when the application is already deployed with correct configuration files. You can use the 'Admin' application to change some of the behaviour and content, but only that which is stored in the configuration database. You need a 'superuser' account for the backend for this.
Source Tree (source code and config files)
settings
The main switch to a different configuration is the Django application settings
. This is a directory containing several files for specific situations.
Like for developing, testing and production, but it is also possible to create a specific file for a specific application.
There are 2 configuration settings that you could change:
- The database, which default is
esap_config.sqlite
. This contains all the defined datasets, catalogs and parameter mappings for ESAP. - The
configuration_file
. This points to a file in the 'esap/configuration' directory that contains more specification parameters. (see 'configuration file parameters' on this page)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'esap_config.sqlite3'),
},
}
# configuration settings that can be requested through the REST API
CONFIGURATION_DIR = os.path.join(BASE_DIR, 'configuration')
CONFIGURATION_FILE = 'esap_solar'
configuration file parameters
The ESAP Gateway source contains a configuration directory with some example configuration files.
Default the esap_default.py
configuration is active, but in this example the esap_solar.py
configuration is used to show how to turn ESAP into a specific application for Solar Astronomy.
- Solar Astronomy does not use sky coordinates like RA, dec, because the target is always the sun.
- Instead it uses
startdate
andenddate
parameters to select a time range. - Most of the menu options are not needed. In this example only the
Query
andSettings
menu's are activated. - The title and logo are both set to something.. sunny.
- Only sun related datasets are needed, so only
vso
andhelio
are enabled. - The query parameters have been limited to only use appropriate parameters.
title = "ESAP Solar"
# the url location of the frontend application,
# this makes it possible to install multiple instances in different directories on the webserver
# that all have their own urls like 'http://esap.astron.nl/esap-gui-dev/queries'
frontend_basename="esap-solar"
logo = "https://alta.astron.nl/alta-static/images/esap/esap_solar.png"
# definition of the navigation bar
nav4 = {'title': 'Query', 'route': '/query'}
nav5 = {'title': 'Settings', 'route': '/about'}
navbar = [nav4,nav5]
# if datasets_enabled is set, then only these datasets are visible to the GUI
datasets_enabled = ['vso','helio']
# definition of the query
query_schema = {
"title": "ESAP Solar Query",
"type": "object",
"properties": {
"institute": {
"type": "string",
"title": "Institute",
"default": "all",
"enum": ["all","Astron"],
"enumNames": ["all","astron"]
},
"dataproduct_type": {
"type": "string",
"title": "DataProduct Type",
"default": "all",
"enum": ["all","image","cube"],
"enumNames": ["all","image","cube"]
},
"dataproduct_subtype": {
"type": "string",
"title": "DataProduct Subtype",
"default": "all",
"enum": ["all","continuumMF","imageCube","beamCube"],
"enumNames": ["all","continuumMF","imageCube","beamCube"]
},
"startdate": {
"type": "string",
"format" : "date",
"title": "Start Date"
}
,
"enddate": {
"type": "string",
"format" : "date",
"title": "End Date"
},
"instrument": {
"type": "string",
"default": "SOHO__MDI",
"enum": ["all", "SOHO__EIT", "SOHO__MDI", "PDMO__COGHA", "HINODE__EIS", "STEREO_A__COR", "STEREO_B__COR"],
}
}
}
REST API and GUI
These configuration parameters are all set at the backend in the ESAP Gateway, but it is the frontend GUI that needs to reflect this configuration to the user.
Therefore, the GUI can make a REST API call to the ESAP API Gateway, which will return the above configuration in JSON format. If no extra name
parameter is given then the default configuration, as specified in the settings.py, will be loaded.
{"configuration":
{"version": "ASTRON - version 9 jul 2020",
"frontend_basename": "esap-gui",
"logo": "https://alta.astron.nl/alta-static/images/esap/adex_logo.png",
"navbar": [{"title": "Archives", "route": "/archives"}, {"title": "Query", "route": "/query"}],
"query_schema": {"name": "adex", "title": "ASTRON Data Collection Query", "type": "object", "properties": {"catalog": {"type": "string", "title": "Catalog", "default": "apertif", "enum": ["all", "apertif", "astron_vo"], "enumNames": ["All", "Apertif", "ASTRON_VO"]}, "target": {"type": "string", "title": "Target"}, "ra": {"type": "number", "title": "RA (degrees)"}, "dec": {"type": "number", "title": "dec (degrees)"}, "fov": {"type": "number", "title": "search radius (degrees)"}, "level": {"type": "string", "title": "Processing Level", "default": "raw", "enum": ["all", "raw", "processed"], "enumNames": ["All", "Raw", "Processed"]}, "category": {"type": "string", "title": "Keywords"}}}, "datasets_disabled": ["nancay.ivoa.obscore"]}}
If a name
parameter is given then the appropriate configuration will be loaded from the configuration module.
{"configuration":
{"frontend_basename": "esap-solar",
"logo": "https://alta.astron.nl/alta-static/images/esap/esap_solar.png",
"title": "ESAP Solar",
"navbar": [{"title": "Query", "route": "/query"}, {"title": "Settings", "route": "/about"}],
"query_schema": {"title": "ESAP Solar Query", "type": "object", "properties": {"institute": {"type": "string", "title": "Institute", "default": "all", "enum": ["all", "Astron"], "enumNames": ["all", "astron"]}, "dataproduct_type": {"type": "string", "title": "DataProduct Type", "default": "all", "enum": ["all", "image", "cube"], "enumNames": ["all", "image", "cube"]}, "dataproduct_subtype": {"type": "string", "title": "DataProduct Subtype", "default": "all", "enum": ["all", "continuumMF", "imageCube", "beamCube"], "enumNames": ["all", "continuumMF", "imageCube", "beamCube"]}, "startdate": {"type": "string", "format": "date", "title": "Start Date"}, "enddate": {"type": "string", "format": "date", "title": "End Date"}, "instrument": {"type": "string", "default": "SOHO__MDI", "enum": ["all", "SOHO__EIT", "SOHO__MDI", "PDMO__COGHA", "HINODE__EIS", "STEREO_A__COR", "STEREO_B__COR"]}}},
"datasets_enabled": ["vso", "helio"]
}
}
Examples of alternative GUI's
When the GUI fetches the above configuration it can render it accordingly: