EchelleJSON.py
def read(fname):
    '''
    A simple routine to read a JSON format and return dictionaries of numpy arrays.
    '''

    f = open(fname, 'r')
    echelle_dict = json.load(f)
    f.close()

    # go through each of the orders and convert these from lists to numpy arrays
    order_keys = [key for key in echelle_dict.keys() if "order_" in key]
    for key in order_keys:
        order = echelle_dict[key]
        echelle_dict[key]["wl"] = np.array(order["wl"])
        echelle_dict[key]["fl"] = np.array(order["fl"])

        # If it has sigma, convert it too
        if "sigma" in order.keys():
            echelle_dict[key]["sigma"] = np.array(order["sigma"])

    return echelle_dict

    A simple routine to read a JSON format and return dictionaries of numpy arrays.
    
A simple routine to read a JSON format and return dictionaries of numpy arrays.
A simple routine to read a JSON format and return dictionaries of numpy arrays .
def read(fname):
    f = open(fname, 'r')
    echelle_dict = json.load(f)
    f.close()
    order_keys = [key for key in echelle_dict.keys() if "order_" in key]
    for key in order_keys:
        order = echelle_dict[key]
        echelle_dict[key]["wl"] = np.array(order["wl"])
        echelle_dict[key]["fl"] = np.array(order["fl"])
        if "sigma" in order.keys():
            echelle_dict[key]["sigma"] = np.array(order["sigma"])
    return echelle_dict
def read ( fname ) : f = open ( fname , 'r' ) echelle_dict = json . load ( f ) f . close ( ) order_keys = [ key for key in echelle_dict . keys ( ) if "order_" in key ] for key in order_keys : order = echelle_dict [ key ] echelle_dict [ key ] [ "wl" ] = np . array ( order [ "wl" ] ) echelle_dict [ key ] [ "fl" ] = np . array ( order [ "fl" ] ) if "sigma" in order . keys ( ) : echelle_dict [ key ] [ "sigma" ] = np . array ( order [ "sigma" ] ) return echelle_dict
A simple routine to read a JSON format and return dictionaries of numpy arrays.
A simple routine to read a JSON format and return dictionaries of numpy arrays .
'''
    A simple routine to read a JSON format and return dictionaries of numpy arrays.
    ''' # go through each of the orders and convert these from lists to numpy arrays # If it has sigma, convert it too
fname