Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepy
import numpy as np

def run(xaxis, data, **kwargs):
	#generate random noise the same shape as the data
	noise = np.random.rand(*data.shape)
	#add it to the output dictionary
	script_outputs = {"data":noise}
	#also return the x-axis
	script_outputs["xaxis"] = xaxis
	return script_outputs

  

Take an image (with axes) and return an image (with axes)

 

Code Block
languagepy
import numpy as np

def run(xaxis,yaxis, data, **kwargs):
    #generate random noise the same shape as the data
    noise = np.random.rand(*data.shape)
    #add it to the output dictionary
    script_outputs = {"data":noise}
    #also return the x-axis
    script_outputs["xaxis"] = xaxis
	#and the y-axis
    script_outputs["yaxis"] = yaxis

    return script_outputs