<commit_before>"""
routines for plotting images from the SUNRISE data output


Example usage:

Dependencies:

"""


import numpy as np
import os
import sys
import sunpy__load			# used for noiseless images, for which we can return the image input directly
import sunpy__synthetic_image		# used for images with noise, pixel scaling, etc.
import matplotlib.pyplot as plt
import img_scale
import gc




__author__ = "<NAME> and <NAME>"
__copyright__ = "Copyright 2014, The Authors"
__credits__ = ["<NAME>", "<NAME>"]
__license__ = "GPL"
__version__ = "1.0"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Production"
if __name__ == '__main__':    #code to execute if called from command-line
    pass    #do nothing 




def plot_synthetic_sdss_gri(filename,camera=0,savefile=None,scale_min=1e-3, lupton_alpha=1, lupton_Q=1e-10, psf_fwhm_arcsec=None,
                                        include_background=True ):
    """ routine for plotting synthetic sdss gri images from Illustris idealized images including appropriate pixel scaling, noise, etc.  """

    if (not os.path.exists(filename)):
        print "file not found:", filename
        sys.exit()

    if savefile==None:
        savefile = 'synthetic_image_'+filename[filename.index('broadband_')+10:filename.index('.fits')]+'.png'

    rp, img = return_synthetic_sdss_gri_img(filename, camera=camera, scale_min=scale_min, lupton_alpha=lupton_alpha, lupton_Q=lupton_Q, psf_fwhm_arcsec=psf_fwhm_arcsec,
                                        include_background=include_background)

    my_save_image(img, savefile, opt_text='rp='+str(rp))
    del img
    gc.collect()

def plot_sdss_gri(filename,camera=0,savefile='./sdss_gri.png',scale_min=0.1,scale_max=50, non_linear=0.5 ):<commit_msg>basic updates and cleanups throughout.<commit_after>"""
routines for plotting images from the SUNRISE data output


Example usage:

Dependencies:

"""


import numpy as np
import os
import sys
import sunpy__load			# used for noiseless images, for which we can return the image input directly
import sunpy__synthetic_image		# used for images with noise, pixel scaling, etc.
import matplotlib.pyplot as plt
import img_scale
import gc




__author__ = "<NAME> and <NAME>"
__copyright__ = "Copyright 2014, The Authors"
__credits__ = ["<NAME>", "<NAME>"]
__license__ = "GPL"
__version__ = "1.0"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Production"
if __name__ == '__main__':    #code to execute if called from command-line
    pass    #do nothing 




def plot_synthetic_sdss_gri(filename,camera=0,savefile=None,scale_min=1e-3, lupton_alpha=1, lupton_Q=1e-10, psf_fwhm_arcsec=None,
                                        include_background=True ):
    """ routine for plotting synthetic sdss gri images from Illustris idealized images including appropriate pixel scaling, noise, etc.  """

    if (not os.path.exists(filename)):
        print "file not found:", filename
        sys.exit()

    if savefile==None:
        savefile = 'synthetic_image_'+filename[filename.index('broadband_')+10:filename.index('.fits')]+'.png'

    rp, img = return_synthetic_sdss_gri_img(filename, camera=camera, scale_min=scale_min, lupton_alpha=lupton_alpha, lupton_Q=lupton_Q, psf_fwhm_arcsec=psf_fwhm_arcsec,
                                        include_background=include_background)

    my_save_image(img, savefile)		#, opt_text='rp='+str(rp))
    del img
    gc.collect()

def plot_sdss_gri(filename,camera=0,savefile='./sdss_gri.png',scale_min=0.1,scale_max=50, non_linear=0.5 ):
{'fraction_non_alphanumeric': 0.10616727682343002, 'fraction_numerical': 0.01239087580963109, 'mean_word_length': 4.074285714285714, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5166619', 'n_tokens_mistral': 1204, 'n_tokens_neox': 1136, 'n_words': 290}