Module simpa.acc

Class TuneCalculator

java.lang.Object
simpa.acc.api.utils.TuneCalculator

public class TuneCalculator extends Object
Class for calculating the tune of an accelerator machine.
  • Constructor Summary

    Constructors
    Constructor
    Description
    construct the tune calculator using and input file with phase space coordinates.
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    calculateAllTunes(String directory, int startTurns, int turns, String outfile)
    Reads all phase space files in the given directory and calculate the tunes for each of them by taking the given number of turns from each file from the given starting turn.
    double
    getHorizontalTune(int startTurns, int nTurns)
    Gets the horizontal tune starting from a specific turn and measured for a certain amount of turns.
    double
    getVerticalTune(int startTurns, int nTurns)
    Gets the vertical tune starting from a specific turn and measured for a certain amount of turns.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TuneCalculator

      public TuneCalculator(String file) throws FileNotFoundException
      construct the tune calculator using and input file with phase space coordinates.
      Parameters:
      file - input file with phase space coordinates.
      Throws:
      FileNotFoundException
  • Method Details

    • getHorizontalTune

      public double getHorizontalTune(int startTurns, int nTurns)
      Gets the horizontal tune starting from a specific turn and measured for a certain amount of turns.
      Parameters:
      startTurns - the turn to start the measurement
      nTurns - the amount of turns to measure
      Returns:
      the horizontal tune
    • getVerticalTune

      public double getVerticalTune(int startTurns, int nTurns)
      Gets the vertical tune starting from a specific turn and measured for a certain amount of turns.
      Parameters:
      startTurns - the turn to start the measurement
      nTurns - the amount of turns to measure
      Returns:
      the vertical tune
    • calculateAllTunes

      public static void calculateAllTunes(String directory, int startTurns, int turns, String outfile) throws FileNotFoundException
      Reads all phase space files in the given directory and calculate the tunes for each of them by taking the given number of turns from each file from the given starting turn. Then it writes the result into the given output file.
      Parameters:
      directory - the directory where the phase space files are located
      startTurns - the turn to start the measurement from, usually zero.
      turns - the number of turns to take from each file
      outfile - the output file where the tunes are written
      Throws:
      FileNotFoundException