Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix download error due to no dataURL in MAST result #1380

Merged

Conversation

orionlee
Copy link
Collaborator

@orionlee orionlee commented Nov 1, 2023

Close #1377 , #1381


Changelog:

Fixed SearchResult.download() / download_all()'s misuse of dataURL. [#1380]

@orionlee
Copy link
Collaborator Author

orionlee commented Nov 1, 2023

A small, unrelated commit, 7693e28, was added to update the test codes. It handles an unrelated changes in MAST search result for Kepler products, to handle the additional KBONUS-BKG product, which seems to be related to https://archive.stsci.edu/hlsp/kbonus-apexba

I don't think anything needs to be changed on lightkurve side. But I am not familiar with Kepler products, so I call it out here just in case.

import lightkurve as lk
# insert code here ...

sr = lk.search_lightcurve("Kepler-10", mission="Kepler", cadence="long")
print(sr)
SearchResult containing 16 data products.

 #       mission      year   author   exptime         target_name          distance proposal_id
                                         s                                  arcsec             
--- ----------------- ---- ---------- ------- ---------------------------- -------- -----------
  0   Kepler Quarter  2009 KBONUS-BKG    1765 Gaia DR3 2132155017099178624      0.0         N/A
  1 Kepler Quarter 00 2009     Kepler    1800                kplr011904151      0.0          EX
  2 Kepler Quarter 01 2009     Kepler    1800                kplr011904151      0.0          EX
...
15 Kepler Quarter 17 2013     Kepler    1800                kplr011904151      0.0          EX

@scfleming
Copy link
Collaborator

scfleming commented Nov 1, 2023

