question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot write to unmasked output

See original GitHub issue

Problem description

When trying to flatten a lightcurve I have just downloaded, I get

TypeError: cannot write to unmasked output

I have tried passing the argument mask=np.zeros([len(lc.time)], dtype=bool) to see if it would do anything but the same happens.

Example

import lightkurve as lk
import matplotlib.pyplot as plt
import numpy as np

search_results = lk.search_lightcurve("HD 39091", mission="TESS", exptime="short", sector=39)

lc = search_results.download()

lc_f = lc.flatten(window_length=901))

Expected behavior

Get a flattened lightcurve.

Environment

  • platform (e.g. Linux, OSX, Windows): Linux, Ubuntu 21.04
  • lightkurve version (e.g. 1.0b6): 2.0.11
  • installation method (e.g. pip, conda, source): pip

EDIT: Even more weird is that this issue happens only on one computer but not on a different one. I’ve tried uninstalling lightkurve and reinstalling and the same happens.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
barentsencommented, Mar 29, 2022

Likewise, I am also able to run the CBVCorrector example posted by @astrobel above with Lightkurve v2.1.1. (This is of course consistent with @astrobel’s own findings.)

I am going to close this issue because it looks like the issues reported here have been resolved in Lightkurve v2.1.1. I do encourage anyone who encounters these errors with v2.1.1 or later to comment below or open a new issue.

As a reminder, you can upgrade Lightkurve using:

python -m pip install --upgrade lightkurve

And you can check the version number as follows:

import lightkurve
print(lightkurve.__version__)
1reaction
astrobelcommented, Mar 28, 2022

Update!! Fixed this by running an update: it works just fine with astropy-5.0.3 and lightkurve-2.1.1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Source code for astropy.utils.masked.core
The result will be a a subclass of the type of ``data``. mask ... d is not None: raise TypeError("cannot write to unmasked...
Read more >
All masked columns are incompatible with writing to votable ...
Here's what I found after a little investigation: Given that masked values are changed to some null value when they are output to...
Read more >
Why masked arrays seems to be smaller compared to ...
What I am trying to understand if the masked array consume a lot more memory compared to the unmasked array. – G M....
Read more >
Unmasking a service doesn't work if it masked using MCO
Cause: systemd units are only cleaned up when completely removed Consequence: systemd units cannot be unmasked, because masks are not removed unless the ......
Read more >
systemd: How to unmask a service whose unit file is empty?
A service unit that is empty (0 bytes) will be parsed by systemd as masked. While systemctl mask <unit> works by symlinking the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found