Git Product home page Git Product logo

vespa's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vespa's Issues

Add some subtlety to Planet model

Per the suggestion of @jdeast, look into providing a joint constraint on stellar density/planet properties to vespa, such that the stellar density becomes a constraint in the stellar model fit, and the planet scenario gets simulated according to the posterior samples of that fit.

ContrastCurveFromFile file load error

When trying to plot a contrast curve:

from vespa.stars.contrastcurve import ContrastCurveFromFile
cc = ContrastCurveFromFile("Data/keck_k.cc", 'k')
cc.plot()

where my columns in the keck_k.cc file are separated by commas, I get the following error:

ValueError: could not convert string to float: '0.00,'

Adding a POSS contraint

I am trying to add a POSS constraint (that there are no background stars to 5 mag within 10 arcsec of the target). I created a .cc file:

0 5
10 5

I have successfully loaded my FFP:

from vespa import FPPCalculation
f = FPPCalculation.load('Example')
f.FPP()

but when I try to load the contrast 'curve':

from vespa.stars.contrastcurve import ContrastCurveFromFile
cc = ContrastCurveFromFile('Data/POSS_sample.cc', 'k') # include waveband of constraint

I get the following error:

---------------------------------------------------------------------------
error                                     Traceback (most recent call last)
<ipython-input-29-1f927e906ba6> in <module>()
      1 from vespa.stars.contrastcurve import ContrastCurveFromFile
----> 2 cc = ContrastCurveFromFile('Data/POSS_sample.cc', 'k') # include waveband of constraint
      3 bebs = f['beb']
      4 bebs.apply_cc(cc)

~/anaconda2/envs/vespa/lib/python3.6/site-packages/vespa/stars/contrastcurve.py in __init__(self, filename, band, mag, mas, **kwargs)
    142         if mas: #convert from milliarcsec
    143             rs /= 1000.
--> 144         ContrastCurve.__init__(self,rs,dmags,band,mag, **kwargs)
    145         self.filename = filename
    146 

~/anaconda2/envs/vespa/lib/python3.6/site-packages/vespa/stars/contrastcurve.py in __init__(self, rs, dmags, band, mag, name)
     56         self.band = band
     57         self.mag = mag
---> 58         self.contrastfn = interpolate(rs,dmags,s=0)
     59         self.rmax = rs.max()
     60         self.rmin = rs.min()

~/anaconda2/envs/vespa/lib/python3.6/site-packages/scipy/interpolate/fitpack2.py in __init__(self, x, y, w, bbox, k, s, ext, check_finite)
    183 
    184         data = dfitpack.fpcurf0(x,y,k,w=w,
--> 185                                 xb=bbox[0],xe=bbox[1],s=s)
    186         if data[-1] == 1:
    187             # nest too small, setting to maximum bound

error: (m>k) failed for hidden m: fpcurf0:m=2

KeyError: 'No object named /obs/df in the file'

I have a folder that contains three files: "star.ini", "fpp.ini" and the phase-folded light curve. I then run

heller$ starfit --all .

and MultiNest (v3.10) seems to be running just fine:

====>
Sampling finished. Exiting MultiNest
(...)
triple starfit successful for . in 7.1 minutes.
<====

Then I run

heller$ calcfpp

which ends with a RuntimeError:

====>
/usr/local/lib/python3.7/site-packages/numpy/lib/npyio.py:2242: VisibleDeprecationWarning: Reading unicode strings without specifying the encoding argument is deprecated. Set the encoding, use None for the system default.
output = genfromtxt(fname, **kwargs)
WARNING:root:sklearn not available
WARNING:root:progressbar not imported
WARNING:root:Cadence not provided in fpp.ini; defaulting to Kepler cadence.
Cadence not provided in fpp.ini; defaulting to Kepler cadence.
WARNING:root:If this is not a Kepler target, please set cadence (in days).
If this is not a Kepler target, please set cadence (in days).
WARNING:root:Transit band not provided in fpp.ini; defaulting to "Kepler."
Transit band not provided in fpp.ini; defaulting to "Kepler."
WARNING:root:If this is not a Kepler target, please specify filter.
If this is not a Kepler target, please specify filter.
'No object named /obs/df in the file'
ERROR:root:FPP calculation failed for ..
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/vespa/fpp.py", line 236, in from_ini
single_starmodel = StarModel.load_hdf(single_starmodel_file)
File "/usr/local/lib/python3.7/site-packages/isochrones/starmodel.py", line 1256, in load_hdf
obs = ObservationTree.load_hdf(filename, path+'/obs', ic=ic)
File "/usr/local/lib/python3.7/site-packages/isochrones/observation.py", line 869, in load_hdf
samples = store[path+'/df']
File "/usr/local/lib/python3.7/site-packages/pandas/io/pytables.py", line 504, in getitem
return self.get(key)
File "/usr/local/lib/python3.7/site-packages/pandas/io/pytables.py", line 694, in get
raise KeyError('No object named {key} in the file'.format(key=key))
KeyError: 'No object named /obs/df in the file'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/calcfpp", line 151, in
n=args.n)
File "/usr/local/lib/python3.7/site-packages/vespa/fpp.py", line 242, in from_ini
'Please run starfit --all {}.'.format(folder))
RuntimeError: Cannot load StarModels. Please run starfit --all ..
FPP calculation failed for ..
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/vespa/fpp.py", line 236, in from_ini
single_starmodel = StarModel.load_hdf(single_starmodel_file)
File "/usr/local/lib/python3.7/site-packages/isochrones/starmodel.py", line 1256, in load_hdf
obs = ObservationTree.load_hdf(filename, path+'/obs', ic=ic)
File "/usr/local/lib/python3.7/site-packages/isochrones/observation.py", line 869, in load_hdf
samples = store[path+'/df']
File "/usr/local/lib/python3.7/site-packages/pandas/io/pytables.py", line 504, in getitem
return self.get(key)
File "/usr/local/lib/python3.7/site-packages/pandas/io/pytables.py", line 694, in get
raise KeyError('No object named {key} in the file'.format(key=key))
KeyError: 'No object named /obs/df in the file'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/calcfpp", line 151, in
n=args.n)
File "/usr/local/lib/python3.7/site-packages/vespa/fpp.py", line 242, in from_ini
'Please run starfit --all {}.'.format(folder))
RuntimeError: Cannot load StarModels. Please run starfit --all ..
<====

So now I'm supposed to tun starfit --all . again although I've just done that before. Anyways, if I do that

heller$ starfit --all .

now gives an error message

