Overview
Theo ten Brummelaar is working on the definition of a file for publishing the observation logs from the CLIMB and CLASSIC instruments at
CHARA
.
Data submission
Data is stored in a comma-separated-value (CSV) file that is currently sent to the endpoint for import.
The underlying module is in charge of extracting the data and creating a
OiDB granule for each observation.
Data mapping
Each line (apart from header) is parsed as a CSV record and fields are imported as L0 data in
OiDB.
The following rules are followed for mapping columns from the file row to the database schema of
OiDB (based on the the
!ObsCore model):
- the rows are currently imported as part of a collection named "CHARA Import" (
obs_collection
)
- the names from the PI field are split and the first one is put in the
datapi
- the ID from the PROGRAM field is copied to the
progid
- the coordinates are resolved with Simbad from the name in the STAR column
- the observation start and stop times (
t_min
, t_max
) are set to the value of the MJD column
- the name of the facility used for the observation is set to 'MtW.CHARA' (from ever-growing list of facilities - ADS Web Services)
- the name of the instrument (
instrument_name
) is taken from the COMBINER column
- the name of the instrument mode (
instrument_mode
) is taken from the FILTER column
- the COMBINER and FILTER are used for searching the min (
em_min
) and max (em_max
) wavelengths in ASPRO configuration files
- the data URL (
access_url
) is left empty
- the total exposure time (
t_exptime
) is not filled
- the temporal resolution (
t_resolution
) is not filled
- the spectral resolving power (
em_res_power
) is not filled
- the channel count (
nb_channel
) is not filled
- the counts for VIS (
nb_vis
), VIS2 (nb_vis2
) and T3 (nb_t3
) measurement is not filled
- the granule is marked as proprietary (
data_rights
) with no release date
The TYPE column (OBJ, LAB, CAL), SCOPES, B1, B2, B3 and T0 are currently not mapped.
If the target can not be resolved (unknown by Simbad) or the mode can not be found in ASPRO configuration files, no granule is saved and a warning is logged.
REST endpoint
Submission requires authentication. Before using the REST endpoint to push new data, the user has to start a new session prior to sending the granules.
For example, on a command line with
cURL
:
# authenticate and start session, change <username> and <password>
curl --request POST --cookie-jar cookies -duser=<username> -d password=<password> http://oidb.jmmc.fr/submit.html
# push the file of observation logs (the preceding '@' is important)
curl --request POST --cookie cookies -H 'Content-type:text/csv' --data-binary @data.csv "http://oidb.jmmc.fr/exist/apps/oidb/modules/upload-chara.xql"
# closing the session
curl --cookie cookies http://oidb.jmmc.fr/index.html?logout=true
rm cookies
Notes
At the moment this is a push operation but it may ultimately instead be a pull where the file of logs is downloaded from a known location and processed by the
OiDB on a regular basis.
The file format is not final yet.