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

Source.py::tesscut_dir() needs to test for the need to os.mkdir $HOMEDIR/.eleanor #125

Closed
texadactyl opened this issue Sep 18, 2019 · 3 comments

Comments

@texadactyl
Copy link

Running the quickstart sample .....

import eleanor
import numpy as np
import matplotlib.pyplot as plt

star = eleanor.Source(tic=38846515, sector=1, tc=True)

gets the following error:

source.py:396: UserWarning: Warning: unable to create .. Downloading TessCut to the current working directory instead.
  'working directory instead.'.format(download_dir))

In Source.py::tesscut_dir() the download directory is implicitly created as follows at line 396:

download_dir = os.path.join(os.path.expanduser('~'), '.eleanor/tesscut')

If directory $HOMEDIR/.eleanor does not yet exist, it must be created (os.mkdir) before executing that statement. Otherwise, the downloaded file winds up in the current directory (not desirable).

Running on Xubuntu 18.04.3.latest with Python 3.latest.

@texadactyl
Copy link
Author

Something simple like this would work:

from os.path import expanduser
DIR = expanduser("~/.eleanor")
if not os.path.exists(DIR):
    try:
        os.mkdir(DATA_DIR)
    except Exception as err:
        oops("main: Cannot create directory {}:\n{}".format(DIR, str(err)))

@texadactyl
Copy link
Author

texadactyl commented Sep 18, 2019

For whatever it is worth, I just ran into a surprising tensorflow 1.14.0 fatal anomaly (not an eleanor issue). See tensorflow/tensorflow#17411 for description and work-around.

A one-line program produces it:

import tensorflow as tf

like in targetdata.py::psf_lightcurve()

@benmontet
Copy link
Collaborator

This should be sorted in the most recent version 1.0.0, thanks for pointing it out!

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

No branches or pull requests

2 participants