====>
1 of 1: .
Fitting .
single starfit...
mist_starmodel_single.h5 exists. Use -o to overwrite.
single starfit successful for . in 0.4 minutes.
binary starfit...
mist_starmodel_binary.h5 exists. Use -o to overwrite.
binary starfit calculation failed for ..
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/isochrones/starfit.py", line 127, in starfit
fig1,fig2 = mod.corner_plots(corner_base)
File "/usr/local/lib/python3.7/site-packages/isochrones/starmodel.py", line 1070, in corner_plots
fig1, fig2 = self.corner_physical(**kwargs), self.corner_observed(**kwargs)
File "/usr/local/lib/python3.7/site-packages/isochrones/starmodel.py", line 1696, in corner_physical
return self.corner_derived(self.physical_quantities)
File "/usr/local/lib/python3.7/site-packages/isochrones/starmodel.py", line 1691, in corner_derived
fig = corner.corner(self.derived_samples[cols], labels=cols, **kwargs)
File "/usr/local/lib/python3.7/site-packages/pandas/core/frame.py", line 2934, in getitem
raise_missing=True)
File "/usr/local/lib/python3.7/site-packages/pandas/core/indexing.py", line 1354, in _convert_to_indexer
return self._get_listlike_indexer(obj, axis, **kwargs)[1]
File "/usr/local/lib/python3.7/site-packages/pandas/core/indexing.py", line 1161, in _get_listlike_indexer
raise_missing=raise_missing)
File "/usr/local/lib/python3.7/site-packages/pandas/core/indexing.py", line 1252, in _validate_read_indexer
raise KeyError("{} not in index".format(not_found))
KeyError: "['Teff', 'mass', 'radius', 'logg'] not in index"
triple starfit...
mist_starmodel_triple.h5 exists. Use -o to overwrite.
triple starfit calculation failed for ..
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/isochrones/starfit.py", line 127, in starfit
fig1,fig2 = mod.corner_plots(corner_base)
File "/usr/local/lib/python3.7/site-packages/isochrones/starmodel.py", line 1070, in corner_plots
fig1, fig2 = self.corner_physical(**kwargs), self.corner_observed(**kwargs)
File "/usr/local/lib/python3.7/site-packages/isochrones/starmodel.py", line 1696, in corner_physical
return self.corner_derived(self.physical_quantities)
File "/usr/local/lib/python3.7/site-packages/isochrones/starmodel.py", line 1691, in corner_derived
fig = corner.corner(self.derived_samples[cols], labels=cols, **kwargs)
File "/usr/local/lib/python3.7/site-packages/pandas/core/frame.py", line 2934, in getitem
raise_missing=True)
File "/usr/local/lib/python3.7/site-packages/pandas/core/indexing.py", line 1354, in _convert_to_indexer
return self._get_listlike_indexer(obj, axis, **kwargs)[1]
File "/usr/local/lib/python3.7/site-packages/pandas/core/indexing.py", line 1161, in _get_listlike_indexer
raise_missing=raise_missing)
File "/usr/local/lib/python3.7/site-packages/pandas/core/indexing.py", line 1252, in _validate_read_indexer
raise KeyError("{} not in index".format(not_found))
KeyError: "['Teff', 'mass', 'radius', 'logg'] not in index"
<===

I know that the problem can't be in the files that I'm providing because I've successfully run vespa on them on another machine.

Any help would be appreciated.

calcfpp gives RuntimeError: Cannot load StarModels. please run 'starfit --all'

Hi Tim, I'm having this issue with VESPA while trying to run the Kepler-22 example. If I run calcfpp I get the following error:

eesopee@eesopee-PC:~/Desktop/test$ calcfpp
/home/eesopee/anaconda3/lib/python3.7/site-packages/numpy/lib/npyio.py:2286: VisibleDeprecationWarning: Reading unicode strings without specifying the encoding argument is deprecated. Set the encoding, use None for the system default.
  output = genfromtxt(fname, **kwargs)
WARNING:root:sklearn not available
WARNING:root:Cadence not provided in fpp.ini; defaulting to Kepler cadence.
Cadence not provided in fpp.ini; defaulting to Kepler cadence.
WARNING:root:If this is not a Kepler target, please set cadence (in days).
If this is not a Kepler target, please set cadence (in days).
'No object named /obs/df in the file'
ERROR:root:FPP calculation failed for ..
Traceback (most recent call last):
  File "/home/eesopee/anaconda3/lib/python3.7/site-packages/VESPA-0.5.1-py3.7-linux-x86_64.egg/vespa/fpp.py", line 229, in from_ini
    single_starmodel = StarModel.load_hdf(single_starmodel_file)
  File "/home/eesopee/anaconda3/lib/python3.7/site-packages/isochrones/starmodel.py", line 1151, in load_hdf
    obs = ObservationTree.load_hdf(filename, path+'/obs', ic=ic)
  File "/home/eesopee/anaconda3/lib/python3.7/site-packages/isochrones/observation.py", line 869, in load_hdf
    samples = store[path+'/df']
  File "/home/eesopee/anaconda3/lib/python3.7/site-packages/pandas/io/pytables.py", line 504, in __getitem__
    return self.get(key)
  File "/home/eesopee/anaconda3/lib/python3.7/site-packages/pandas/io/pytables.py", line 694, in get
    raise KeyError('No object named {key} in the file'.format(key=key))
KeyError: 'No object named /obs/df in the file'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/eesopee/anaconda3/lib/python3.7/site-packages/VESPA-0.5.1-py3.7-linux-x86_64.egg/EGG-INFO/scripts/calcfpp", line 151, in <module>
    n=args.n)
  File "/home/eesopee/anaconda3/lib/python3.7/site-packages/VESPA-0.5.1-py3.7-linux-x86_64.egg/vespa/fpp.py", line 235, in from_ini
    'Please run `starfit --all {}`.'.format(folder))
RuntimeError: Cannot load StarModels.  Please run `starfit --all .`.
FPP calculation failed for ..
Traceback (most recent call last):
  File "/home/eesopee/anaconda3/lib/python3.7/site-packages/VESPA-0.5.1-py3.7-linux-x86_64.egg/vespa/fpp.py", line 229, in from_ini
    single_starmodel = StarModel.load_hdf(single_starmodel_file)
  File "/home/eesopee/anaconda3/lib/python3.7/site-packages/isochrones/starmodel.py", line 1151, in load_hdf
    obs = ObservationTree.load_hdf(filename, path+'/obs', ic=ic)
  File "/home/eesopee/anaconda3/lib/python3.7/site-packages/isochrones/observation.py", line 869, in load_hdf
    samples = store[path+'/df']
  File "/home/eesopee/anaconda3/lib/python3.7/site-packages/pandas/io/pytables.py", line 504, in __getitem__
    return self.get(key)
  File "/home/eesopee/anaconda3/lib/python3.7/site-packages/pandas/io/pytables.py", line 694, in get
    raise KeyError('No object named {key} in the file'.format(key=key))
KeyError: 'No object named /obs/df in the file'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/eesopee/anaconda3/lib/python3.7/site-packages/VESPA-0.5.1-py3.7-linux-x86_64.egg/EGG-INFO/scripts/calcfpp", line 151, in <module>
    n=args.n)
  File "/home/eesopee/anaconda3/lib/python3.7/site-packages/VESPA-0.5.1-py3.7-linux-x86_64.egg/vespa/fpp.py", line 235, in from_ini
    'Please run `starfit --all {}`.'.format(folder))
RuntimeError: Cannot load StarModels.  Please run `starfit --all .`.

It says to run starfit --all but I've already done that, and the calculation looked succesful.

Any ideas about how to fix this? Thanks in advance!

VESPA ImportError

I am a graduate student attempting to run VESPA for a project. Apologies for the possibly trivial question, but no one in my department knows anything about this code. Any help would be appreciated. When I try to run the exact example provided for epic201352100b I receive the following error:

