Engineering API
AGEngAgileOffaxisVisibility
- class api.AGEngAgileOffaxisVisibility.AGEngAgileOffaxisVisibility(configurationFilePath)[source]
This class contains the high-level API methods you can use to run engineering analysis.
This class requires you to setup a
yaml configuration file
to specify the software’s behaviour.Class attributes:
- config
it is used to read/update configuration values.
- Type:
AgilepyConfig
- logger
it is used to log messages with different importance levels.
- Type:
AgilepyLogger
- __init__(configurationFilePath)[source]
AGEngAgileOffaxisVisibility constructor.
- Parameters:
configurationFilePath (str) – the relative or absolute path to the yaml configuration file.
Example
>>> from agilepy.api import AGEngAgileOffaxisVisibility >>> ageng = AGEngAgileOffaxisVisibility('agconfig.yaml')
- static getConfiguration(confFilePath, userName, outputDir, verboselvl)[source]
Utility method to create a configuration file.
- Parameters:
confFilePath (str) – the path and filename of the configuration file that is going to be created.
userName (str) – the username of who is running the software.
outputDir (str) – the path to the output directory. The output directory will be created using the following format: ‘userName_sourceName_todaydate’
verboselvl (int) – the verbosity level of the console output. Message types: level 0 => critical, warning, level 1 => critical, warning, info, level 2 => critical, warning, info, debug
- Returns:
None
- visibilityPlot(logfilesIndex, tmin, tmax, src_x, src_y, ref, zmax=60, step=1, writeFiles=True, computeHistogram=True, saveImage=True, fileFormat='png', title='Visibility Plot')[source]
It computes the angular separations between the center of the AGILE GRID field of view and the coordinates for a given position in the sky, given by src_ra and src_dec.
- Parameters:
logfilesIndex (str) – the index file for the logs files.
tmin (float) – inferior observation time limit to analize.
tmax (float) – superior observation time limit to analize.
src_x (float) – source position x (unit: degrees)
src_y (float) – source position y (unit: degrees)
zmax (float) – maximum zenith distance of the source to the center of the detector (unit: degrees)
step (integer) – time interval in seconds between 2 consecutive points in the resulting plot. Minimum accepted value: 0.1 s.
writeFiles (bool) – if True, two text files with the separions data will be written on file.
saveImage (bool) – If True, the image will be saved on disk
fileFormat (str) – The output format of the image
title (str) – The plot title
- Returns:
the angular separations ti_tt (List): tf_tt (List): ti_mjd (List): tf_mjd (List): skyCordsFK5.ra.deg skyCordsFK5.dec.deg
- Return type:
separations (List)
AGEngAgileFermiOffAxisVisibilityComparison
- class api.AGEngAgileFermiOffAxisVisibilityComparison.AGEngAgileFermiOffAxisVisibilityComparison(configurationFilePath)[source]
This class contains the high-level API methods to run offaxis and offaxis_ap_comparison tools. It’s a AGEng subclass
- __init__(configurationFilePath)[source]
AGEngAgileFermiOffAxisVisibilityComparison constructor.
- Parameters:
configurationFilePath (str) – the relative or absolute path to the yaml configuration file.
Example
>>> from agilepy.api.AGEngAgileFermiOffAxisVisibilityComparison import AGEngAgileFermiOffAxisVisibilityComparison >>> ageng = AGEngAgileFermiOffAxisVisibilityComparison('agconfig.yaml')
- visibilityPlot(time_windows, ra, dec, fermi_datapath, agile_datapath, run, zmax, mode=<built-in function all>, step=1)[source]
It runs offaxis tools and creates a directory containing the result files
- Parameters:
time_windws (2d float Array) – It contains the tstart-tstop intervals to process the data, the structure has developed as a 2d array(eg [[t1,t2],[t3, t4], …, [tn-1, tn]])
ra (float) – ra value
dec (float) – dec value
fermi_datapath (str) – fermi log filepath
agile_datapath (str) – agile log filepath
run (integer) – run number
zmax (float) – maximum offaxis degrees
mode (str) – options “agile” | “fermi” | “all”: Select all to plot both data, otherwise it will plot only agile/fermi data
step (float) – step value for plotting
- Returns:
A new directory containing the results
- Return type:
dir (str)
- apOffaxisComparation(agile_pathAP, fermi_pathAP, tstart_mjd, tstop_mjd, path_offaxis, vertical_boxes_mjd=[], zmax=60, timetype='MJD', data_column_name='cts', time_range=None, trigger_time_tt=None, add_rm=False, rm_files=None, rm_labels=None)[source]
It compares and shows aperture photometry data with offaxis results.
WARNING: This class should be instanced anew any time a new plot is generated, to ensure its correctness.
- Parameters:
agile_pathAP (str) – agile ap filepath
fermi_pathAP (str) – fermi ap filepath
tstart_mjd (float) – time start in MJD
tstop_mjd (float) – time stop in MJD
path_offaxis (str) – directory path to offaxis results
vertical_boxes_mjd (list) – time in MJD
zmax (float) – maximum offaxis degrees
timetype (str) – time type to plot [MJD, TT]
data_column_name (str) – name of column to plot
time_range (list) – time xrange in MJD or TT depending on “timetype”
trigger_time_tt (float or None) – trigger time in TT
add_rm (bool) – add fourth plot with AGILE ratemeters
rm_files (list) – list of absolute paths for all RM to plot
rm_lables (list) – list of labels to pair to RM files
- Returns:
void
- static getConfiguration(confFilePath, userName, outputDir, verboselvl)[source]
Utility method to create a configuration file.
- Parameters:
confFilePath (str) – the path and filename of the configuration file that is going to be created.
userName (str) – the username of who is running the software.
outputDir (str) – the path to the output directory. The output directory will be created using the following format: ‘userName_sourceName_todaydate’
verboselvl (int) – the verbosity level of the console output. Message types: level 0 => critical, warning, level 1 => critical, warning, info, level 2 => critical, warning, info, debug
- Returns:
None