jbirky / apogee_tools

Modeling tools for SDSS/APOGEE spectra
http://apogee-tools.readthedocs.io/
MIT License
2 stars 3 forks source link

smoothVSINI not working #13

Closed chihchunhsu closed 7 years ago

chihchunhsu commented 7 years ago

mdl = ap.getModel( params=[3200, 5.0, 0.0], grid='BTSETTLb', xrange=[15200,16940]) ap.smoothVSINI(mdl)

Raise the error below:

PyAValError Traceback (most recent call last)

in () ----> 1 ap.smoothVSINI(data) /Users/dinohsu/projects/apogee_all/apogee_tools/apogee_tools/spec_tools.py in smoothVSINI(mspec, **kwargs) 649 650 #Perform rotational broadening using PyAstronomy; return flux --> 651 rflux = pyasl.rotBroad(n_wave, n_flux, limb, vsini) 652 653 #Save broadened spectrum to new spectrum object /Users/dinohsu/anaconda/lib/python3.6/site-packages/PyAstronomy/pyasl/asl/rotBroad.py in rotBroad(wvl, flux, epsilon, vsini, edgeHandling) 103 solution="Use evenly spaced input array.")) 104 if vsini <= 0.0: --> 105 raise(PE.PyAValError("vsini must be positive.", where="pyasl.rotBroad")) 106 if (epsilon < 0) or (epsilon > 1.0): 107 raise(PE.PyAValError("Linear limb-darkening coefficient, epsilon, should be '0 < epsilon < 1'.", PyAValError: --------------------- A PyA error occurred: --------------------- Type of error: PyA Value Error What happened? vsini must be positive. Where did it happen? pyasl.rotBroad
ctheissen commented 7 years ago

I believe the error is that PyAstronomy doesn't like limb-darkening coefficients (epsilon) at 0 or 1. I think the default (in line 636 of spec_tools.py) should be changed to 0.6 from 0.

ctheissen commented 7 years ago

Fixed.