/usr/local/Anaconda3/lib/python3.6/site-packages/numpy/lib/npyio.py:2242: VisibleDeprecationWarning: Reading unicode strings without specifying the encoding argument is deprecated. Set the encoding, use None for the system default.
output = genfromtxt(fname, **kwargs)
/usr/local/Anaconda3/lib/python3.6/site-packages/sklearn/cross_validation.py:41: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. Also note that the interface of the new CV iterators are different from that of this module. This module will be removed in 0.20.
"This module will be removed in 0.20.", DeprecationWarning)
/usr/local/Anaconda3/lib/python3.6/site-packages/sklearn/grid_search.py:42: DeprecationWarning: This module was deprecated in version 0.18 in favor of the model_selection module into which all the refactored classes and functions are moved. This module will be removed in 0.20.
DeprecationWarning)
WARNING:root:progressbar not imported
Traceback (most recent call last):
File "/d/users/ashley/.local/bin/calcfpp", line 66, in
from vespa import FPPCalculation
File "/d/users/ashley/.local/lib/python3.6/site-packages/vespa/init.py", line 40, in
from .transitsignal import TransitSignal
File "/d/users/ashley/.local/lib/python3.6/site-packages/vespa/transitsignal.py", line 16, in
from emcee.autocorr import integrated_time, AutocorrError
ImportError: cannot import name 'AutocorrError'

How to use apply_trend_constraints in calcfpp

Hello Sir,

I have successfully installed vespa.It is working fine.So further I want to use the module apply_trend_constraints in FPP calculations(using calcfpp). How can i use that?

I have numbers for dRV(limit RV) and dt.
I tried to call the function as you have done for other modules like apply_cc.
but that is not working(May be dRV and Plong attributes were not defined for population).

help me!!!
Thanks in Advance,
Rishi

Update tests & isochrones compatibility

Using this space to take some quick notes and to-dos to guide development that needs to happen to bring vespa up to date with current version(s) of isochrones.

Notes on active branches:

  • cadence: This branch was made in order to do analysis on some early TESS candidates, and seems to be the farthest along (has commits strictly ahead of master, which is good.
  • update-tests: this branch seems to be the last branch that had passing tests, but is a bit behind master.
  • dev-1.0: Has a fair amount of changes in there beginning to bring isochrones compatibility forward. While the goal for isochrones compatibility should be > 2.0, I see that this branch still just requires >1.0, but that's a start at least. Would be some work to merge with the current TESS-related development in cadence.

If I had time to work on this (which I don't), the order I'd do things is the following:

  • Check that update-tests really does have passing tests (travis, via github, seems to think so).
  • Merge update-tests and cadence into a new development branch that is strictly ahead of master, and has working/passing tests (with the old isochrones).
  • Merge the tests as they are from the new development branch into dev-1.0 as it is now, and then work towards making those tests pass with isochrones >= 2.0.
  • Think about how to best incorporate the "specific" models that would be based on known stars in aperture (some work on this is done already, with the is_specific flag in some of the population models.

YAML files from a working conda environment

EDIT: I now have working YAML files for both linux and macOS. They can be found here:

linux .yml file (tested on Ubuntu 20.04)

macOS .yml file (tested on MacOS Big Sur)

You will also need to update a couple of scripts, which are using deprecated astropy keywords. You can use this script to do that... just call it within the environment where you're using VESPA.

Shameless plug -- My code MoonPy handles all this under the hood during installation, and also streamlines the process of making fpp.ini, star.ini, and photfile.csv files. Check it out!

ORIGINAL POST:

Hi Tim,

I'm interested in using VESPA, but like others here I've been having dependency conflicts while trying to install / run it. I know you don't have to time to work on this anymore to resolve these conflicts, but my question is: might it be possible to create a YAML file from a conda environment where vespa is running without issue?

I may be wrong(!) but I thought it might work to run vespa in an a custom environment using older, known-compatible packages. I think all it would require is a creating YAML file built from a compatible environment, like so:

conda env export --name ENVNAME > envname.yml

Then anyone can build a compatible environment from this file.

If anyone is reading this and has a running version of vespa, I would appreciate the attempt! Thanks.

All simulated systems within Roche lobe

Probably needs some more robust error checking?

2019-02-15 17:42:15,270: Error generating HEB population.
2019-02-15 17:42:15,270: FPP calculation failed for ..
Traceback (most recent call last):
  File "//anaconda/envs/vespa3/bin/calcfpp", line 151, in <module>
    n=args.n)
  File "//anaconda/envs/vespa3/lib/python3.6/site-packages/vespa/fpp.py", line 269, in from_ini
    savefile=popset_file, **kwargs)
  File "//anaconda/envs/vespa3/lib/python3.6/site-packages/vespa/populations.py", line 2014, in __init__
    do_only=do_only)
  File "//anaconda/envs/vespa3/lib/python3.6/site-packages/vespa/populations.py", line 2058, in generate
    MAfn=MAfn, n=n, **heb_kws)
  File "//anaconda/envs/vespa3/lib/python3.6/site-packages/vespa/populations.py", line 1515, in __init__
    **kwargs)
  File "//anaconda/envs/vespa3/lib/python3.6/site-packages/vespa/populations.py", line 1576, in generate
    MAfn=MAfn)
  File "//anaconda/envs/vespa3/lib/python3.6/site-packages/vespa/populations.py", line 2696, in calculate_eclipses
    mininc = minimum_inclination(Ps, M1s, M2s, R1s, R2s)
  File "//anaconda/envs/vespa3/lib/python3.6/site-packages/vespa/transit_basic.py", line 324, in minimum_inclination
    raise AllWithinRocheError('All simulated systems within Roche lobe')
vespa.transit_basic.AllWithinRocheError: All simulated systems within Roche lobe

nedsearch file missing

tmpfile = '/tmp/nedsearch%s%s.html' % (ra,dec)

After installing vespa, I run calcfpp as follows

$ calcfpp
WARNING:root:PyMultiNest not imported.  MultiNest fits will not work.
WARNING:root:sklearn not available
WARNING:root:progressbar not imported
WARNING:root:Cadence not provided in fpp.ini; defaulting to Kepler cadence.
Cadence not provided in fpp.ini; defaulting to Kepler cadence.
WARNING:root:If this is not a Kepler target, please set cadence (in days).
If this is not a Kepler target, please set cadence (in days).
INFO:root:Fitting transitsignal with MCMC...
Fitting transitsignal with MCMC...
INFO:root:Fitting data to trapezoid shape with MCMC for 211314705....
Fitting data to trapezoid shape with MCMC for 211314705....
INFO:root:Generating ['beb', 'heb', 'eb', 'beb_Px2', 'heb_Px2', 'eb_Px2', 'pl'] models for PopulationSet...
Generating ['beb', 'heb', 'eb', 'beb_Px2', 'heb_Px2', 'eb_Px2', 'pl'] models for PopulationSet...
INFO:root:15471 eclipsing HEB systems generated (target 20000)
15471 eclipsing HEB systems generated (target 20000)
INFO:root:20982 eclipsing HEB systems generated (target 20000)
20982 eclipsing HEB systems generated (target 20000)
INFO:root:Fitting trapezoid models for HEBs...
Fitting trapezoid models for HEBs...
INFO:root:Done.
Done.
INFO:root:17277 eclipsing HEB systems generated (target 20000)
17277 eclipsing HEB systems generated (target 20000)
INFO:root:20741 eclipsing HEB systems generated (target 20000)
20741 eclipsing HEB systems generated (target 20000)
INFO:root:Fitting trapezoid models for HEBs (Double Period)...
Fitting trapezoid models for HEBs (Double Period)...
ERROR:root:No eclipse registered for star 12220
No eclipse registered for star 12220
INFO:root:Done.
Done.
INFO:root:14970 Eclipsing EB systems generated (target 20000)
14970 Eclipsing EB systems generated (target 20000)
INFO:root:20940 Eclipsing EB systems generated (target 20000)
20940 Eclipsing EB systems generated (target 20000)
INFO:root:Fitting trapezoid models for EBs...
Fitting trapezoid models for EBs...
INFO:root:Done.
Done.
INFO:root:16754 Eclipsing EB systems generated (target 20000)
16754 Eclipsing EB systems generated (target 20000)
INFO:root:20653 Eclipsing EB systems generated (target 20000)
20653 Eclipsing EB systems generated (target 20000)
INFO:root:Fitting trapezoid models for EBs (Double Period)...
Fitting trapezoid models for EBs (Double Period)...
ERROR:root:No eclipse registered for star 1839
No eclipse registered for star 1839
ERROR:root:No eclipse registered for star 2875
No eclipse registered for star 2875
INFO:root:Done.
Done.
INFO:root:Getting TRILEGAL simulation at 129.129927, 10.147280...
Getting TRILEGAL simulation at 129.129927, 10.147280...
/bin/sh: 1: curl: not found
ERROR:root:Error generating BEB population.
Error generating BEB population.
ERROR:root:FPP calculation failed for ..
Traceback (most recent call last):
  File "/home/prometheus/miniconda3/envs/vespa/lib/python3.5/site-packages/VESPA-0.5.1-py3.5-linux-x86_64.egg/EGG-INFO/scripts/calcfpp", line 151, in <module>
    n=args.n)
  File "/home/prometheus/miniconda3/envs/vespa/lib/python3.5/site-packages/VESPA-0.5.1-py3.5-linux-x86_64.egg/vespa/fpp.py", line 288, in from_ini
    savefile=popset_file, **kwargs)
  File "/home/prometheus/miniconda3/envs/vespa/lib/python3.5/site-packages/VESPA-0.5.1-py3.5-linux-x86_64.egg/vespa/populations.py", line 2036, in __init__
    do_only=do_only)
  File "/home/prometheus/miniconda3/envs/vespa/lib/python3.5/site-packages/VESPA-0.5.1-py3.5-linux-x86_64.egg/vespa/populations.py", line 2151, in generate
    mags=mags, MAfn=MAfn, n=n, **beb_kws)
  File "/home/prometheus/miniconda3/envs/vespa/lib/python3.5/site-packages/VESPA-0.5.1-py3.5-linux-x86_64.egg/vespa/populations.py", line 1753, in __init__
    maxrad=maxrad, f_binary=f_binary, **kwargs)
  File "/home/prometheus/miniconda3/envs/vespa/lib/python3.5/site-packages/VESPA-0.5.1-py3.5-linux-x86_64.egg/vespa/populations.py", line 1782, in generate
    maxrad=maxrad, **kwargs)
  File "/home/prometheus/miniconda3/envs/vespa/lib/python3.5/site-packages/VESPA-0.5.1-py3.5-linux-x86_64.egg/vespa/stars/populations.py", line 2193, in __init__
    get_trilegal(basefilename,ra,dec,**kwargs)
  File "/home/prometheus/miniconda3/envs/vespa/lib/python3.5/site-packages/VESPA-0.5.1-py3.5-linux-x86_64.egg/vespa/stars/trilegal.py", line 92, in get_trilegal
    AV = get_AV_infinity(l,b,frame='galactic')
  File "/home/prometheus/miniconda3/envs/vespa/lib/python3.5/site-packages/VESPA-0.5.1-py3.5-linux-x86_64.egg/vespa/stars/extinction.py", line 45, in get_AV_infinity
    with open(tmpfile, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/nedsearch215.647582078959927.910368050815226.html'
FPP calculation failed for ..
Traceback (most recent call last):
  File "/home/prometheus/miniconda3/envs/vespa/lib/python3.5/site-packages/VESPA-0.5.1-py3.5-linux-x86_64.egg/EGG-INFO/scripts/calcfpp", line 151, in <module>
    n=args.n)
  File "/home/prometheus/miniconda3/envs/vespa/lib/python3.5/site-packages/VESPA-0.5.1-py3.5-linux-x86_64.egg/vespa/fpp.py", line 288, in from_ini
    savefile=popset_file, **kwargs)
  File "/home/prometheus/miniconda3/envs/vespa/lib/python3.5/site-packages/VESPA-0.5.1-py3.5-linux-x86_64.egg/vespa/populations.py", line 2036, in __init__
    do_only=do_only)
  File "/home/prometheus/miniconda3/envs/vespa/lib/python3.5/site-packages/VESPA-0.5.1-py3.5-linux-x86_64.egg/vespa/populations.py", line 2151, in generate
    mags=mags, MAfn=MAfn, n=n, **beb_kws)
  File "/home/prometheus/miniconda3/envs/vespa/lib/python3.5/site-packages/VESPA-0.5.1-py3.5-linux-x86_64.egg/vespa/populations.py", line 1753, in __init__
    maxrad=maxrad, f_binary=f_binary, **kwargs)
  File "/home/prometheus/miniconda3/envs/vespa/lib/python3.5/site-packages/VESPA-0.5.1-py3.5-linux-x86_64.egg/vespa/populations.py", line 1782, in generate
    maxrad=maxrad, **kwargs)
  File "/home/prometheus/miniconda3/envs/vespa/lib/python3.5/site-packages/VESPA-0.5.1-py3.5-linux-x86_64.egg/vespa/stars/populations.py", line 2193, in __init__
    get_trilegal(basefilename,ra,dec,**kwargs)
  File "/home/prometheus/miniconda3/envs/vespa/lib/python3.5/site-packages/VESPA-0.5.1-py3.5-linux-x86_64.egg/vespa/stars/trilegal.py", line 92, in get_trilegal
    AV = get_AV_infinity(l,b,frame='galactic')
  File "/home/prometheus/miniconda3/envs/vespa/lib/python3.5/site-packages/VESPA-0.5.1-py3.5-linux-x86_64.egg/vespa/stars/extinction.py", line 45, in get_AV_infinity
    with open(tmpfile, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/nedsearch215.647582078959927.910368050815226.html'
$ conda list
# packages in environment at /home/prometheus/miniconda3/envs/vespa:
#
asn1crypto                0.24.0                    <pip>
astropy                   2.0.1               np113py35_0  
astroquery                0.3.9.dev0                <pip>
batman-package            2.4.6                     <pip>
beautifulsoup4            4.7.1                     <pip>
blas                      1.0                         mkl  
certifi                   2016.2.28                py35_0  
certifi                   2019.3.9                  <pip>
cffi                      1.12.2                    <pip>
chardet                   3.0.4                     <pip>
cryptography              2.6.1                     <pip>
cycler                    0.10.0                   py35_0  
cython                    0.26                     py35_0  
dbus                      1.10.20                       0  
emcee                     2.2.1                     <pip>
entrypoints               0.3                       <pip>
expat                     2.1.0                         0  
fontconfig                2.12.1                        3  
freetype                  2.5.5                         2  
glib                      2.50.2                        1  
gst-plugins-base          1.8.0                         0  
gstreamer                 1.8.0                         0  
html5lib                  1.0.1                     <pip>
icu                       54.1                          0  
idna                      2.8                       <pip>
isochrones                1.2.1                     <pip>
jeepney                   0.4                       <pip>
jpeg                      9b                            0  
keyring                   19.0.1                    <pip>
libffi                    3.2.1                         1  
libgcc                    5.2.0                         0  
libiconv                  1.14                          0  
libpng                    1.6.30                        1  
libxcb                    1.12                          1  
libxml2                   2.9.4                         0  
llvmlite                  0.28.0                    <pip>
matplotlib                2.0.2               np113py35_0  
mkl                       2017.0.3                      0  
mock                      2.0.0                     <pip>
numba                     0.43.1                    <pip>
numexpr                   2.6.9                     <pip>
numpy                     1.13.1                   py35_0  
openssl                   1.0.2l                        0  
pandas                    0.20.3                   py35_0  
pandas                    0.23.4                    <pip>
pandas                    0.24.2                    <pip>
pbr                       5.1.3                     <pip>
pcre                      8.39                          1  
pip                       19.0.3                    <pip>
pip                       9.0.1                    py35_1  
plotutils                 0.3.2                     <pip>
py                        1.4.34                   py35_0  
pycparser                 2.19                      <pip>
pyparsing                 2.2.0                    py35_0  
pyqt                      5.6.0                    py35_2  
pytest                    3.2.1                    py35_0  
python                    3.5.4                         0  
python-dateutil           2.6.1                    py35_0  
pytz                      2017.2                   py35_0  
qt                        5.6.2                         5  
readline                  6.2                           2  
requests                  2.21.0                    <pip>
scipy                     1.2.0rc2                  <pip>
SecretStorage             3.1.1                     <pip>
setuptools                36.4.0                   py35_1  
simpledist                0.1.13                    <pip>
sip                       4.18                     py35_0  
six                       1.10.0                   py35_0  
soupsieve                 1.9                       <pip>
sqlite                    3.13.0                        0  
tables                    3.5.1                     <pip>
tk                        8.5.18                        0  
urllib3                   1.24.1                    <pip>
VESPA                     0.5.1                     <pip>
webencodings              0.5.1                     <pip>
wheel                     0.29.0                   py35_0  
xz                        5.2.3                         0  
zlib                      1.2.11                        0

Cannot load previously created popset files

When trying to load a previously created popset file using Vespa version 0.5, it cannot open the file, and errors as follows:

from vespa import PopulationSet
popset = PopulationSet.load_hdf('/Users/jcbecker/Documents/GitHub/vespa-tutorial/Notebooks/TestCase3/popset.h5')

  File "<stdin>", line 1, in <module>
  File "/Users/jcbecker/anaconda2/envs/vespa/lib/python3.6/site-packages/vespa/populations.py", line 2227, in load_hdf
    poplist.append(t().load_hdf(filename, path='{}/{}'.format(path,m)))
  File "/Users/jcbecker/anaconda2/envs/vespa/lib/python3.6/site-packages/vespa/populations.py", line 941, in load_hdf
    new = StarPopulation.load_hdf(filename, path=path)
  File "/Users/jcbecker/anaconda2/envs/vespa/lib/python3.6/site-packages/vespa/stars/populations.py", line 1081, in load_hdf
    stars = pd.read_hdf(filename,path+'/stars')
  File "/Users/jcbecker/anaconda2/envs/vespa/lib/python3.6/site-packages/pandas/io/pytables.py", line 373, in read_hdf
    store = HDFStore(path_or_buf, mode=mode, **kwargs)
  File "/Users/jcbecker/anaconda2/envs/vespa/lib/python3.6/site-packages/pandas/io/pytables.py", line 491, in __init__
    self.open(mode=mode, **kwargs)
  File "/Users/jcbecker/anaconda2/envs/vespa/lib/python3.6/site-packages/pandas/io/pytables.py", line 629, in open
    raise e
  File "/Users/jcbecker/anaconda2/envs/vespa/lib/python3.6/site-packages/pandas/io/pytables.py", line 604, in open
    self._handle = tables.open_file(self._path, self._mode, **kwargs)
  File "/Users/jcbecker/anaconda2/envs/vespa/lib/python3.6/site-packages/tables/file.py", line 306, in open_file
    "not in read-only mode (as requested)." % filename)
