Main — Toy_Coronagraph 1.6.1 documentation

Skip to main content
`Ctrl`+`K`

# Main

Function to perform toy coronagraph

class main.Target

  A circular symmetric target

  A circular symmetric target, which could be a dust ring, a debris disk, or ice remains.

  file_name

    The name of the FITS file containing the target data.

    Type:

      str

  taregt_pixel

    Number of pixels along the edge of the target image.

    Type:

      int

  psf_scale

    The scale of the PSF in arcseconds per pixel.

    Type:

      float

  xpix

    The x-coordinates of the pixels in arcseconds.

    Type:

      np.ndarray

  ypix

    The y-coordinates of the pixels in arcseconds.

    Type:

      np.ndarray

  pre_img

    The pre-processed image.

    Type:

      np.ndarray

  planets

    A list of the planets in the system.

    Type:

      list

  orbits

    A list of the orbits of the planets.

    Type:

      list

  planets_brightness

    A list of the brightnesses of the planets in Jy/arcsec^2.

    Type:

      list

  __init__()

    Initialize the Target object.

  __init__()

    Initialization

    Initializes the instance based on the target fits file.

    Parameters:

      None –

  __weakref__

    list of weak references to the object (if defined)

  add_planet(pos, brightness, mode='moving', res=1000)

    Add a planet

    Add a planet to the Target object.

    Parameters:

      - pos (array-like) – Planet position information (depends on mode). For “moving” mode, pos = [a, e, pa, inc, t]; for “polar” mode, pos =[r, theta(in degree)]; for “cartesian” mode, pos =[x,y].

      - brightness (float) – Planet brightness in Jy.

      - mode (str) – Mode for specifying planet position coordinates (“moving”, “polar”, “cartesian”).

      - res (int) – Number of points used for orbit calculations.

    Returns:

      None

  contrast(charge=2, order=1, plot_contrast=True, plot_dpi=300, exozodi_limit=10, res=100)

    Contrast

    Find the planet brightness and background brightness in the final image.

    Parameters:

      - charge (int) – Charge number (for vortex coronagraph).

      - order (int) – The order number of the planet, using self.list_planets() to look up the order.

      - plot_contrast (bool) – Whether to plot the dust to planet brightness ratio.

      - plot_dpi (int) – Dots per inch (DPI) for the plot.

      - exozodi_limit (float) – The maximum exozodi to target dust ratio.

      - res (int) – The number of points in the exozodi ratio range.

    Returns:

      plot or print planet brightness, background brightness, and background brightness (ignored dust inside IWA) in Jy.

  delete_planet(order=1)

    Delete planet

    Deletes a planet from self.planet, self.orbit, and self.planet_brightness with a given order number.

    Parameters:

      order (int) – The order number of the planet to be deleted. Defaults to 1.

    Returns:

      None

  list_planets()

    List planets

    List the planets present in the Target object with their order numbers.

    Returns:

      print the list of planets with their orders.

  planet_move(time, order=1, mode='cumulate', plot_pos=False, plot_dpi=300, res=1000, flip=True, message=True)

    Planet moving

    Move a planet’s position.

    Parameters:

      - time (float) – The time by which the planet should move.

      - order (int) – The order number of the planet.

      - mode (str) – Mode for specifying movement (“culmulated”, “specific”). The former will be added to the original time, while the latter will set up a new time regardless of the original time.

      - plot_pos (bool) – Whether to plot the new planet’s position in its orbit.

      - plot_dpi (int) – Dots per inch (DPI) for the plot.

      - res (int) – Number of points used for orbit calculations.

      - flip (bool) – Whether to flip the y-axis of the plot.

      - message (bool) – Whether to show the notification once job done.

    Returns:

      None

  planet_video(charge, order=1, iwa_ignore=False, plot_dpi=300, length=3, fps=20, flip=True)

    Planet Video

    Create a movie of the planet moving in its orbit.

    Parameters:

      - charge (int) – Charge number (for vortex coronagraph).

      - order (int) – The order number of the planet, using self.list_planets() to look up the order.

      - iwa_ignore (bool) – Whether to ignore the dust inside IWA.

      - plot_dpi (int) – Dots per inch (DPI) for the plot.

      - length (int) – The length of the movie in seconds.

      - fps (int) – The frames per second of the movie.

      - flip (bool) – Whether to flip the y-axis of the plot.

    Returns:

      planet_video_*.mp4

  plot_final(charge, iwa_ignore=False, add_planet=True, plot_dpi=300, flip=True)

    Final image

    Plots the target image after processing with the vortex coronagraph.

    Parameters:

      - charge (int) – Charge number (for vortex coronagraph).

      - add_planet (bool) – Whether to include planets in the plot.

      - rot_number (int) – Rotation number for creating the circular PSF.

      - plot_dpi (int) – Dots per inch (DPI) for the final plot.

      - flip (bool) – Whether to flip the y-axis of the plot.

    Returns:

      *_final.png

  plot_orbit(order=1, plot_dpi=300, res=1000, flip=True)

    Orbit plot

    Plot the orbit of a planet.

    Parameters:

      - order (int) – The order number of the planet, using self.list_planets() to look up the order.

      - plot_dpi (int) – Dots per inch (DPI) for the plot.

      - res (int) – Number of points used for orbit calculations.

      - flip (bool) – Whether to flip the y-axis of the plot.

    Returns:

      orbit_*.png

  plot_origin(plot_planets=True, res=1000, plot_dpi=300, boundary=True, flip=True)

    Plot original target

    Plot the original image with or without planets.

    Parameters:

      - plot_planets (bool) – Whether to plot planets or not.

      - res (int) – Number of points used for orbit calculations.

      - plot_dpi (int) – Dots per inch (DPI) for the plot.

      - boundary (bool) – Whether to show the boundary limits.

      - flip (bool) – Whether to flip the y-axis of the plot.

    Returns:

      origin_*.png