|
|
|
|
|
||
DAO Science Archive Help: Programmatic Data Access |
Accessing DAO Data from ScriptsDAO files can be retrieved directly from your scripts by using a URL's of the form "http://www.cadc.hia.nrc.gc.ca/data/pub". If files are proprietary this URL is redirected to one of the form "http://www.cadc.hia.nrc.gc.ca/data/auth" and you will be prompted for your CADC user ID and password if you use such a URL from a web browser. Alternatively, you will need to include authentication in a curl command. Note that DAO files are stored in gzipped format so this URL will return a compressed file. For example, below is a simple 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/data/pub";
my ( $fileId );
foreach $fileId (@files)
{
`curl --location-trusted -g -o $fileId.fits.gz "$baseUrl/DAO/$fileId"`;
}
exit();
You can also retrieve proprietary files (if you have authorization!) by modifying this basic script as shown below. Note the use of your CADC user account information.
#!/usr/bin/env perl
use strict;
my $baseUrl = "http://www.cadc.hia.nrc.gc.ca/data/pub";
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 --location-trusted -g -o $fileId.fits.gz -u $cadcUserId:$passWord "$baseUrl/DAO/$fileId"`;
}
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.