ValueError: The file '/Users/jcbecker/Documents/GitHub/vespa-tutorial/Notebooks/TestCase3/popset.h5' is already opened, but not in read-only mode (as requested).```

Error generating BEB population

@timothydmorton, I was using VESPA through Virtual Machine. Hopefully, it can run the calcfpp command but not fully.

I ran that command, and the process started but in the end, I got this.

2022-04-06 06:43:28,594: Cadence not provided in fpp.ini; defaulting to Kepler cadence.
2022-04-06 06:43:28,595: If this is not a Kepler target, please set cadence (in days).
2022-04-06 06:43:28,595: Transit band not provided in fpp.ini; defaulting to "Kepler."
2022-04-06 06:43:28,596: If this is not a Kepler target, please specify filter.
2022-04-06 06:43:30,581: Fitting transitsignal with MCMC...
2022-04-06 06:43:30,582: Fitting data to trapezoid shape with MCMC for K00087.01....
2022-04-06 06:43:34,367: Generating ['beb', 'heb', 'eb', 'beb_Px2', 'heb_Px2', 'eb_Px2', 'pl'] models for PopulationSet...
2022-04-06 06:46:42,420: 887 eclipsing HEB systems generated (target 1000)
2022-04-06 06:46:45,016: 1026 eclipsing HEB systems generated (target 1000)
2022-04-06 06:46:47,653: Fitting trapezoid models for HEBs...
2022-04-06 06:46:57,950: Done.
2022-04-06 06:50:31,246: 835 eclipsing HEB systems generated (target 1000)
2022-04-06 06:50:35,843: 1034 eclipsing HEB systems generated (target 1000)
2022-04-06 06:50:36,433: Fitting trapezoid models for HEBs (Double Period)...
2022-04-06 06:50:41,332: Done.
2022-04-06 06:52:49,089: 961 Eclipsing EB systems generated (target 1000)
2022-04-06 06:52:51,033: 1056 Eclipsing EB systems generated (target 1000)
2022-04-06 06:52:51,315: Fitting trapezoid models for EBs...
2022-04-06 06:52:56,204: Done.
2022-04-06 06:55:09,754: 928 Eclipsing EB systems generated (target 1000)
2022-04-06 06:55:12,344: 1022 Eclipsing EB systems generated (target 1000)
2022-04-06 06:55:12,852: Fitting trapezoid models for EBs (Double Period)...
2022-04-06 06:55:17,936: Done.
2022-04-06 06:55:19,913: Getting TRILEGAL simulation at 289.217499, 47.88446...
2022-04-06 06:55:23,640: Error generating BEB population.
2022-04-06 06:55:23,886: FPP calculation failed for ..
Traceback (most recent call last):
  File "/home/vespa/anaconda3/envs/vespa-env/bin/calcfpp", line 151, in <module>
    n=args.n)
  File "/home/vespa/anaconda3/envs/vespa-env/lib/python3.6/site-packages/vespa/fpp.py", line 296, in from_ini
    savefile=popset_file, **kwargs)
  File "/home/vespa/anaconda3/envs/vespa-env/lib/python3.6/site-packages/vespa/populations.py", line 2067, in __init__
    do_only=do_only)
  File "/home/vespa/anaconda3/envs/vespa-env/lib/python3.6/site-packages/vespa/populations.py", line 2188, in generate
    mags=mags, MAfn=MAfn, n=n, **beb_kws)
  File "/home/vespa/anaconda3/envs/vespa-env/lib/python3.6/site-packages/vespa/populations.py", line 1782, in __init__
    maxrad=maxrad, f_binary=f_binary, **kwargs)
  File "/home/vespa/anaconda3/envs/vespa-env/lib/python3.6/site-packages/vespa/populations.py", line 1811, in generate
    maxrad=maxrad, **kwargs)
  File "/home/vespa/anaconda3/envs/vespa-env/lib/python3.6/site-packages/vespa/stars/populations.py", line 2193, in __init__
    get_trilegal(basefilename,ra,dec,**kwargs)
  File "/home/vespa/anaconda3/envs/vespa-env/lib/python3.6/site-packages/vespa/stars/trilegal.py", line 92, in get_trilegal
    AV = get_AV_infinity(l,b,frame='galactic')
  File "/home/vespa/anaconda3/envs/vespa-env/lib/python3.6/site-packages/vespa/stars/extinction.py", line 45, in get_AV_infinity
    with open(tmpfile, 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/nedsearch79.0919037124375715.792263326711016.html'

Are there any solutions?

Applying VESPA to TESS photometry

Hi Tim,

Over the past few days I've been wondering how hard could it be to tune VESPA so that one can readily apply it to TESS photometry.

A few things came up:
— A magnitude for the band in which the transit signal is observed must be passed as a constraint ('TESS' in such case).
— The call to TRILEGAL currently uses Phot.system='kepler_2mass'. Found out in the meantime that TRILEGAL now also provides TESS magnitudes (simply use 'TESS_2mass' or else 'TESS_2mass_kepler'). Checked this directly with Léo Girardi. Also, the perl script used in the call to TRILEGAL by default sets the simulation's limiting magnitude to correspond to the 1st mag in the list. This would now be 'TESS', so all good here.
— The cadence under vespa.populations.EclipsePopulation defaults to Kepler's long cadence (also occurs in other parts of the code). This could simply be tuned, say, if we were to use TESS's 2-min cadence.
— Also, vespa.transit_basic.ldcoeffs returns limb-darkening coefficients in the Kepler band. I've generated a new text file (keeping the assumed format) containing these coefficients in the TESS band. It is based on table 5 of Claret (2018), i.e., assuming solar metallicity, 2300<T_eff<12000 K, and 2.5<log(g)<6.0. Can make the file available if needed.

Could there be any other obvious aspects that I'm missing?

Cheers, Tiago

Error due to deprecated function input "skip_footer"

In trilegal.py, need to change the line:
df = pd.read_table(outfile, sep='\s+', skip_footer=1, engine='python')
to
df = pd.read_table(outfile, sep='\s+', skipfooter=1, engine='python')

(lose the underscore in skip_footer)

bootstrapping

Hi Tim,

While trying to perform a bootstrapping I get the following error:


FPP calculation failed for ..
Traceback (most recent call last):
File "/Applications/anaconda/envs/python2/bin/calcfpp", line 154, in
f.bootstrap_FPP(args.bootstrap)
File "/Applications/anaconda/envs/python2/lib/python2.7/site-packages/vespa/fpp.py", line 861, in bootstrap_FPP
new = FPPCalculation(self.trsig, self.popset.resample(), folder=self.folder)
File "/Applications/anaconda/envs/python2/lib/python2.7/site-packages/vespa/populations.py", line 2513, in resample
new_poplist = [pop.resample() for pop in new.poplist]
File "/Applications/anaconda/envs/python2/lib/python2.7/site-packages/vespa/populations.py", line 990, in resample
new._make_kde()
File "/Applications/anaconda/envs/python2/lib/python2.7/site-packages/vespa/populations.py", line 523, in _make_kde
logdeps = logdeps[ok]
File "/Applications/anaconda/envs/python2/lib/python2.7/site-packages/pandas/core/series.py", line 640, in getitem
key = check_bool_indexer(self.index, key)
File "/Applications/anaconda/envs/python2/lib/python2.7/site-packages/pandas/core/indexing.py", line 1936, in check_bool_indexer
result = result.reindex(ax)
File "/Applications/anaconda/envs/python2/lib/python2.7/site-packages/pandas/core/series.py", line 2426, in reindex
return super(Series, self).reindex(index=index, **kwargs)
File "/Applications/anaconda/envs/python2/lib/python2.7/site-packages/pandas/core/generic.py", line 2404, in reindex
fill_value, copy).finalize(self)
File "/Applications/anaconda/envs/python2/lib/python2.7/site-packages/pandas/core/generic.py", line 2422, in _reindex_axes
copy=copy, allow_dups=False)
File "/Applications/anaconda/envs/python2/lib/python2.7/site-packages/pandas/core/generic.py", line 2516, in _reindex_with_indexers
copy=copy)
File "/Applications/anaconda/envs/python2/lib/python2.7/site-packages/pandas/core/internals.py", line 3886, in reindex_indexer
self.axes[axis]._can_reindex(indexer)
File "/Applications/anaconda/envs/python2/lib/python2.7/site-packages/pandas/core/indexes/base.py", line 2787, in _can_reindex
raise ValueError("cannot reindex from a duplicate axis")
ValueError: cannot reindex from a duplicate axis


The problem seems to be related to the self.distok property, which in turn may be due to the constraints not being correctly resampled prior to calling _make_kde() inside resample(). You even left a note related to this in the header of the latter function. Any thoughts?

Cheers,
Tiago

New VESPA incompatible with new isochrones version

Hi Tim,

I was writing to let you know that due to the recent upgrade on the isochrones package, VESPA is not working properly due to various reasons. The main one is that the BinaryStarModel and TripleStarModel no longer work as expected by VESPA (because now, these have to be called directly with StarModel and setting N=2 and 3, respectively), but after doing some modifications to that, other parts of the code fail as well. I've been working on this, but don't want to push further if you are already working on this; I suppose you are planning an upgrade on VESPA in order for it to be compatible with the new isochrones version, right?

Best

Upload of a legacy working environment?

Hi Tim,

This purpose of this issue is to suggest the upload of a frozen anaconda environment.yml that has as many of VESPA's dependencies as possible included, to enable dependency resolution during installation.

This could help patch over issues such as #29 #32 #13 and similar, which seem to be based around versioning issues with pandas, isochrones, and perhaps VESPA itself.

It could be created (from a working conda environment) via something similar to
conda env export --no-builds > environment.yml, and people could then install the environment via conda env create -f environment.yml -n VESPA.

I understand that certain dependencies (MultiNest, pymultinest) won't work in this approach. But it seems that this might be a helpful stopgap for users (including yours truly and a few more experienced people I've asked) who are unable to resolve these dependency conflicts!

Thank you for considering!
Luke

Pandas 0.22.0 causes error

Using Pandas 0.22.0 causes the following error. Downgrading to Pandas 0.20.1 fixes the problem.

Traceback (most recent call last):
File "/home/avanderb/anaconda4/bin/calcfpp", line 141, in
n=args.n)
File "/home/avanderb/anaconda4/lib/python2.7/site-packages/vespa/fpp.py", line 351, in from_ini
savefile=popset_file, **kwargs)
File "/home/avanderb/anaconda4/lib/python2.7/site-packages/vespa/populations.py", line 2015, in init
do_only=do_only)
File "/home/avanderb/anaconda4/lib/python2.7/site-packages/vespa/populations.py", line 2170, in generate
hebpop = HEBPopulation.load_hdf(savefile, 'heb')
File "/home/avanderb/anaconda4/lib/python2.7/site-packages/vespa/populations.py", line 943, in load_hdf
new = StarPopulation.load_hdf(filename, path=path)
File "/home/avanderb/anaconda4/lib/python2.7/site-packages/vespa/stars/populations.py", line 1084, in load_hdf
stars = pd.read_hdf(filename,path+'/stars', autoclose=True)
File "/home/avanderb/anaconda4/lib/python2.7/site-packages/pandas/io/pytables.py", line 349, in read_hdf
store = HDFStore(path_or_buf, mode=mode, **kwargs)
File "/home/avanderb/anaconda4/lib/python2.7/site-packages/pandas/io/pytables.py", line 467, in init
self.open(mode=mode, **kwargs)
File "/home/avanderb/anaconda4/lib/python2.7/site-packages/pandas/io/pytables.py", line 605, in open
raise e
ValueError: The file '/data/k2/misc/vespa/lp358-348ctest4/popset.h5' is already opened, but not in read-only mode (as requested).
Closing remaining open files:/data/k2/misc/vespa/lp358-348ctest4/popset.h5...done/data/k2/misc/vespa/lp358-348ctest4/popset.h5...done/data/k2/misc/vespa/lp358-348ctest4/popset.h5...done/data/k2/misc/vespa/lp358-348ctest4/popset.h5...done/data/k2/misc/vespa/lp358-348ctest4/popset.h5...done

Issues when importing vespa

I installed vespa with pip. It goes well but when I try to import vespa, I encountered several errors. The first one is due to a print missing parenthesis, see below.

$ipython
Python 3.4.4 |Anaconda 2.3.0 (x86_64)| (default, Jan  9 2016, 17:30:09) 
Type "copyright", "credits" or "license" for more information.

IPython 4.0.2 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import vespa
WARNING:root:Deprecation Warning: 'triangle' has been renamed to 'corner'. This shim should continue to work but you should use 'import corner' in new code. https://github.com/dfm/corner.py
  File "/Users/Oliv/anaconda/lib/python3.4/site-packages/simpledist/kde.py", line 244
    print c
          ^
SyntaxError: Missing parentheses in call to 'print'

I solved the problem editing the kde.py file and adding parenthesis but I thought it coud be interesting for you to know.

But then the vespa import encounter another problem which seems a bit more serious:

ipython
Python 3.4.4 |Anaconda 2.3.0 (x86_64)| (default, Jan  9 2016, 17:30:09) 
Type "copyright", "credits" or "license" for more information.

IPython 4.0.2 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import vespa
WARNING:root:Deprecation Warning: 'triangle' has been renamed to 'corner'. This shim should continue to work but you should use 'import corner' in new code. https://github.com/dfm/corner.py
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-1-7ca74d659f60> in <module>()
----> 1 import vespa

/Users/Oliv/anaconda/lib/python3.4/site-packages/vespa/__init__.py in <module>()
     21 
     22     #StarPopulation & children
---> 23     from .stars.populations import StarPopulation
     24     from .stars.populations import MultipleStarPopulation
     25     from .stars.populations import ColormatchMultipleStarPopulation

/Users/Oliv/anaconda/lib/python3.4/site-packages/vespa/stars/__init__.py in <module>()
----> 1 from .populations import StarPopulation
      2 from .populations import MultipleStarPopulation, ColormatchMultipleStarPopulation
      3 from .populations import Spectroscopic_MultipleStarPopulation
      4 from .populations import BGStarPopulation, BGStarPopulation_TRILEGAL
      5 from .populations import BinaryPopulation, Simulated_BinaryPopulation

/Users/Oliv/anaconda/lib/python3.4/site-packages/vespa/stars/populations.py in <module>()
     49 from .contrastcurve import ContrastCurveFromFile
     50 
---> 51 from .utils import randpos_in_circle, draw_raghavan_periods
     52 from .utils import draw_msc_periods, draw_eccs
     53 from .utils import flat_massratio, mult_masses

/Users/Oliv/anaconda/lib/python3.4/site-packages/vespa/stars/utils.py in <module>()
     31     RAGHAVAN_LOGPERS = np.log10(RAGHAVAN_PERS.f1[RAGHAVAN_PERS.f0 == 'Y'])
     32     RAGHAVAN_BINPERS = RAGHAVAN_PERS.f1[RAGHAVAN_PERS.f0 == 'Y']
---> 33     RAGHAVAN_BINPERKDE = KDE_Distribution(RAGHAVAN_BINPERS,adaptive=False)
     34     RAGHAVAN_LOGPERKDE = KDE_Distribution(RAGHAVAN_LOGPERS,adaptive=False)
     35 

/Users/Oliv/anaconda/lib/python3.4/site-packages/simpledist/distributions.py in __init__(self, samples, adaptive, draw_direct, bandwidth, **kwargs)
   1035         self.bandwidth = bandwidth
   1036         self.kde = KDE(samples,adaptive=adaptive,draw_direct=draw_direct,
-> 1037                        bandwidth=bandwidth)
   1038 
   1039         if 'minval' not in kwargs:

/Users/Oliv/anaconda/lib/python3.4/site-packages/simpledist/kde.py in __init__(self, dataset, kernel, adaptive, k, fast, norm, bandwidth, weights, draw_direct, **kwargs)
    101                 self.h = h
    102         else:
--> 103             self.gauss_kde = gaussian_kde(self.dataset,bw_method=bandwidth,**kwargs)
    104 
    105 

/Users/Oliv/anaconda/lib/python3.4/site-packages/scipy/stats/kde.py in __init__(self, dataset, bw_method)
    166         self.dataset = atleast_2d(dataset)
    167         if not self.dataset.size > 1:
--> 168             raise ValueError("`dataset` input should have multiple elements.")
    169 
    170         self.d, self.n = self.dataset.shape

ValueError: `dataset` input should have multiple elements.

kde.py: ValueError: `dataset` input should have multiple elements.

Hi,
I'm having an issue with VESPA, when it tries to perform the Gaussian kernel density estimate. It seems that the problem is not with the routine, but with the data the routine analyses.
When I run calcfpp I get:

`Traceback (most recent call last):

File "/Users/sb/miniconda3/bin/calcfpp", line 66, in
from vespa import FPPCalculation
File "/Users/sb/miniconda3/lib/python3.6/site-packages/vespa/init.py", line 22, in
from .stars.populations import StarPopulation
File "/Users/sb/miniconda3/lib/python3.6/site-packages/vespa/stars/init.py", line 1, in
from .populations import StarPopulation
File "/Users/sb/miniconda3/lib/python3.6/site-packages/vespa/stars/populations.py", line 54, in
from .utils import randpos_in_circle, draw_raghavan_periods
File "/Users/sb/miniconda3/lib/python3.6/site-packages/vespa/stars/utils.py", line 33, in
RAGHAVAN_BINPERKDE = KDE_Distribution(RAGHAVAN_BINPERS,adaptive=False)
File "/Users/sb/miniconda3/lib/python3.6/site-packages/simpledist/distributions.py", line 1039, in init
bandwidth=bandwidth)
File "/Users/sb/miniconda3/lib/python3.6/site-packages/simpledist/kde.py", line 104, in init
self.gauss_kde = gaussian_kde(self.dataset,bw_method=bandwidth,**kwargs)
File "/Users/sb/miniconda3/lib/python3.6/site-packages/scipy/stats/kde.py", line 195, in init
raise ValueError("dataset input should have multiple elements.")
ValueError: dataset input should have multiple elements.`

I thought it could be related to the isochrones models I ran earlier, but the same error occurs when I run the code in the example directory of kepler-22.
I'm using VESPA 0.6 and isochrones 1.2.2 (not 2.0.1, as you suggested in #29, but I have the same problem with both the releases).
Any help would be appreciated.
Thank you

Can't install latest (v.0.5)

The latest isochrones (v 1.2) is fine, but vespa installation dies on a gcc error (here's the pip install error log, but the git cloning result was similar).

` creating build/temp.macosx-10.6-x86_64-2.7/vespa
gcc -fno-strict-aliasing -I//anaconda/include -arch x86_64 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I//anaconda/lib/python2.7/site-packages/numpy/core/include -I//anaconda/include/python2.7 -c vespa/_transitutils.c -o build/temp.macosx-10.6-x86_64-2.7/vespa/_transitutils.o
In file included from /opt/local/lib/gcc49/gcc/x86_64-apple-darwin16/4.9.4/include-fixed/syslimits.h:7:0,
from /opt/local/lib/gcc49/gcc/x86_64-apple-darwin16/4.9.4/include-fixed/limits.h:34,
from //anaconda/include/python2.7/Python.h:19,
from vespa/_transitutils.c:23:
/opt/local/lib/gcc49/gcc/x86_64-apple-darwin16/4.9.4/include-fixed/limits.h:168:61: fatal error: limits.h: No such file or directory
#include_next <limits.h> /* recurse down to the real one */
^
compilation terminated.
error: command 'gcc' failed with exit status 1

