# 5.8.1.2. eqcorrscan.utils.mag_calc.amp_pick_sfile

`eqcorrscan.utils.mag_calc.``amp_pick_sfile`(sfile, datapath, respdir, chans=['Z'], var_wintype=True, winlen=0.9, pre_pick=0.2, pre_filt=True, lowcut=1.0, highcut=20.0, corners=4, min_snr=1.0, plot=False, remove_old=False, velocity=False)

  Function to pick amplitudes for local magnitudes from NORDIC s-files.

  Reads information from a SEISAN s-file, load the data and the picks, cut the data for the channels given around the S-window, simulate a Wood Anderson seismometer, then pick the maximum peak-to-trough amplitude.

  Output will be put into a mag_calc.out file which will be in full S-file format and can be copied to a REA database.

  See docs for `eqcorrscan.utils.mag_calc.amp_pick_event()` for methods used here for stabilisation.

  Parameters: | sfile (str) Path to NORDIC format s-file datapath (str) Path to the waveform files - usually the path to the WAV directory respdir (str) Path to the response information directory chans (list) List of the channels to pick on, defaults to [‘Z’] - should just be the orientations, e.g. Z,1,2,N,E var_wintype (bool) If True, the winlen will be multiplied by the P-S time if both P and S picks are available, otherwise it will be multiplied by the hypocentral distance*0.34 - derived using a p-s ratio of 1.68 and S-velocity of 1.5km/s to give a large window, defaults to True winlen (float) Length of window, see above parameter, if var_wintype is False then this will be in seconds, otherwise it is the multiplier to the p-s time, defaults to 0.5. pre_pick (float) Time before the s-pick to start the cut window, defaults to 0.2 pre_filt (bool) To apply a pre-filter or not, defaults to True lowcut (float) Lowcut in Hz for the pre-filter, defaults to 1.0 highcut (float) Highcut in Hz for the pre-filter, defaults to 20.0 corners (int) Number of corners to use in the pre-filter min_snr (float) Minimum signal-to-noise ratio to allow a pick - see note in amp_pick_event on signal-to-noise ratio calculation. plot (bool) Turn plotting on or off. remove_old (bool) If True, will remove old amplitude picks from event and overwrite with new picks. Defaults to False. velocity (bool) Whether to make the pick in velocity space or not. Original definition of local magnitude used displacement of Wood-Anderson, MLv in seiscomp and Antelope uses a velocity measurement.
  Returns: | Picked event
  Return type: | `obspy.core.event.event.Event`