In [1]:
import sncosmo

In [2]:
data  = sncosmo.load_example_data()

In [3]:
data


Out[3]:
timebandfluxfluxerrzpzpsys
55070.0sdssg0.363511535970.67284384754125.0ab
55072.0512821sdssr-0.2008012958640.67284384754125.0ab
55074.1025641sdssi0.3074942329810.67284384754125.0ab
55076.1538462sdssz1.087761036560.67284384754125.0ab
55078.2051282sdssg-0.436678956450.67284384754125.0ab
55080.2564103sdssr1.097809667790.67284384754125.0ab
55082.3076923sdssi3.75626856270.67284384754125.0ab
55084.3589744sdssz5.348588949660.67284384754125.0ab
55086.4102564sdssg2.826141872690.67284384754125.0ab
55088.4615385sdssr7.565470450540.67284384754125.0ab
55090.5128205sdssi7.433169610130.67284384754125.0ab
..................
55129.4871795sdssr2.65974855860.67284384754125.0ab
55131.5384615sdssi3.995204040210.67284384754125.0ab
55133.5897436sdssz5.739894580940.67284384754125.0ab
55135.6410256sdssg0.3307022831070.67284384754125.0ab
55137.6923077sdssr0.5652867265790.67284384754125.0ab
55139.7435897sdssi3.043183467950.67284384754125.0ab
55141.7948718sdssz5.626926863840.67284384754125.0ab
55143.8461538sdssg-0.7226547890130.67284384754125.0ab
55145.8974359sdssr1.120917642620.67284384754125.0ab
55147.9487179sdssi2.12466952640.67284384754125.0ab
55150.0sdssz5.34821756450.67284384754125.0ab

In [7]:
sncosmo.write_lc(data, fname='lc.salt', format='salt') #works

In [8]:
sncosmo.write_lc(data, fname='lc.json', format='json') #works

In [9]:
sncosmo.write_lc(data, fname='lc.fits', format='snana', pedantic=False)

In [5]:
help(sncosmo.write_lc)


Help on function write_lc in module sncosmo.io:

write_lc(data, fname, format='ascii', **kwargs)
    Write light curve data.
    
    Parameters
    ----------
    data : `~astropy.table.Table`
        Light curve data.
    fname : str
        Filename.
    format : {'ascii', 'salt2', 'snana', 'json'}, optional
        Format of file. Default is 'ascii'. 'salt2' is the new format available
        in snfit version >= 2.3.0.
    delim : str, optional
        **[ascii only]** Character used to separate entries on a line.
        Default is ' '.
    metachar : str, optional
        **[ascii only]** Metadata designator. Default is '@'.
    raw : bool, optional
        **[salt2, snana]** By default, the SALT2 and SNANA writers rename
        some metadata keys and column names in order to comply with what
        snfit and SNANA expect. Set to True to override this.
        Default is False.
    pedantic : bool, optional
        **[salt2, snana]** If True, check that output column names and header
        keys comply with expected formatting, and raise a ValueError if not.
        It is probably a good idea to set to False when raw is True.
        Default is True.


In [ ]: