Skip to content

Commit

Permalink
fix variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
segasai committed Oct 10, 2024
1 parent ee20370 commit be4d316
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions py/desispec/scripts/trace_shifts.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,22 +140,22 @@ def fit_trace_shifts(image, args):
internal_wavelength_calib = False
elif flavor == "arc" :
internal_wavelength_calib = True
subtract_continuum = False
args.arc_lamps = True
else :
subtract_continuum = True
internal_wavelength_calib = True
args.sky = True
log.info("wavelength calib, internal={}, sky={} , arc_lamps={}".format(internal_wavelength_calib,args.sky,args.arc_lamps))

spectrum_filename = args.spectrum
if args.sky :
continuum_subtract = True
srch_file = "data/spec-sky.dat"
if not resources.files('desispec').joinpath(srch_file).is_file():
log.error("Cannot find sky spectrum file {:s}".format(srch_file))
raise RuntimeError("Cannot find sky spectrum file {:s}".format(srch_file))
spectrum_filename = resources.files('desispec').joinpath(srch_file)
elif args.arc_lamps :
continuum_subtract = False
srch_file = "data/spec-arc-lamps.dat"
if not resources.files('desispec').joinpath(srch_file).is_file():
log.error("Cannot find arc lamps spectrum file {:s}".format(srch_file))
Expand Down Expand Up @@ -198,7 +198,7 @@ def fit_trace_shifts(image, args):
x_for_dx,y_for_dx,dx,ex,fiber_for_dx,wave_for_dx = compute_dx_from_cross_dispersion_profiles(xcoef,ycoef,wavemin,wavemax, image=image, fibers=fibers, width=args.width, deg=args.degxy,image_rebin=args.ccd_rows_rebin)
if internal_wavelength_calib :
# measure y shifts
x_for_dy,y_for_dy,dy,ey,fiber_for_dy,wave_for_dy = compute_dy_using_boxcar_extraction(tset, image=image, fibers=fibers, width=args.width, subtract_continuum=subtract_continuum)
x_for_dy,y_for_dy,dy,ey,fiber_for_dy,wave_for_dy = compute_dy_using_boxcar_extraction(tset, image=image, fibers=fibers, width=args.width, continuum_subtract=continuum_subtract)
mdy = np.median(dy)
log.info("Subtract median(dy)={}".format(mdy))
dy -= mdy # remove median, because this is an internal calibration
Expand Down

0 comments on commit be4d316

Please sign in to comment.