Just a quick note, that is a new HLSP update we just announced today (shortly, I'm working on the MAST announcement as we speak.) MAST homepage: https://archive.stsci.edu/hlsp/kbonus-bkg

@Nschanche
Copy link
Collaborator

We could sort the search results by author to return 'mission products' at the top and HLSPs below if that would be preferable?

@christinahedges
Copy link
Collaborator

christinahedges commented Nov 2, 2023

@orionlee thanks for opening this PR, we're all just coming up against this new change now. I've updated two things on your PR, I've added the URL for this HLSP which @scfleming provided, and I've changed the ordering to make sure that this HLSP is not the first product that comes up (the mission product should be first in the list.) (seeing now @Nschanche has made the same comment above!)

@jorgemarpa and I will open a new PR to make sure there's a specific reader for this new HLSP.

@orionlee I'm going to release a new version ASAP to make sure people can pip upgrade to get around this issue. Let's prepare for lots of new issues to open about this...!

@christinahedges christinahedges merged commit 7a7dc2a into lightkurve:main Nov 2, 2023
@orionlee
Copy link
Collaborator Author

orionlee commented Nov 2, 2023

@christinahedges

  1. The CHANGES.rst in main is out of sync with the v2.4.x version, essentially part of the issue branch v2.4.x and main is of of sync that could cause merge headache #1378 [*]. It probably needs to be addressed before release.

  2. For KBONUS-BKG support, I did a quick look yesterday, and suspect the following might need to be considered:

  • each lightcurve file contains data stitched across multiple quarters. It could be surprising to users when they search for data in specific quarter, the KBONUS-BKG lightcurve will have results across multiple quarters.

[*] The current main CHANGES.rst is out of sync with the released 2.4.1 . It should be something like:

2.4.2dev (unreleased)
=====================

- Updated plot style to default to higher resolution [#1311]
- Fixed download issue due to MAST API change [#1380]

2.4.1 (2023-09-06)
==================

- Updated interact features to work with JupyterHub (e.g. TiKE) [#1349]
- Exposed niters parameter in the PCA function of design matrix
- Fixed the aperture parsing functions inside TPFs to be compliant with `numpy` v1.25 [#1360]

@christinahedges
Copy link
Collaborator

@orionlee great catch, I lost track of this with all the MAST changes, I'll remedy it.

For the new HLSP, @jorgemarpa and I are the authors of the release so I'm working on putting in a fix now.

danhey added a commit to danhey/lightkurve that referenced this pull request Dec 13, 2023
commit 5e4c619
Author: Sam Lee <orionlee@users.noreply.github.com>
Date:   Tue Dec 5 08:21:02 2023 -0800

    pytests: isolate astropy cache from user defaults (lightkurve#1391)

commit eabc909
Author: Sam Lee <orionlee@users.noreply.github.com>
Date:   Tue Dec 5 08:20:24 2023 -0800

    Support QLP changes in sectors 56+ (lightkurve#1392)

    * QLP sector 56+: handle default flux_err column

    * handle QLP-specific quality bitmask

    * docstring updates for QLP sectors 56+

    * add changelog [skip ci]

commit 68fdf03
Author: Sam Lee <orionlee@users.noreply.github.com>
Date:   Tue Dec 5 08:14:18 2023 -0800

    Fix memory leak in reading LC/TPF  (lightkurve#1390)

    * Fixed memleak for lc in lightkurve#1388

    * Fixed memleak for tpf in lightkurve#1388

    * add test for read HDUList

    * Explicit tests for read memory leaks (LC & TPF)
    - Run in memtest workflow in CI (pytest -m memtest --remote-data)

    * Test tpf.from_fits_images() to ensure no unclosed file handles

    * Revert lc.hdu change in PR lightkurve#1299

    * Revert raising ResourceWarning as error during tests in PR lightkurve#1299
    - For it to actually work (to ensure no unclosed files), "error::pytest.PytestUnraisableExceptionWarning" wil also be needed
    - but it'll create many false alarms.
    - Explicit tests on unclosed file handles is done in specific tests instead.

    * add changelog  [skip ci]

commit f8e8c16
Author: Christina Hedges <christina.l.hedges@nasa.gov>
Date:   Fri Nov 3 11:12:48 2023 -0400

    updating to v2.5.0dev [skip ci]

commit 1a6b7c2
Author: Christina Hedges <christina.l.hedges@nasa.gov>
Date:   Fri Nov 3 11:02:06 2023 -0400

    release v2.4.2 [skip ci]

commit 47cbfcf
Author: Christina Hedges <christina.l.hedges@nasa.gov>
Date:   Fri Nov 3 11:01:05 2023 -0400

    releasing v2.4.2

commit e3bd292
Author: Christina Hedges <14965634+christinahedges@users.noreply.github.com>
Date:   Fri Nov 3 01:59:04 2023 -0400

    Revert "Update the stylefile 💅 (lightkurve#1311)" (lightkurve#1382)

    This reverts commit 3b9a0af.

commit 7be1a0f
Author: Christina Hedges <14965634+christinahedges@users.noreply.github.com>
Date:   Thu Nov 2 20:51:37 2023 -0400

    fix changelog and version number

commit 3b9a0af
Author: Daniel <38233719+danhey@users.noreply.github.com>
Date:   Thu Nov 2 10:33:31 2023 -1000

    Update the stylefile 💅 (lightkurve#1311)

    * update stylefile

    * mark edge colors

    * changed lightkurve plotting style

    * update merge conflict [skip ci]

    ---------

    Co-authored-by: Christina Hedges <christina.l.hedges@nasa.gov>

commit 7a7dc2a
Author: Sam Lee <orionlee@users.noreply.github.com>
Date:   Thu Nov 2 12:02:17 2023 -0700

    Fix download error due to no dataURL in MAST result (lightkurve#1380)

    * Fix downlod error due to missing dataURL in MAST result.

    * handle changes in MAST for some Kepler search due to extra KBONUS-BKG
    - some (but not all) Kepler search returns an extra KBONUS-BKG

    * fixing searchresult ordering and HLSP URL

    * update changelog [skip ci]

    ---------

    Co-authored-by: Christina Hedges <christina.l.hedges@nasa.gov>

commit b098e81
Author: Rebekah <rebekahhounsell@gmail.com>
Date:   Thu Nov 2 14:28:28 2023 -0400

    Changed flux_raw to flux_corr for TASOC files (lightkurve#1333)

    * updated to corr

    * trying to re-initiate checks

commit ce610e8
Author: Nschanche <nschanch@umd.edu>
Date:   Thu Nov 2 14:23:19 2023 -0400

    Update searching-for-data-products (lightkurve#1370)

    Modified text to reflect search results

commit dde5582
Author: H. Arda Güler <80536083+arda-guler@users.noreply.github.com>
Date:   Thu Nov 2 21:22:48 2023 +0300

    Remove redundant conditional (lightkurve#1374)

    in regressioncorrector.py

commit 4f2dbed
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Thu Oct 5 10:31:37 2023 -0400

    Bump actions/checkout from 3 to 4 (lightkurve#1367)

    Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
    - [Release notes](https://github.com/actions/checkout/releases)
    - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
    - [Commits](actions/checkout@v3...v4)

    ---
    updated-dependencies:
    - dependency-name: actions/checkout
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...

    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

commit 382fd3a
Author: Christina Hedges <christina.l.hedges@nasa.gov>
Date:   Wed Sep 6 09:43:50 2023 -0400

    fix log

commit 8b24061
Author: Nschanche <nicole.e.schanche@nasa.gov>
Date:   Tue Sep 5 17:45:42 2023 -0400

    Updated filename check to fix issue lightkurve#1358 (lightkurve#1364)

commit 5a1d1d1
Author: Christina Hedges <14965634+christinahedges@users.noreply.github.com>
Date:   Tue Sep 5 17:45:01 2023 -0400

    Jupyterhub support (lightkurve#1363)

    * Modify show/interact functions to automatically supply a callable
    for the notebook_url parameter to adapt to operating behind the a
    JupyterHub proxy with randomly generated ports for the Bokeh server.
    ---------

    Co-authored-by: jaytmiller <jmiller@stsci.edu>

commit 6176eb0
Author: Christina Hedges <christina.l.hedges@nasa.gov>
Date:   Tue Sep 5 15:17:26 2023 -0400

    fix numpy bug in search

commit 7d485b6
Author: Zé Vinícius <jvmirca@gmail.com>
Date:   Wed Aug 23 04:42:53 2023 +0800

    Raise a RuntimeError in case arclength cant be computed (lightkurve#1331)

    * check if arclength can be computed, else raise an error

    * handle both quantity and numpy arrays

    ---------

    Co-authored-by: Christina Hedges <christina.l.hedges@nasa.gov>

commit e751c16
Author: Christina Hedges <14965634+christinahedges@users.noreply.github.com>
Date:   Tue Aug 22 16:42:35 2023 -0400

    fixing CDIPs stitching bug (lightkurve#1361)

commit 394246f
Author: Zé Vinícius <jvmirca@gmail.com>
Date:   Wed Aug 23 03:41:00 2023 +0800

    Expose n_iters to the pca method in DesignMatrix (lightkurve#1334)

    * expose n_iters from fbpca so that users can control accuracy of optimality

    * Update src/lightkurve/correctors/designmatrix.py

    Co-authored-by: Dan Foreman-Mackey <dfm@dfm.io>

    * updated changelog

    ---------

    Co-authored-by: Dan Foreman-Mackey <dfm@dfm.io>
    Co-authored-by: Christina Hedges <christina.l.hedges@nasa.gov>

commit edcdd65
Author: Daniel <38233719+danhey@users.noreply.github.com>
Date:   Tue Aug 22 21:13:39 2023 +0200

    fix outlier removal bug (lightkurve#1313)

    * fix outlier removal bug

    * update test

    * add nan to test

    * update comment

    ---------

    Co-authored-by: Christina Hedges <14965634+christinahedges@users.noreply.github.com>

commit 8962d85
Author: Christina Hedges <14965634+christinahedges@users.noreply.github.com>
Date:   Tue Aug 22 15:12:38 2023 -0400

    Updated lightkurve aperture functions to be compliant with numpy 1.25.0 (lightkurve#1360)

    * updated aperture function

    * fixing @Nschanche comments [skip ci]

    * update changelog [skip ci]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Attempts to download from lightkurve results in a KeyError: 'dataURL'
4 participants