----------------------------------------

Command "//anaconda/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/kv/p51v_tbj5gjdd9q0jk4k2_5r0000gn/T/pip-install-dMif00/vespa/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /private/var/folders/kv/p51v_tbj5gjdd9q0jk4k2_5r0000gn/T/pip-record-V1nbOu/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/kv/p51v_tbj5gjdd9q0jk4k2_5r0000gn/T/pip-install-dMif00/vespa/`

Error caused by NumPy and Numba

I was trying to install VESPA in my device. I had installed it successfully but while importing the package I got an error in NumPy package. I found out that it was due to the older version of NumPy. So I updated it to the latest (1.22.1).

But in that case I got an issue that the another package called Numba wants NumPy of version 1.21 or less.

*I tried for NumPy 1.21 as well but again the same problem.

Here is the link to the pdf contains traceback,
https://drive.google.com/file/d/1KgA0xFAwWrao7KAoOfP7ZDOPQ3AuWyFa/view?usp=drivesdk

VESPA seems imcompatible with the newest isochrones

Hi,
I've updated the isochrones with the solved problem #43 of isochrones but it seems there are something wrong with VESPA's calcfpp which said:
Traceback (most recent call last):

File "./anaconda2/bin/calcfpp", line 68, in <module>
  from isochrones import StarModel, BinaryStarModel, TripleStarModel
