Import Equation of State

Function to import equation of state given by user.

TOVsolver.EoS_import.EOS_check(density, pressure)[source]

file_read

Checks that the derivative (drho/dp) is positive.

Parameters:
  • density (array) – numpy 1Darray. Density array to be checked.

  • pressure (array) – numpy 1Darray. Pressure array to be checked.

Returns:

two arrays, one corresponding to density and one corresponding to pressure or ends the function and prints invalid equation of state.

Return type:

array

TOVsolver.EoS_import.EOS_import(file_name='', density=0, pressure=0)[source]

Imports density and pressure from csv or array, checks them, and returns them.

Parameters:
  • file_name (string, optional) – string. CSV file to be opened.

  • density (array, optional) – numpy 1Darray. Passed into a check function and returned if valid.

  • pressure (array, optional) – numpy 1Darray. Passed into a check function and returned if valid.

Returns:

checked density and pressure.

Return type:

array

TOVsolver.EoS_import.file_read(input_file)[source]

Reads a csv file of denisty and pressure given by the user.

Parameters:

input_file (string) – string. File to be opened and parsed.

Returns:

two 1Darray numpy arrays, one corresponding to density and one corresponding to pressrure.

Return type:

array