Giter Club home page Giter Club logo

plot_fargo's Introduction

#------------------------------------------------------------------------------------------
#                                      PLOT_FARGO
#                A PYTHON PLOTTING CLASS TO VISUALIZE THE OUTPUT OF FARGO3D
#                                     A. D. SCHNEIDER
#                                         2018
#
# The class Plot_FARGO can be used for the visualisation of FARGO3D Output
#
# Capabilities:
# - simplified 2D ploting
# - creating of 2D plots using ffmpeg
#
# Design philosophy:
# The complexity and the possibilitys provided by Matplotlib is great. This code tries to shorten unnescessary things
# without loosing the possibilities of Matplotlib. Therefore after apllying the routines one can still access
# fig, ax to continue individual ploting.
#
# Dependancies:
# - Python 3
# - matplotlib, numpy
# - ffmpeg (if plot_2D_video is used)
# - the multiprocessing module of python might be used in future
#
# There is no guarante that these routines work in every case.
#
#
#
# Todo: parallelise plot_2D_video using multiprocessing
# Todo: make 3D Plots (maybe in future)
# Todo: spherical Plots (not nescescary for my work)

    ###############################
    # __init__
    ###############################
    # reads in the setup.par file to initialise the plotting
    #
    # arguments:
    # - (string) path_to_fargo:           absolute directory of fargo (without "/" at end)
    # - (string) setup:                   name of setup that is plotted.
    #                                     Needs to be identical (case-sensitive) to the setupname used in FARGO3D
    # - (string) setup_dir (optional):    if a different location for the setup files is used, take this directory
    #                                     instead. Nevertheless the directory still needs to be a subfolder of the
    #                                     fargo directory

    ###############################
    # set_clim
    ###############################
    # analogue to matplotlib.pyplot.set_clim, mainly needed for plot_2D_video
    #
    # arguments:
    # - (number) cm_min:         minimum value of the colormap
    # - (number) cm_max:         maximum value of the colormap

    ###############################
    # plot_2D
    ###############################
    # main Method that takes the output number and output type (gasdens, etc) and creates a 2D plot
    # plot_2D only works with cubic or cylindrical coordinates
    #
    # returns (if filename = ""):
    # - fig: returned figure
    # - ax:  returnes axes
    #
    # arguments:
    # - (number)        output_number:         number of the output being ploted
    # - (list of chars) direct (optional):     only needed in 3D! gives the direction in which the plot is done
    # - (number)        ax (optional):         only needed in 3D! gives the indicee in perpendicular directionat which
    #                                          the profile is ploted
    # - (string)        tp (optional):         tp specifys the variable that is ploted. by default this is the density
    #                                          important: tp needs to be the exact same as the relating filename
    # - (string)        filename (optional):   specifies the filename for saving the plot.
    # - (Bool)          log10 (optional):      set log10 = False to get a linear Plot
    # - (Bool)          polar (optional):      if true the returned figure is ploted in cylindrical coordinates

    ###############################
    # plot_2D_video (needs ffmpeg)
    ###############################
    # Method that creates a video of the output files using ffmpeg
    # Please note: this routine needs the subfolders "single_frames" and "videos"
    # Warning: needs time, CPU power und storage (for temporary pictures and video)
    #
    # arguments (see also plot_2D):
    # - (string) filename:              the filename of the created video (and its temporary files)
    # - (number) framesteps (optional): can be set >1 if one doesn't want to plot every picture
    # - (number) N (optional):          can be set, if the total number of outputs isn't the same as in setup.par

plot_fargo's People

Contributors

aarondavidschneider avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.