TidalPy.structures.world_builder package
Submodules
TidalPy.structures.world_builder.config_handler module
- TidalPy.structures.world_builder.config_handler.check_for_duplicate_worlds(world_configs: dict)[source]
Check for duplicate world_types in the world config listing.
- Parameters:
world_configs (dict) – Dictionary of world_types (in the format [<name>: <config filepath>])
- TidalPy.structures.world_builder.config_handler.clean_world_config(world_config: dict, make_copy: bool = True)[source]
Provides a clean copy of a world’s configuration, deleting any items initialized by TidalPy
- Parameters:
world_config (dict) – World’s configuration dictionary
make_copy (bool = True) – Determines if a copy of the dictionary is made. Otherwise changes in this function will affect any other pointers to this dict object.
- Returns:
cleaned_dict – Cleaned dictionary with no TidalPy entries
- Return type:
dict
TidalPy.structures.world_builder.iterative_builder module
Planet Iteration Package
- The goal of this package is to provide the user an easy, but less accurate, way to estiamte the interior structure
of planets. It was designed with exoplanets in mind where some measurements (moment of inertia, etc) are completely unknown.
- TODO: This is not the fastest nor most accurate way to do this. It was a quick and dirty way to get some estimates
In the future a more robust method should be developed. It should also be able to handle MOI, etc. for a more accurate answer. Ideally it would also be able to change the number/composition of layers to better fit the data. That latter part is probably a much bigger task
- TODO: This could be sped up by only calling on the burnman builder (instead of having to initialize all of TidalPy
at each iteration step).
- TidalPy.structures.world_builder.iterative_builder.world_iterative_builder(base_world, goal_radius, goal_mass, ice_mass_frac: float = None, initial_core_density: float = 10000.0, initial_mantle_density: float = 4000.0, ice_density: float = 920.0, tolerance=0.05)[source]
Takes a baseline planet that is close to ideal and iterates on the constructor until there is convergence in the mass and radius
- Parameters:
base_world – Instantiated world object that acts as the starting point of the iteration
goal_radius (float) – The final desired radius
goal_mass (float) – The final desired mass
ice_mass_frac (float) – The mass fraction of ice (or other envelope, just change the density) on the planet.
initial_core_density (float) – Initial (average) core density used in the first iteration. The closer this is to the final value, the faster the iteration.
initial_mantle_density (float) – Initial (average) mantle density used in the first iteration. The closer this is to the final value, the faster the iteration.
ice_density (float) – Density of the ice layer
tolerance (float) – The tolerance on final vs. goal mass and radius.
- Returns:
Final, instantiated, planet which the iterated mass and radius values
- Return type:
iterated_world
TidalPy.structures.world_builder.world_builder module
- TidalPy.structures.world_builder.world_builder.build_from_world(old_world, new_config: dict, new_name: str = None)[source]
Constructs a new world based on a previously built one.
- The old_world should have characteristics close to the one you desire. For example, if you wanted to make an Io-like
world except that it has an ice layer overtop of it, then choose Europa as a starting point since it would have a similar layer structure and size to the desired world.
- If instead, you wish to simply scale up or down a world (turn Earth into a super-Earth or Io into a super-io,
then look into using the scale_from_world function instead.
See also
‘world_builder.py’.scale_from_world
- Parameters:
old_world – Already initialized world object.
new_config (dict) – Planet config for the changes to the new planet. This will override configs found in old_planet.
new_name (str) – Optional name provided to the new planet.
- Returns:
The newly configured and initialized planet object.
- Return type:
new_world
- TidalPy.structures.world_builder.world_builder.build_world(world_name: str, world_config: dict | TextIO = None)[source]
Build a TidalPy world based on a pre-built config or a user-provided configuration dictionary
Note: ‘world’ is used for any object: stars, gas giants, earth-like world_types, moons, and even Pluto!
- TidalPy ships with a directory of world configurations. By default these can be found in:
<TidalPy install directory>/TidalPy/structures/world_types/
- These are TOML files that contain all the information that TidalPy needs to build a new world. Use the pre-built
configuration files as templates to create new ones (which should be saved in the same directory).
- Alternatively, you can make a python dictionary object that contains the same information and pass it to this
function using the world_config argument.
- Parameters:
world_name (str) – World’s name. This is used to search the pre-built configuration files.
world_config (dict = None) – Alternatively, the user can provide a python dictionary with all of the required information. It is recommended that a pre-built configuration is used as a template for this dictionary.
- Returns:
The initialized TidalPy world object.
- Return type:
- TidalPy.structures.world_builder.world_builder.scale_from_world(old_world, new_name: str = None, mass_scale: float = None, radius_scale: float = None)[source]
Constructs a new planet that is a scaled up/down version of an old planet
- The old_planet should not be too different from your goal planet in terms of mass, radius, layer structure, and
composition. For example, if you are trying to make a slightly larger/smaller Earth, don’t use Io or Europa as for old_planet. Likewise, if you want to make a 2x mass Pluto, don’t use the Earth as your base.
- Making sure that the layer structure of old_world is the same as the desired planet is more important than
ensuring that old_world’s radius/mass is close to the new world_types. So, if you want to make a super-sized Europa then it is actually better to start from Ganymede as it will have a high-pressure ice layer that Europa does not, but the new larger super-Europa might.
- It is recommended to call the new planet’s .paint() method before using it in for any analysis to ensure its
internal structure matches your expectations.
- Parameters:
old_world – World to base the scale off of. This should be an already initialized TidalPy world object
new_name (str = None) – New name to call the planet
mass_scale (FloatNone = None) – Providing this will treat mass fractions of the planet’s layer’s as constants. Radii will be estimated from density
radius_scale (FloatNone = None) – Providing this will treat volume fractions of the planet’s layer’s as constants. Masses will be calculated from EOS
- Returns:
The newly scaled planet.
- Return type:
new_world