Skip to content

Commit

Permalink
Bug and compatibility fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
hpparvi committed Aug 5, 2016
1 parent 69fbfc1 commit 33c6b27
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 14 deletions.
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
long_description = ''

setup(name='LDTk',
version='1.0-beta',
version='1.0-beta.1',
description='Toolkit to calculate stellar limb darkening profiles for arbitrary filters.',
long_description=long_description,
author='Hannu Parviainen',
author_email='[email protected]',
url='https://github.com/hpparvi/ldtk',
package_dir={'ldtk':'src'},
packages=['ldtk'],
install_requires=["numpy","scipy","astropy"],
install_requires=["numpy","scipy>=0.16","astropy","tqdm","traitlets"],
license='GPLv2',
classifiers=[
"Topic :: Scientific/Engineering",
Expand All @@ -22,6 +22,7 @@
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
"Operating System :: OS Independent",
"Programming Language :: Python"
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3"
]
)
5 changes: 3 additions & 2 deletions src/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from ldtk.ldtk import LDPSetCreator, LDPSet
from ldtk.filters import BoxcarFilter, TabulatedFilter
from .ldmodel import *
from .ldtk import LDPSetCreator, LDPSet
from .filters import BoxcarFilter, TabulatedFilter

__all__ = ['LDPSetCreator','LDPSet','BoxcarFilter','TabulatedFilter']
4 changes: 2 additions & 2 deletions src/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from ftplib import FTP
from itertools import product
from tqdm import tqdm
from ldtk.core import *
from .core import *

class Client(object):
def __init__(self, limits=None, verbosity=1, update_server_file_list=False, cache=None):
Expand All @@ -36,7 +36,7 @@ def __init__(self, limits=None, verbosity=1, update_server_file_list=False, cach
os.mkdir(self._cache)

if exists(self._server_file_list) and not update_server_file_list:
with open(self._server_file_list, 'r') as fin:
with open(self._server_file_list, 'rb') as fin:
self.files_in_server = load(fin)
else:
self.files_in_server = self.get_server_file_list()
Expand Down
4 changes: 2 additions & 2 deletions src/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
import os
from os.path import join, exists
import warnings
import pyfits as pf
import astropy.io.fits as pf
from glob import glob
from os.path import exists, join, basename
from cPickle import dump, load
from pickle import dump, load
from numpy import (array, asarray, arange, linspace, zeros, zeros_like, ones, ones_like, delete,
diag, poly1d, polyfit, vstack, diff, cov, exp, log, sqrt, clip, pi, percentile)
from numpy.random import normal, uniform, multivariate_normal
Expand Down
File renamed without changes.
9 changes: 4 additions & 5 deletions src/ldtk.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""

import pyfits as pf
from functools import partial
from scipy.interpolate import LinearNDInterpolator as NDI
from scipy.interpolate import interp1d
from scipy.optimize import fmin

from ldtk.ld_models import LinearModel, QuadraticModel, NonlinearModel, GeneralModel, models
from ldtk.client import Client
from ldtk.core import *
from .ldmodel import LinearModel, QuadraticModel, NonlinearModel, GeneralModel, models
from .client import Client
from .core import *

def load_ldpset(filename):
with open(filename,'r') as fin:
Expand Down Expand Up @@ -54,7 +53,7 @@ def __init__(self, filters, mu, ldp_samples):

self._limb_i = abs(diff(self._mean_orig.mean(0))).argmax()
self._limb_z = self._z_orig[self._limb_i]
self._limb_mu = sqrt(1.-self._z_orig[i]**2)
self._limb_mu = sqrt(1.-self._z_orig[self._limb_i]**2)
self.redefine_limb()

self._lnl = zeros(self._nfilters)
Expand Down

0 comments on commit 33c6b27

Please sign in to comment.