like_lc.pl - V2.1 (May 11, 2021) - Robin Corbet Typing like_lc.pl -help will display this help information. Perl script that generates Fermi LAT light curves using likelihood analysis. This is not an official part of the Fermi analysis software. ** Note, from version 2.1 and later *binned* likelihood is used by default, while previously it was unbinned. It is possible to specify that unbinned analysis is used instead. Caution. The models and other parameters used here are for demonstration purposes. You should carefully evaluate the choice of parameters for your own particular needs! To use this script you must be set up to run both the Fermi science tools and HEASOFT. This script checks the environment variables LHEASOFT, PFILES, and FERMI_DIR as a check on this. In addition, if you are using the auto-generation option to automatically make a model file from the FGL catalog, the environment variable MY_FERMI_DIR needs to be set. This is where the FGL catalog and the $MODEL_MAKER.py script must be located if used. The model file generated by $MODEL_MAKER.py uses the parameters in the FGL catalog. In this example only the parameters of the source of interest are left free, others are held fixed at their catalog values. Among the inputs prompted for are two files: slist.dat This should contain a list of source names and their coordinates in the form: 4FGLJ0240.5+6113 4.0137901E+01 6.1228100E+01 i.e. the 4FGL catalog name must be given if you will use $MODEL_MAKER.py to generate the model file. Note that there is _no_ space in the source name. i.e. \"4FGLJ0240.5+6113\" rather than \"4FGL J0240.5+6113\" Source names should not be duplicated because the output files are constructed from the source names. Optionally, an entry in the slist.dat file my have the form: A_Source 40.1317, 61.2281 super_model.xml where the 4th entry is the name of the model file to use for that source. The source name (e.g. \"A_Source\") must be contained in the model file specified. plist.dat This contains a list of photon files, one file per line. It is also necessary to provide a single spacecraft (FT2) file. Several temporary files are created while running this script. At least most are deleted at the end. The output file for each source is an ASCII file called XXX_like_lc.dat, where \"XXX\" is the source name as given in slist.dat This file contains: time (bin center, MJD), flux (cts/cm^2/s), flux error, time bin half width (days), TS value, [spectral parameters/errors] The spectral parameters depend on the model used and are as taken directly from the gtlike output file. There will thus generally be a repetition of the TS value and the flux at the end of the line. Other values such as the \"ROI distance\" and \"Npred\" will also be included. ** The output format was changed in version 1.7 to enable any spectral model to be output. ** One difference is that generally the normalization and its error will be the first two parameters. ** Thus the columns are shifted by two entries compared to the output in previous versions. Other command line options: -start mjdstart The light curve will start at the specified time in units of MJD. -stop mjdstop The light curve will end at the specified time in units of MJD. -debug Increase chatter level to \"2\" from \"0\" -version Print version number of script then exit. -batch Runs with minimal output and no prompting for inputs. -makepar [filename] Generates a default parameter file with the name [filename]. If no name is given the file generated is like_lc.par -file [filename] Reads parameter values from a file with the name [filename]. -prefix [prefix] Defines a new default prefix for output file names. -unbinned Use unbinned likelihood analysis by default CHANGES: 2.1 Use either binned or unbinned likelihood, with binned as default, change prompt order 2.02 Filter on DATA_QUAL > 0 rather than DATA_QUAL==1 2.01 Catalog update to V27 2.0 Catalog update to V22, updated IRFs to P8R3_SOURCE_V3_v1 1.91 Updated default catalog to gll_psc_v20.fit 1.9 Defaults to 4FGL models, and updated galactic diffuse 1.8 P8R3 default data, FL8Y, and updated isotropic diffuse background (2018-02) 1.72 bug fixes for batch mode 1.71 Create and delete temporary PFILES directory to avoid collisions. 1.7 Output full set of parameters for any spectral model. Includes e.g. normalization which was missing before, along with Npred, ROI distance. 1.62 Added -prefix command line option 1.61 Updated help information, added -version option 1.6 Use latest version of make3FGLxml with backwards compatibility for XML files 1.5 Allow use of PASS8 data 1.47 Use 3FGL catalog as default 1.46 Allow reading from/writing to parameter file. 1.45 Include spectral output for log parabola and broken power law models. Make default maximum energy 300 GeV, allow optional prefix for output light curve name. 1.44 Command line options to specify start and stop times of light curve. Minor changes to avoid spurious error messages. 1.43 Support for updated background files for P7REP and use of \"CALDB\" for IRFs 1.42 Changed name of output xml files to decrease name collision possibility (2014 February) 1.41 Typo correction in prompts (October 2013). 1.4 Support for Pass 7 reprocessed data. (September 2013). 1.35 Change to checks on existence of environment variables. 1.34 Print time step at each loop iteration. 1.33 Changed (yet again) location of diffuse files. (2012 April). 1.32 Change to diffuse models used. 1.31 Bug fix for Pass 6 data. 1.3 Support for Pass 7 data (default) as well as Pass 6. Use 2FGL catalog and make2FGLxml.py. 1.2 Fix for bug causing mangled output if logParabola model was used 1.1 Support for selecting either P6_V3 or P6_V11 IRFs