Querying SAFIQ

home dfos WISQ administration documentation procedures concepts external: QC

If you need to retrieve information from header keywords for a large number of files a direct sql query to SAFIQ is probably the fastest way.

Here is an example to retrieve
the contents of the keyword HIERARCH ESO DET OUT1 PRSCX
for FORS1 data observed between 2002-01-01 and 2007-03-25,
where the contents of the keyword HIERARCH ESO DET OUTPUTS is 4:

select dp_id,kw_value from dbcm.keywords_repository where kw_name='HIERARCH ESO DET OUT1 PRSCX'
and dp_id in (select dp_id from dbcm.keywords_repository where dp_id between 'FORS1.2002-01-01' and 'FORS1.2007-03-26'
and kw_value='4' and kw_name='HIERARCH ESO DET OUTPUTS')

This query takes about 10 minutes to complete and returns 91348 entries.

The SAFIQ database is column-oriented, so if you need information on more than one keyword the fastest way is to get the information for each keyword separately and combine the information afterwards.

The information to connect to SAFIQ can be found in your .dbrc file.