remove_avg_com_motion makes you provide path_to_waveform_h5 even if you tell it not to read that file (by passing in a waveform object w_m) and even if that file doesn't exist. That actual h5 file doesn't need to exist, but path_to_waveform_h5 must have the form 'something.h5/group' or '/full/path/something.h5/group', which it will always parse and it will throw an error if it cannot parse, because it uses the /full/path and group pieces later on in the code. If you don't provide path_to_horizons_h5 or path_to_matter_h5 arguments, then it will look for Horizons.h5 and Matter.h5 inside '/full/path' (or inside cwd if the given path begins with 'something.h5'). Also, both '/full/path' and 'group' will be used for output of figures and filenames of figure files if plotting is turned on.
Note that if your Horizons.h5 happens to be in cwd, then the default value of path_to_waveform_h5 will work correctly if you don't specify path_to_horizons_h5. (but if you turn plotting on, the plot filename will contain 'Extrapolated_N2' which might be misleading).
It would be less confusing if the options were done differently.
Perhaps path_to_horizons_h5 could be the required option, and then internally the variable directory would come from path_to_horizons_h5. Then path_to_waveform_h5 could be truly optional and have a default of None. The internal variable subdir could have its own option (which the user would be required to specify if path_to_waveform_h5 is None and if plotting is turned on).
remove_avg_com_motionmakes you providepath_to_waveform_h5even if you tell it not to read that file (by passing in a waveform objectw_m) and even if that file doesn't exist. That actual h5 file doesn't need to exist, butpath_to_waveform_h5must have the form 'something.h5/group' or '/full/path/something.h5/group', which it will always parse and it will throw an error if it cannot parse, because it uses the/full/pathandgrouppieces later on in the code. If you don't providepath_to_horizons_h5orpath_to_matter_h5arguments, then it will look for Horizons.h5 and Matter.h5 inside '/full/path' (or inside cwd if the given path begins with 'something.h5'). Also, both '/full/path' and 'group' will be used for output of figures and filenames of figure files if plotting is turned on.Note that if your Horizons.h5 happens to be in cwd, then the default value of
path_to_waveform_h5will work correctly if you don't specifypath_to_horizons_h5. (but if you turn plotting on, the plot filename will contain 'Extrapolated_N2' which might be misleading).It would be less confusing if the options were done differently.
Perhaps
path_to_horizons_h5could be the required option, and then internally the variabledirectorywould come frompath_to_horizons_h5. Thenpath_to_waveform_h5could be truly optional and have a default of None. The internal variablesubdircould have its own option (which the user would be required to specify ifpath_to_waveform_h5is None and if plotting is turned on).