The DAO Science Archive (DAOSA)

DAO Science Archive Help: Programmatic Data Access

Accessing DAO Data from Scripts

DAO files can be retrieved directly from your scripts by using a URL's of the form "http://www.cadc.hia.nrc.gc.ca/getData?" for public data or "http://www.cadc.hia.nrc.gc.ca/getData/auth?" for proprietary datasets (with the appropriate authorization passed as parameters - see below). Note that DAO files are stored in gzipped format so either form of the getData URL will return a compressed file.

For example, below is a trivial PERL script that retrieves three public files from the DAO Science Archive:

  #!/usr/bin/env perl 
  use strict;

  my @files    = ( "dao_c122_2010_012345", "dao_c182_2010_023456", "dao_20101215_skycam0" );
  my $baseUrl  = "http://www.cadc.hia.nrc.gc.ca/getData";
  my ( $fileId );

  foreach $fileId (@files)
  {
    `curl -L -g -o $fileId.fits.gz "$baseUrl?archive=DAO\&file_id=$fileId"`;
  }

  exit();

You can also retrieve proprietary files (if you have authorization!) by modifying this basic script as shown below. Note the "auth" appended to $baseURL as well as the use of your CADC user account information.

  #!/usr/bin/env perl 
  use strict;

  my $baseUrl       = "http://www.cadc.hia.nrc.gc.ca/getData/auth";
  my $cadcUserId    = "dbohlender";  # Your CADC user ID
  my $passWord      = "????????";    # Your CADC account password
  my @files         = ( "dao_c122_2010_012345", "dao_c182_2010_023456", "dao_20101215_skycam0" );
  my ( $fileId );

  foreach $fileId (@files)
  {
    `curl -L -g -o $fileId.fits.gz -u $cadcUserId:$passWord 
        "$baseUrl?archive=DAO\&file_id=$fileId\&user=$cadcUserId\&password=$passWord"`;
  }

  exit();
  

You can find more details and other examples of "getData" usage, including retrieval of FITS header content, here.

DAO telescope users are requested to acknowledge the use of the DAO facilities in their publications. The preferred form is a footnote to the author's byline, such as:

*Based on observations obtained at the Dominion Astrophysical Observatory, Herzberg Institute of Astrophysics, National Research Council of Canada.

If you have used CADC facilities for your research, please also include the following acknowledgment in any publications:

This research used the facilities of the Canadian Astronomy Data Centre operated by the National Research Council of Canada with the support of the Canadian Space Agency.