jbirky / apogee_tools

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

rotation_broaden fix #26

Closed chihchunhsu closed 5 years ago

chihchunhsu commented 5 years ago

The number of points for the rotational broadening and LSF should be odd. Here is some fix in rotation_broaden.py:

on line 68 (under the lsf_rotate function):

    nwid = npts // 2.

on line 114-121 (under the broaden function):

    elif gaussian: 
        if np.ceil(20.*vbroad/vres) % 2 == 0:
            x    = np.arange(np.ceil(20.*vbroad/vres)+1)
        else:
            x    = np.arange(np.ceil(20.*vbroad/vres))
        x    = (x / np.max(x)-0.5)*20.

        kern = np.exp(-0.5*x**2) 
    else:
        if np.ceil(20.*vbroad/vres) % 2 == 0:
            x    = np.arange(np.ceil(20.*vbroad/vres)+1)*10.
        else:
            x    = np.arange(np.ceil(20.*vbroad/vres))*10.
jbirky commented 5 years ago

closed on commit 9dd09eb