Skip to content

GAIA: the method load_data must parse ecsv files#3500

Merged
bsipocz merged 2 commits intoastropy:mainfrom
esdc-esac-esa-int:ESA_gaia_C9GACS-1079_datalink_ecsv_format
Jan 16, 2026
Merged

GAIA: the method load_data must parse ecsv files#3500
bsipocz merged 2 commits intoastropy:mainfrom
esdc-esac-esa-int:ESA_gaia_C9GACS-1079_datalink_ecsv_format

Conversation

@cosmoJFH
Copy link
Copy Markdown
Contributor

@cosmoJFH cosmoJFH commented Jan 16, 2026

Dear Astroquery team,

we would like to update the method load_data in the Gaia module, since we have found that it does not return the expected results (an astropy Table) for the format = 'ecsv'. The following example illustrates this issue

from astroquery.gaia import Gaia

user = 'xxxx'
password = 'xxxxx'
Gaia.login(user = user, password = password)


source_ids     = ['6680733225618222592']
retrieval_type = 'EPOCH_PHOTOMETRY' 
data_structure = 'RAW'     
data_release   = 'Gaia DR2'


# The data is retrieved as a csv file
# The returned dictionary contains an astropy Table

datalink = Gaia.load_data(ids=source_ids, 
                          data_release=data_release, 
                          retrieval_type=retrieval_type, 
                          data_structure=data_structure, 
                          verbose=False, 
                          dump_to_file=True,
                          format='csv')

dl_keys = sorted([key for key in datalink.keys()])
print("\nThe Datalink product has been downloaded:")
print('-' * 160)
for dl_key in dl_keys:
    print(f' * {dl_key}')
    print(datalink[dl_key])

INFO: DataLink products will be stored in the /home/jfernandez/datalink_output_20260116T061207.476383.zip file [astroquery.gaia.core]

The Datalink product has been downloaded:
----------------------------------------------------------------------------------------------------------------------------------------------------------------
 * EPOCH_PHOTOMETRY-Gaia DR2 6680733225618222592.csv
[<Table length=132>
     source_id          transit_id    band ... other_flags    solution_id    
       int64              int64       str2 ...    int64          int64       
------------------- ----------------- ---- ... ----------- ------------------
6680733225618222592 17714070537773976    G ...           1 369295549951641967
...




# The data is retrieved as an ecsv file
# The returned dictionary contains a path to the downloaded file

datalink = Gaia.load_data(ids=source_ids, 
                          data_release=data_release, 
                          retrieval_type=retrieval_type, 
                          data_structure=data_structure, 
                          verbose=False, 
                          dump_to_file=True,
                          format='ecsv')

dl_keys = sorted([key for key in datalink.keys()])
print("\nThe Datalink product has been downloaded:")
print('-' * 160)
for dl_key in dl_keys:
    print(f' * {dl_key}')
    print(datalink[dl_key])
    
The Datalink product has been downloaded:
----------------------------------------------------------------------------------------------------------------------------------------------------------------
 * EPOCH_PHOTOMETRY-Gaia DR2 6680733225618222592.ecsv
/home/jfernandez/EPOCH_PHOTOMETRY-Gaia DR2 6680733225618222592.ecsv 

cc @esdc-esac-esa-int
Jira: C9GACS-1079

@cosmoJFH cosmoJFH added the gaia label Jan 16, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.82%. Comparing base (27a673d) to head (7a1dc3d).
⚠️ Report is 11 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3500      +/-   ##
==========================================
+ Coverage   71.73%   71.82%   +0.08%     
==========================================
  Files         235      235              
  Lines       20258    20266       +8     
==========================================
+ Hits        14533    14556      +23     
+ Misses       5725     5710      -15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cosmoJFH cosmoJFH force-pushed the ESA_gaia_C9GACS-1079_datalink_ecsv_format branch 6 times, most recently from 48e83fb to 0570ed4 Compare January 16, 2026 15:32
@cosmoJFH cosmoJFH force-pushed the ESA_gaia_C9GACS-1079_datalink_ecsv_format branch from ffa6d2e to 7a1dc3d Compare January 16, 2026 15:35
@bsipocz bsipocz added this to the 0.4.12 milestone Jan 16, 2026
Copy link
Copy Markdown
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all looks good, thanks you!

@bsipocz bsipocz merged commit 9533bc2 into astropy:main Jan 16, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants