Skip to content

Interp Crash #3

Description

@Hallflower20

Ran this ascii file ZTF18aahqkbt_20180929_HST_v1.ascii and got a crash.


ValueError Traceback (most recent call last)
in
102 #Core superfit function on the binned file, default to plot and save n fits
--> 103 all_parameter_space(redshift,extconstant,templates_sn_trunc,templates_gal_trunc,
104 lam, resolution, n=n, plot=plotting, kind=kind, original=save_bin, save=save_results_path, show=show)

/mnt/c/Users/20xha/Documents/Caltech/Research/superfit/superfit/SF_functions.py in all_parameter_space(redshift, extconstant, templates_sn_trunc, templates_gal_trunc, lam, resolution, n, plot, **kwargs)
709 for element in itertools.product(redshift,extconstant):
--> 710
711 a, _ = core_total(element[0],element[1], sn_spec_files, templates_gal_trunc, lam, resolution, **kwargs)

/mnt/c/Users/20xha/Documents/Caltech/Research/superfit/superfit/SF_functions.py in core_total(z, extcon, templates_sn_trunc, templates_gal_trunc, lam, resolution, **kwargs)
317
--> 318 sigma = error_obj(kind, lam, original)
319

/mnt/c/Users/20xha/Documents/Caltech/Research/superfit/superfit/SF_functions.py in error_obj(kind, lam, obj_path)
145
--> 146 error = savitzky_golay(object_spec)
147

/mnt/c/Users/20xha/Documents/Caltech/Research/superfit/superfit/error_routines.py in savitzky_golay(spec)
101
--> 102 smooth = mf.savgol_filter(y, 31, 3 )
103 resid = y - smooth

~/anaconda3/lib/python3.8/site-packages/scipy/signal/_savitzky_golay.py in savgol_filter(x, window_length, polyorder, deriv, delta, axis, mode, cval)
338 if window_length > x.size:
--> 339 raise ValueError("If mode is 'interp', window_length must be less "
340 "than or equal to the size of x.")

ValueError: If mode is 'interp', window_length must be less than or equal to the size of x.

During handling of the above exception, another exception occurred:

ValueError Traceback (most recent call last)
in
115 kill_header_and_bin(original,resolution, save_bin = save_bin)
116 #Core superfit function on the binned file, default to plot and save n fits
--> 117 all_parameter_space(redshift,extconstant,templates_sn_trunc,templates_gal_trunc,
118 lam, resolution, n=n, plot=plotting, kind=kind, original=save_bin, save=save_results_path, show=show)

/mnt/c/Users/20xha/Documents/Caltech/Research/superfit/superfit/SF_functions.py in all_parameter_space(redshift, extconstant, templates_sn_trunc, templates_gal_trunc, lam, resolution, n, plot, **kwargs)
708
709 for element in itertools.product(redshift,extconstant):
--> 710
711 a, _ = core_total(element[0],element[1], sn_spec_files, templates_gal_trunc, lam, resolution, **kwargs)
712

/mnt/c/Users/20xha/Documents/Caltech/Research/superfit/superfit/SF_functions.py in core_total(z, extcon, templates_sn_trunc, templates_gal_trunc, lam, resolution, **kwargs)
316 name = obj_name_int(original, lam, resolution)[0]
317
--> 318 sigma = error_obj(kind, lam, original)
319
320 sn, gal = sn_hg_arrays(z, extcon, lam, templates_sn_trunc, templates_gal_trunc)

/mnt/c/Users/20xha/Documents/Caltech/Research/superfit/superfit/SF_functions.py in error_obj(kind, lam, obj_path)
144 if kind == 'SG':
145
--> 146 error = savitzky_golay(object_spec)
147
148 object_err_interp = interpolate.interp1d(error[:,0], error[:,1], bounds_error=False, fill_value='nan')

/mnt/c/Users/20xha/Documents/Caltech/Research/superfit/superfit/error_routines.py in savitzky_golay(spec)
100
101
--> 102 smooth = mf.savgol_filter(y, 31, 3 )
103 resid = y - smooth
104

~/anaconda3/lib/python3.8/site-packages/scipy/signal/_savitzky_golay.py in savgol_filter(x, window_length, polyorder, deriv, delta, axis, mode, cval)
337 if mode == "interp":
338 if window_length > x.size:
--> 339 raise ValueError("If mode is 'interp', window_length must be less "
340 "than or equal to the size of x.")
341

ValueError: If mode is 'interp', window_length must be less than or equal to the size of x.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions