Documentation

Documentation caom2repo

caom2repo

INSTALL

caom2repo.py is a python client based on the caom2repoClient library. caom2repo.py can be installed using Python's pip command:

pip install http://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/software/caom2repoClient-0.5.1.tar.gz

or you can download the tar file reference above and do a manual installation using python setup.py install

The caom2repoClient module relies on the CADC_ROOT environment variable to find certain configuration information. The variable ‘CADC_ROOT’ will need to be set to the location where the caom2repoCliet modules was installed. Likely, the easiest way to set the variable is with the following command:

BASH

export CADC_ROOT=`python -c 'import caom2repoClient,os ; dirname=os.path.dirname(caom2repoClient.__path__[0]); idx=dirname.find("/lib") ; print dirname[:idx]'`

Or (t)csh

setenv CADC_ROOT `python -c 'import caom2repoClient,os ; dirname=os.path.dirname(caom2repoClient.__path__[0]); idx=dirname.find("/lib") ; print dirname[:idx]'`

USAGE

caom2repo.py is self documented, checkout the options with the command:

caom2repo.py --help

The caom2repo.py script pushes the XML file containing the CAOM record to the CADC's CAOM repository. The repository propagates the contents to our database servers (after checking that the CAOM record does not have any obvious problems). Below is the command that one would use to upload the CAOM record created in the fits2caom2 example:

caom2repo.py --put caom:CFHT/1615920 1615920.xml

The argument after the --put is the ‘URI’ of the CAOM record. These should be of the form: caom:{COLLECTION}/{observationID} where the values of COLLECTION and observationID match the values used when creating the CAOM entry contained in the given XML document being uploadd to the service.