Import Equation of State

Function to import equation of state given by user.

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

Return finite 1D EOS arrays with increasing density and stable pressure.

Repeated pressure values are allowed for first-order phase transitions. Invalid tables raise ValueError before interpolation or division.

TOVsolver.EoS_import.EOS_import()[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()[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