\label{lst:component}
/**
* Copyright (C) 2012 Smithsonian Astrophysical Observatory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package cfa.vo.iris;
import java.util.List;
import org.astrogrid.samp.client.MessageHandler;
/**
*
* Interface implemented by Iris components. By implementing this interface the components
* allow the framework to retrieve the information needed to run and initialize them.
*
* @author olaurino
*/
public interface IrisComponent {
/**
* This method is invoked to initialize the component. If the component has to launch windows, frames or
* background services, this is the right method to do so. Otherwise the component will be called only if a callback
* is invoked.
*
* @param app A reference to the running application
* @param workspace A reference to the application's workspace
*/
void init(IrisApplication app, IWorkspace workspace);
/**
* Return the name of this component. This name might be listed in a widget along with the other registered components.
* @return The component's name as a String.
*/
String getName();
/**
* Get e description for this component. The description might be listed in a widget along with the other
* registered components.
*
* @return The component's description as a String.
*/
String getDescription();
/**
* Get a command line interface object for this component.
* @return A CLI object
*/
ICommandLineInterface getCli();
/**
* Initialize the Command Line Application interface
* @param app Reference to the enclosing application
*/
void initCli(IrisApplication app);
/**
* The component can contribute menu items and desktop buttons to the enclosing GUI applications
* by providing a list of MenuItems.
*
* @return A list of the menu items this component will contribute to the application.
*/
List<IMenuItem> getMenus();
/**
* The component can register any number of SAMP message listeners by providing a list of them.
*
* @return A list of the SAMP message listeners that have to be registered to the SAMP hub.
*/
List<MessageHandler> getSampHandlers();
/**
* Callback invoked when the component is shutdown
*/
void shutdown();
}
\label{lst:cli}
/**
* Copyright (C) 2012 Smithsonian Astrophysical Observatory
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package cfa.vo.iris;
/**
* A simple interface for providing CLI access in an extensible, pluggable way
* @author olaurino
*/
public interface ICommandLineInterface {
/**
* The name that has to be associated with the implementing component.
* When the calling application parses the command line, it will interpret the
* first argument as the component to which the command has to be relayed, using this string
* as a key.
*
* @return The compact name that identifies this CLI
*/
String getName();
/**
* Callback that gets called when a command line is parsed and associated to the implementing component.
*
* @param args The command line arguments.
*/
void call(String[] args);
}
\label{lst:user_model_example}
import numpy as np
def modified_blackbody(p, x):
"""
Modified blackbody of the form:
A * B_lambda(T) * (c / (lambda / lambda_0))**beta
Parameters
----------
p : [lambda_0, A, temp, beta]
p[0] 'lambda_0' : refernce wavelength
p[1] 'A' : amplitude of model at reference wavelength
p[2] 'temp' : temperature of blackbody
p[3] 'beta' : dust emissivity index
x : array
spectral values, in Angstroms
"""
# blackbody function, in terms of wavelength (in Angstroms)
c1 = 1.438786e8 # in AA K
efactor = c1 / p[2]
numerator = p[1] * np.power(p[0], 5.0) * (np.exp(efactor / p[0]) - 1.0)
denominator = np.power(x, 5.0) * (np.exp(efactor / x) - 1.0)
B_lambda = numerator / denominator
# speed of light in Angstroms/second
c = 2.998e18
powerlaw = (c / (x/p[0]))**p[3]
return B_lambda * powerlaw
\label{lst:templateconfig}
# INDEX REFER MODELFLAG FILENAME
0.0 5000 1 /home/user/iris-2.0.1-unix-x86_64/examples/sed_temp_index-0.00.dat
-0.10 5000 1 /home/user/iris-2.0.1-unix-x86_64/examples/sed_temp_index-0.10.dat
-0.25 5000 1 /home/user/iris-2.0.1-unix-x86_64/examples/sed_temp_index-0.25.dat
-0.35 5000 1 /home/user/iris-2.0.1-unix-x86_64/examples/sed_temp_index-0.35.dat
-0.50 5000 1 /home/user/iris-2.0.1-unix-x86_64/examples/sed_temp_index-0.50.dat