ImportError: cannot import name BinaryStarModel

Do you know how to fix it?
Thanks

error in instalation

Hi,
I would like to use this very useful package, but unfortunately I'm having problems with the installation. My first question is if VESPA is able to run in python3. If yes, this is the error message I obtain:

mileva@mileva:~$ pip3 install vespa
Collecting vespa
Downloading https://files.pythonhosted.org/packages/e3/ae/2203304e11e9aa0be8c8f064e942b046d0f1ef14565a4b75b9d1cc6d0f25/VESPA-0.6.tar.gz (41.2MB)
|████████████████████████████████| 41.2MB 2.2MB/s
ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-install-eg_3qy0l/vespa/setup.py", line 63, in
ext_modules = cythonize(transit_utils),
NameError: name 'cythonize' is not defined
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-eg_3qy0l/vespa/

do you have any suggestion to handle this?

thanks in advance!

TRILEGAL server busy

I've recently been using some of your TRILEGAL code to call the webserver, and noticed that it doesn't allow for the server being busy and rejecting the request (the code then gets stuck waiting for an output file that doesn't come).

To get round this I rebuilt the get_trilegal script in pure python, and added some elements to allow for the server being busy. Would you be interested in the code? If so I'll set up a pull request.

I'm not sure if this is best listed as an 'issue' but couldn't think where else to ask.

The `representation` keyword/property name is deprecated in favor of `representation_type`

Running calcfpp I received the following error message.

File "/anaconda3/lib/python3.7/site-packages/astropy/coordinates/baseframe.py", line 128, in _representation_deprecation
'favor of representation_type', AstropyDeprecationWarning)
astropy.utils.exceptions.AstropyDeprecationWarning: The representation keyword/property name is deprecated in favor of representation_type
FPP calculation failed for ..

So I opened

/anaconda3/lib/python3.7/site-packages/astrop/coordinates/baseframe.py

and replaced the "representation" keyword with "representation_type" throughout the file. I then reran calcfpp resulting in this error message:

File "/anaconda3/lib/python3.7/site-packages/VESPA-0.5.1-py3.7-macosx-10.7-x86_64.egg/vespa/orbits/populations.py", line 336, in init
self.obspos = SkyCoord(obsx,obsy,obsz,representation='cartesian')
File "/anaconda3/lib/python3.7/site-packages/astropy/coordinates/sky_coordinate.py", line 248, in init
frame_cls, frame_kwargs = _get_frame_without_data(args, kwargs)
File "/anaconda3/lib/python3.7/site-packages/astropy/coordinates/sky_coordinate_parsers.py", line 201, in _get_frame_without_data
_normalize_representation_type(kwargs)
File "/anaconda3/lib/python3.7/site-packages/astropy/coordinates/baseframe.py", line 141, in _normalize_representation_type
_representation_deprecation()
File "/anaconda3/lib/python3.7/site-packages/astropy/coordinates/baseframe.py", line 128, in _representation_deprecation
'favor of representation_type', AstropyDeprecationWarning)
astropy.utils.exceptions.AstropyDeprecationWarning: The representation keyword/property name is deprecated in favor of representation_type

I then replaced any mentioning of the keyword "representation" with "representation_type" throughout the file

/anaconda3/lib/python3.7/site-packages/VESPA-0.5.1-py3.7-macosx-10.7-x86_64.egg/vespa/orbits/populations.py

and ran calcfpp again. Then it worked.

I assume that VESPA 0.5.1 is using a deprecated "representation" keyword when calling astropy. This should be changed to "representation_type".

[question] can vespa be used to vet brown dwarfs?

Hi Tim, I looked at the documentation and the main vespa references and found no mention about the treatment of brown dwarfs.
I am just wondering if vespa can be used (or how can it be improved) to vet brown dwarfs too.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.