astroquery icon indicating copy to clipboard operation
astroquery copied to clipboard

ESO retrieve_data does not download ancillary data?

Open sousasag opened this issue 2 years ago • 3 comments

Hi,

I was trying to get the ancillary data (processed files) from HARPS observation. I tried the option with_calib="processed", but it only downloads the ADP final product.

Is there a way to include the ancillary data that we see in the ESO download portal?

image

sousasag avatar Nov 24 '23 12:11 sousasag

I tried the option with_calib="processed"

This won't help because this option refers to including master calibrations associated with raw data, and you're downloading reduced products. What you're asking about is what we call "dataset expansion" which uses VO Datalink protocol to find related ancillary files.

Is there a way to include the ancillary data that we see in the ESO download portal?

There is ongoing work to re-write the astroquery ESO module https://github.com/astropy/astroquery/pull/2681 however it does not contain the feature you're asking about.

Pharisaeus avatar Nov 26 '23 12:11 Pharisaeus

Thanks for the feedback. In the meantime I found a workaround (could be simpler) to get the ancillary data for HARPS.

For those in need, here is my workaround:

tbl_adp = list(tbl_search['ARCFILE'])
tbl_ret = []
for f in tbl_adp:
   fs = f.split(":")
   x = (float(fs[-1])*1000.+1.)/1000.
   f_new = fs[0]+":"+fs[1]+":"+f"{x:06.3f}"
   tbl_ret.append(f)
   tbl_ret.append(f_new)
   eso.retrieve_data(tbl_ret, destination= path_download)`

This works assuming that you have to sum "1" to the name of the ARCFILE. For example.

ADP file with HARPS reduced spectra with ARCFILE: ADP.2019-12-20T01:19:11.029 The associated ancillary (tar file) will be the ARCFILE: ADP.2019-12-20T01:19:11.030

The workaround should work for most of the cases.

sousasag avatar Nov 26 '23 12:11 sousasag

Hi, although not (yet) available in astroquery, you could try to retrieve the ancillary files via the ESO's Datalink service, see http://archive.eso.org/cms/eso-data/programmatic-access.html For example: http://archive.eso.org/datalink/links?ID=ivo://eso.org/ID?ADP.2019-12-20T01:19:11.029 or http://archive.eso.org/datalink/links?ID=ivo://eso.org/ID?ADP.2019-12-20T01:19:11.029&RESPONSEFORMAT=json

szampier avatar Nov 27 '23 15:11 szampier