def create_sample_data(directory, dataset):
    """Creates sample datasets for testing and saves it to a two column csv.

    Parameters
    ----------
    directory : str
        Directory to write csv file to.
    dataset : int
        The integer associated with each sample testing dataset.

    Returns
    -------
    type : csv file
        two column csv file with wavelength (um) and flux (Jy).

    """
    target_filename = "sample_target_" + str(dataset) + ".csv"
    target_file_path = str(directory.join(target_filename))
    file = open(target_file_path, "w")
    # simple dataset
    if dataset == 1:
        file.write("3.55,0.389\n4.49,0.357\n5.73,0.344\n7.87,0.506\n23.7,0.676")
    # longer dataset
    if dataset == 2:
        file.write("1.2,0.4\n1.5,0.1\n1.6,0.1\n1.7,0.2\n2,0.7\n5,1.0\n40,0.676")
    # out of order and bad fluxes
    if dataset == 3:
        file.write("1,0.389\n4,0.357\n3,0.344\n10,0\n40,-90")
    # # not enough sources (failure)
    # if dataset == 4:
    #     file.write("1,0.389\n4,0.357")
    file.close()
    return target_file_path