From 7ea90070870612e20a7d275b9e10e89a9139df8c Mon Sep 17 00:00:00 2001 From: knodlseder <> Date: Wed, 20 Jul 2011 21:19:12 +0000 Subject: [PATCH] updated for gammalib-00-04-10 --- ChangeLog | 2 +- NEWS | 54 +++++++++++++++++++++--------------------------------- README | 125 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------- doc/html/about.html | 12 ++++++++---- doc/html/documentation.html | 38 +++++++++++--------------------------- doc/html/doxygen.html | 44 ++++++++++++++------------------------------ doc/html/home.html | 12 +++++++++--- doc/html/installation.html | 259 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------------------------------------------------------------------------------- doc/html/quickstart.html | 163 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------- gammalib.pc.in | 2 +- 10 files changed, 432 insertions(+), 279 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5215cf0..f7fbcd5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2011-07-14 Juergen Knoedlseder +2011-07-20 Juergen Knoedlseder * Version 0.4.10 released ========================= diff --git a/NEWS b/NEWS index 00a0136..8b7233a 100644 --- a/NEWS +++ b/NEWS @@ -1,8 +1,8 @@ -New Features and Important Changes in GammaLib 00-04-09 +New Features and Important Changes in GammaLib 00-04-10 Author(s) : Juergen Knoedlseder -July 9th, 2011 +July 20, 2011 1. Introduction @@ -12,15 +12,22 @@ This document briefly summarizes module by module the most important changes mad 2. Configuration ----------------- -Remove pkg-config usage from configure.ac as this introduced somas -on Mac OS X systems (by default there is no pkg-config on Mac OS X). +The configuration script aborts now if no C++ compiler is found. -Add --enable-nan-check option and add option configuration information -to configuration summary screen dump. +pkg-config was reintroduced for finding the cfitsio library, but +it's only used if pkg-config is available. This may help to +increase the portability to various platforms, although problems +with incorrect pkg-config files have been encountered on some +distributions (OpenSUSE). -Test for presence of Python.h and build Python binding only if the -file exists. This should resolve installation issues on systems that -do not have the Python development package installed. +The configuration script now also handles fitsio.h headers found in +specific subdirectory (which is needed to compile on OpenSUSE and +Scientific Linux). + +Set the installation directory as the default runtime library +directory for Python. This solves a `make check' problem that occurred +on some distributions because it could not find the cfitsio +library that was installed in that location. 3. Application module @@ -40,17 +47,17 @@ None 6. Model module --------------- -Add NaN/Inf check to various spatial and spectral models. +None 7. Numerics module ------------------ -Add NaN/Inf check to GIntegral class. +None 8. Observation module --------------------- -Add NaN/Inf check to GResponse and GObservation class. +None 9. Optimization module @@ -60,20 +67,7 @@ None 10. Sky module -------------- -Replaced the IDL based World Coordinate System code by wcslib based code. -This improves performance and accuracy of the coordinate transformation -and corrects a bug in the LONPOLE/LATPOLE keywords that were written in -the earlier version into the FITS file. - -Introduced GWcslib base class for projections that are wcslib based. -All code adapted from wcslib goes into that class. Not all functionality -has yet been ported from wcslib to GammaLib, but the essential things -for creating, writing and reading WCS compliant FITS files is there. - -Introduced a World Coordinate System registry for easy extension of the -set of projections. - -Added the following projection types: AZP, STG, TAN +Use now GWcsRegistry for alloc_wcs(). 11. Support module @@ -98,10 +92,4 @@ None 15. CTA interface ----------------- -Added a simple offset angle dependence to the CTA response. The effective -area is assumed to vary following exp(-0.5*theta^4/sigma^2), where theta -is the offset angle of the photon arrival direction in the camera system -and sigma is a parameter that is set by default to 3.0 deg^2. No energy -dependence has been assumed in the offset angle variation. - -Add NaN/Inf check to various classes. +None diff --git a/README b/README index 40a737e..a081da5 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ GammaLib information ==================== -Version: 00-04-09 (July 8, 2011) +Version: 00-04-10 (July 20, 2011) Author: Juergen Knodlseder (knodlseder@cesr.fr) @@ -64,16 +64,17 @@ directory as a shared library by typing: GammaLib can also benefit from the presence of the readline library that provides line-editing and history capabilities for text input (GammaLib offers however also full functionality without having -readline installed). readline can be downloaded from -http://ftp.gnu.org/gnu/readline/ +readline installed). readline requires the ncurses library. Both +libraries can be downloaded from http://ftp.gnu.org/gnu/. -Unix Installation -================= -To build and install GammaLib, simply type the following: +Linux Installation +================== +To build, verify and install GammaLib, simply type the following: % ./configure % make + % make check % make install By default GammaLib installs itself in /usr/local/gamma. If you need to @@ -82,31 +83,61 @@ the --prefix option to ./configure. For example: % ./configure --prefix=/home/yourname/projects % make + % make check % make install The file INSTALL details more about using configure. Also try % ./configure --help. +The `make check' command will run an extensive unit test to verify that +GammaLib was correctly built. Make sure that all tests were successful. + Macintosh OS X Installation ============================ -GammaLib is known to work on various flavors of OS X. Follow the Unix +GammaLib is known to work on various flavors of OS X. Follow the +Linux installation instructions above. + + +BSD Installation +================ +GammaLib has been tested on FreeBSD successfully. Follow the Linux installation instructions above. Solaris Installation ==================== -GammaLib compiles on Solairs, but there is an issue with using it as a -shared library (see "Known problems" below). +GammaLib compiles on Solaris and openSolaris using the GNU compiler +collection. Follow the Linux installation instructions above. +GammaLib also compiles using the Sun Studio compiler, but due to +some unexpected handling of global variables, it is not fully +working (see "Known problems" below). +Please note that these is also a cfitsio problem on Solaris, please +refer to the section "Known problems" for more information. + + +Window Installation +=================== +There have been no efforts so far to compile GammaLib under Windows. Testing ======= -If you want to test GammaLib before installation, type the following: +After building and before installing GammaLib, you should run the +extensive unit test by typing: % make check +If everything works successfully you should see + + =================== + All 14 tests passed + =================== + +at the end of the test. If no Python support was compiled in, the +number of tests performed will be reduced by one. + Setting up your environment =========================== @@ -151,11 +182,17 @@ and inst/cat/test. Documentation ============= -The doc directory contains the most recent set of updated documentation -for this release. The documentation is available in PDF format. +The doc directory (usually at /usr/local/gamma/share/doc/gammalib) +contains the most recent set of updated documentation for this release. +A detailed documentation can be created using Doxygen by typing: + + % make doxygen + +before installing the library. Doxygen can be obtained from +http://www.stack.nl/~dimitri/doxygen/ This is a development release and the documentation is largely, but -not entirely up to date. We are working on it. Please be patient or +not entirely up to date. We are working on it. Please be patient or volunteer to help. @@ -167,13 +204,69 @@ https://sourceforge.net/tracker/?group_id=282143&atid=1196795. Known problems ============== +Python support + GammaLib comes with Python wrappers so that all classes can be + directly used from Python. To compile-in Python support, GammaLib + needs the Python.h header file, which on many distributions is not + installed by default. + To make Python.h available, install the Python developer package + in your distribution. Otherwise you will not be able to use GammaLib + from Python. + +Readline support + Many distributions do not have the readline header files and symbolic + link to the shared library set up by default. The same is true for the + ncurses library that is needed by readline. To properly compile-in + readline support in GammaLib, make sure that the redline header files + exist and that the symbolic links are set. In many distributions, + the shared redline and ncurses are located in /lib, while the symbolic + links are in /usr/lib. Make sure that you have symbolic links with + names + + libreadline.so + libncurses.so + + Symbolic links with an additional number attached, such as + libreadline.so.6 or libncurses.so.5 (which are found in many + distributions in the /lib directory) are not sufficient. + In many distributions, the appropriate headers and symbolic links + are installed if the proper readline and ncurses developer + packages are installed. + Solaris - Although GammaLib compiles on Solaris using the Sun compiler, there are + Although GammaLib builds on Solaris using the Sun compiler, there are problems with global symbols in the shared library that prevent the model registry to work correctly. Furthermore, GammaLib is not able to catch its own exceptions, which prevents the FITS interface to work - correctly. Possible it will work using gcc on Solaris, yet this has not - so far been tested. + correctly. + GammaLib has however been built and tested successfully using the GNU + compiler, and this is the only build method that is currently supported. + Problems have also been encountered when compiling cfitsio versions + more recent than 3.250. The problems have been reported to the cfitsio + developer team, and are likely to be solved in the future. For the + time being, it is recommended to use cfitsio version 3.250 on Solaris. + +OpenSolaris + On OpenSolaris, the same problems concerning the SunStudio compiler + occur as for Solaris, and also here, the GNU compiler is the recommended + tool to build GammaLib. Also here, cfitsio version 3.250 is the + recommended library as more recent version feature relocation + problems. GammaLib has been tested using gcc 4.3.2 on + OpenSolaris 2009.06. Make sure to create the symbolic links + + ln -s /usr/bin/gcc4.3.2 /usr/bin/gcc + ln -s /usr/bin/g++4.3.2 /usr/bin/g++ + + which are not there by default to avoid excess warnings during + compilation. + For OpenSolaris 2009.06, no readline package is available, hence + readline support is not readily available. Readline support can however + be enabled by directly installing the GNU ncurses and readline packages + from source (http://ftp.gnu.org/gnu). This has been done successfully + on OpenSolaris 2009.06 for ncurses-5.9 and readline-6.2. Make sure + to specify the `--with-shared' option when configuring ncurses, so + that the shared library will be built and installed. Otherwise, + relocation errors may occur during compilation of GammaLib. Contact diff --git a/doc/html/about.html b/doc/html/about.html index 6be809b..4fc1907 100644 --- a/doc/html/about.html +++ b/doc/html/about.html @@ -4,7 +4,6 @@ -

About

@@ -22,9 +21,9 @@ data analysis framework that enables simultaneous multi-mission analysis.


The -GammaLib project has been initiated by J. Knödlseder from the -Insitut de Recherche en Astrophysique et Planétologie -(IRAP), a mixed CNRS / Université Paul Sabatier laboratory +GammaLib project has been initiated by J. Knödlseder from the +Insitut de Recherche en Astrophysique et Planétologie +(IRAP), a mixed CNRS / Université Paul Sabatier laboratory in Toulouse, France.


As @@ -57,4 +56,9 @@ Source Lines of Code (SLOC)
+


+

Last updated by: Jürgen +Knödlseder 20 July +2011 +

\ No newline at end of file diff --git a/doc/html/documentation.html b/doc/html/documentation.html index fa178ea..d5b7ff2 100644 --- a/doc/html/documentation.html +++ b/doc/html/documentation.html @@ -1,35 +1,19 @@ - - + +Documentation - - - - - - - - - Documentation - + - - -

Documentation

- - -

GammaLib code documentation (generated by Doxygen) +

GammaLib code documentation +(generated by Doxygen)

- - -
- -
- - - - +
+

Last updated by: Jürgen +Knödlseder 20 July +2011 +

+ \ No newline at end of file diff --git a/doc/html/doxygen.html b/doc/html/doxygen.html index 13080c3..0f44b6e 100644 --- a/doc/html/doxygen.html +++ b/doc/html/doxygen.html @@ -1,53 +1,37 @@ - - - - - Doxygen - - - - - - - - - + +Doxygen + + + + - -

Doxygen

-

There seems to be no Doxygen documentation installed for GammaLib.

-
-

To install Doxygen documentation, make sure that Doxygen is installed on your system. If installed, then type the following in the GammaLib source directory:

-

> ./configure
- > make doxygen
- > make doxygen-install

-

Now the Doxygen documentation should be installed on your system. To -verify if this is indeed the case, simply reload this page (or wait for 30 seconds). +verify if this is indeed the case, simply reload this page (or wait for +30 seconds).

- -
-
- - - +
+

Last updated by: Jürgen +Knödlseder 20 July +2011 +

+ \ No newline at end of file diff --git a/doc/html/home.html b/doc/html/home.html index 722fee8..6951fd6 100644 --- a/doc/html/home.html +++ b/doc/html/home.html @@ -2,7 +2,8 @@ Home - + +

GammaLib

@@ -20,9 +21,14 @@ data analysis framework that enables simultaneous multi-mission analysis.


GammaLib -is free software distributed under the GNU GPL +is free software distributed under the GNU +GPL license version 3.


-
+
+

Last updated by: Jürgen +Knödlseder 20 July +2011 +

\ No newline at end of file diff --git a/doc/html/installation.html b/doc/html/installation.html index 072ac0e..8b7a874 100644 --- a/doc/html/installation.html +++ b/doc/html/installation.html @@ -1,143 +1,129 @@ - - - - - Installation - - - + +Installation + - -

Installation

-

Getting GammaLib
-

-

Prerequisites

-

Building GammaLib

-

Testing GammaLib

-

Installing GammaLib

-

Setting up your environment

-

Installing documentation

-

Known Problems

-

Getting Help

-
-

-Note: These installation instructions apply to -GammaLib-00-04-06 and -later. +Note: These installation instructions apply to gammalib-00-04-10 +and +later. gammalib-00-04-10 +has been built, installed and tested successfully on Debian, +Ubuntu, +Mandriva, OpenSUSE, Scientific Linux, CentOS, gentoo, Mac OS X, +FreeBSD, and OpenSolaris (using gcc), so hopefully it also installs on +your distribution. In case you encounter problems, please post a report +on the bug tracker on https://sourceforge.net/projects/gammalib/ +or send an e-mail to the +gammalib-users@lists.sourceforge.net +mailing list.

-
-
-

Getting GammaLib

-

The latest version of the GammaLib source code, documentation, and example programs are available on the World-Wide Web from https://sourceforge.net/projects/gammalib/.

-
-
-

Prerequisites

-

-GammaLib should compile on every modern Unix system without any need to -install other libraries. +GammaLib should compile on every modern Unix system without any need to +install other libraries. To enable support for FITS file handling, +however, the cfitsio +library +from HEASARC needs to be installed. cfitsio +exists on many distributions as a prebuilt library, so in general you +can +directly install it using your package manager. Make sure that you +install the library and the development package, as the cfitsio header +file (which usually comes in the development package) is needed to +compiling GammaLib.


- -
- -To enable support for FITS file handling, however, the cfitsio library -from HEASARC needs to be installed. cfitsio can be downloaded from +

If +cfitsio is not available as a prebuilt package, or if you encounter +some +problems with the prebuilt package, cfitsio can be downloaded from http://heasarc.gsfc.nasa.gov/fitsio -and detailed installation instructions can be found there. -If cfitsio does not already exist on your system, we recommend -installation of cfitsio -in the default GammaLib install directory as a shared library by +and be installed from the source (for details, please refer to the +installation +instructions on the +HESEARC +site). +We recommend installation of cfitsio in the default GammaLib install +directory as a shared library by typing:

-

> ./configure --prefix=/usr/local/gamma
- > make shared
- > make install

-

GammaLib can also benefit from the presence of the readline library that provides line-editing and history capabilities for text input (GammaLib offers however also full functionality without having readline installed). -readline can be downloaded from -http://ftp.gnu.org/gnu/readline/ +readline (which depends on ncurses) is available on most system as a +prebuilt library, so also here we recommend to use your package manager +to install the libraries. Also here, the readline (and ncurses) +development packages are required, so that the header files become +available and the symbolic links are set correctly.

+

+

If +readline and ncurses are not available as a prebuilt package, or if you +encounter some problems with the prebuilt packages, both libraries can +be downloaded from http://ftp.gnu.org/gnu/.

-
-
-

Building GammaLib

-

Download the latest source tarball, save it in an appropriate location, and type

-

> tar xvfz GammaLib-XX-XX-XX.tar.gz

-

where XX-XX-XX is the version number of the library. Step in the created directory using

-

-> cd GammaLib-XX-XX-XX +> cd gammalib-XX-XX-XX

-

and build GammaLib by typing

-

> ./configure
- > make

-

at the operating system prompt. The configuration command customizes the Makefiles for the particular @@ -161,11 +147,9 @@ argument should be given, for example:

-

> ./configure --prefix=/usr/local

-

If cfitsio and/or readline is not installed in a standard location for libraries (such @@ -175,45 +159,32 @@ the appropriate location(s) can be specified using the CPPFLAGS (for the include directory) options:

-

> ./configure LDFLAGS='-L/opt/local/lib' CPPFLAGS='-I/opt/local/include'

-

A full list of configuration options can be found using

-

> ./configure --help

-
-
-

Testing GammaLib

-

GammaLib should be tested by typing:

-

> make check

-

This will execute an extensive testing suite that should terminate with

-

===================
- All 14 tests passed
- ===================

-

Eventually, loading the shared cfitsio and/or readline libraries may fail during the test if the libraries are not located in standard locations. In @@ -221,48 +192,34 @@ this case, add the library directories to the DYLD_LIBRARY_PATH on Mac OS X), e.g.

-

export LD_LIBRARY_PATH=/opt/local/lib:$LD_LIBRARY_PATH

-

or

-

setenv LD_LIBRARY_PATH /opt/local/lib:$LD_LIBRARY_PATH

-

on C shell variants.

-
-
-

Installing GammaLib

-

Install GammaLib by typing

-

> make install

-

at the operating system prompt.

-
-
-

Setting up your environment

-

Before using GammaLib you have to setup some environment variables. This will be done automatically by an initialisation script that will @@ -270,44 +227,33 @@ be installed in the bi directory. Assuming that you have installed GammaLib in the default directory /usr/local/gamma -you need to add the following to your .bashrc +you need to add the following to your $HOME/.bashrc or $HOME/.profile script on a Linux machine:

-

export GAMMALIB=/usr/local/gamma
- source $GAMMALIB/bin/gammalib-init.sh

-

If you use C shell or a variant then add the following to your -.cshrc -or .tcshrc +$HOME/.cshrc +or $HOME/.tcshrc script:

-

setenv GAMMALIB /usr/local/gamma
- source $GAMMALIB/bin/gammalib-init.csh

-
-
-

Installing documentation

-

The GammaLib web pages are shipped together with the source code and will be installed in the directory $(prefix)/share/doc/gammalib/html, where $(prefix) is the installation base path, by default /usr/local/gamma.

-
-

For developers, a more detailed documentation can be built from the source code using Doxygen. Doxygen will scan the source files for code @@ -318,73 +264,110 @@ command. If you have not installed Doxygen on your machine, but you need the development documentation, please visit http://www.stack.nl/~dimitri/doxygen/index.html to download and install the Doxygen package.

-
-

Once Doxygen is install, type the following to build and to install the Doxygen documentation:

-

> ./configure
- > make doxygen
- > make doxygen-install

-

The Doxygen documentation will be installed into $(prefix)/share/doc/gammalib/html/doxygen and can be browsed using a regular web browser.

-
-

To check man support, type for example

-

> man GObservations

-

and you should see the documentation for the GObservations C++ class.

-
-
-

Known Problems

-

-Solaris +Python +support
- -GammaLib has been compiled successfully on Solaris 2.10 using the Sun -Studio compiler. However, when linked as a shared library, symbols are -not globally exported. This prevents the GammaLib library from catching -its own exceptions and from registering models. Consequently, many unit -tests will fail. +GammaLib comes with Python wrappers so that all classes can be +directly used from Python. To compile-in Python support, GammaLib +needs the Python.h +header file, which on many distributions is not +installed by default. +To make Python.h +available, install the Python developer package +in your distribution using the package manager. Otherwise you will not +be able to use GammaLib +from Python. +


- +

+Mac OS X
- -Using gcc (version 3.4.3), GammaLib works correctly on Solaris 2.10, -yet loading GammaLib as a Python module fails. +The Python development package is not installed as default on Mac +OS X, and consequently, the Python.h +header file is missing that is +needed to compile in the Python bindings. The configure +script recognises this fact and adjust the build procedure accordingly, +but you +will not be able to use GammaLib from Python. So better install the +Python development package before installing GammaLib (see +above).

+

It +was also reported that adding of export +MACOSX_DEPLOYMENT_TARGET=10.6 to the $HOME/.bashrc +file was necessary one +some Mac OS X 10.6 installations to make GammaLib compile.
+

+
+

Solaris +
+Although GammaLib builds on Solaris using the Sun compiler, +there are +problems with global symbols in shared libraries and exception +catching, which prevents the FITS interface to work +correctly. GammaLib has however been built and tested +successfully +using the GNU +compiler, and this is the only build method that is currently +supported. +Problems have also been encountered when compiling cfitsio versions +more recent than 3.250. The problems have been reported to the cfitsio +developer team, and are likely to be solved in the future. For the +time being, it is recommended to use cfitsio version 3.250 on Solaris. +

+
+

OpenSolaris +
+On OpenSolaris, the same problems concerning the SunStudio compiler +occur as for Solaris, and also here, the GNU compiler is the +recommended +tool to build GammaLib. Also here, cfitsio version 3.250 is +the +recommended library as more recent version feature relocation +problems. GammaLib has been tested using gcc 4.3.2 on +OpenSolaris +2009.06. Make sure to create the symbolic links +

+

ln -s /usr/bin/gcc4.3.2 /usr/bin/gcc
+ln -s /usr/bin/g++4.3.2 /usr/bin/g++

+

+which are not there by default to avoid excess warnings during +compilation.

-
-

Getting Help

-

Any questions, bug reports, or suggested enhancements related to GammaLib should be submitted @@ -393,6 +376,10 @@ or the gammalib-users@lists.sourceforge.net mailing list.

- - - +
+
+

Last updated by: Jürgen +Knödlseder 20 July +2011 +

+ \ No newline at end of file diff --git a/doc/html/quickstart.html b/doc/html/quickstart.html index 8c92f42..bc4c045 100644 --- a/doc/html/quickstart.html +++ b/doc/html/quickstart.html @@ -1,54 +1,157 @@ - - - - - Getting Started - - - + +Getting Started + - -

Getting started

-

First steps with GammaLib
- Getting Help

-
-

First steps with GammaLib

-

GammaLib -comes with a Python interface, and as first step you should verify that the +comes with a Python interface, and as first step you should verify that +the Python interfaces workes correctly. You do this by typing:

-

> python
- >>> from gammalib import *
- >>>

- -

If everything works fine you should just get a new Python prompt after importing GammaLib. +

If +everything works fine you should just get a new Python prompt after +importing GammaLib. If you get an error message, make sure that you've +setup correctly the GammaLib environment. You basically need the PYTHONPATH +variable set to GammaLib's Python site-package, and you also have to +make sure that GammaLib and any dependent library (cfitsio, readline, +ncurses) is in the library load path (eventually you may need to adjust +LD_LIBRARY_PATH). +This is all done automatically if you set up the environment as +described here.

+
+

Now +try:

- +

>>> models=GModels()
+>>> print models
+=== GModels ===
+Number of models ..........: 0
+Number of parameters ......: 0
+>>> +

+

You +just alloacted +your first GammaLib object, which is an empty model container.


- +

Now +let's append a model to this container. For this, type: +

+

>>> pos = GSkyDir()
+>>> pos.radec_deg(83.6331, 22.0145)
+>>> spatial = GModelSpatialPtsrc(pos)
+>>> spectral = GModelSpectralPlaw(1.0, -2.0)
+>>> model = GModelPointSource(spatial, spectral)
+>>> models.append(model)
+>>> print models
+=== GModels ===
+Number of models ..........: 1
+Number of parameters ......: 6
+=== GModelPointSource ===
+Name ......................:
+Instruments ...............: all
+Model type ................: "SkyDirFunction" * "PowerLaw" * "Constant"
+Number of parameters ......: 6
+Number of spatial par's ...: 2
+ RA .......................: 83.6331 deg (fixed,scale=1)
+ DEC ......................: 22.0145 deg (fixed,scale=1)
+Number of spectral par's ..: 3
+ Prefactor ................: 1 +/- 0 [0,infty[ ph/cm2/s/MeV +(free,scale=1,gradient)
+ Index ....................: -2 +/- 0 [-10,10] +(free,scale=1,gradient)
+ PivotEnergy ..............: 100 MeV (fixed,scale=1,gradient)
+Number of temporal par's ..: 1
+ Constant .................: 1 (relative value) +(fixed,scale=1,gradient)
+>>> +

+

With +this +sequence of commands you first defined a sky direction in celestial +coordinates using GSkyDir. +You may easily recognise that this is the position of the Crab. You +then used this position to define the spatial component of a sky model +using GModelSpatialPtsrc. +As the name suggests, the spatial component is a point source. Next, +you defined the spectral component using GModelSpactralPlaw: +a power law with normalisation of 1 and index of -2. Then, you combined +the spatial and spectral components in a point source model using GModelPointSource. +And finally you appended the point source to the model container +allocated previously using the append +method. When you then print the model container you see that is +contains now one model with 6 parameters. Among them, you find the +specified source position (parameters RA +and DEC), +the power law normalisation (parameter Prefactor) +and the spectral index (parameter Index). +In addition, the reference energy for the normalisation has been set +automatically to 100 MeV (parameter PivotEnergy) +and the temporal component has been set by default to a constant +(parameter Constant).

+
+

Suppose +you want +to change one of these parameters, such as the PivotEnergy +that you want +to set to 1 TeV. This can be done using:

+

>>> +models[0]['PivotEnergy'].value(1.0e6)
+>>> print models
+...
+ PivotEnergy ..............: 1e+06 MeV (fixed,scale=1,gradient)
+...
+

+

As +the units are MeV, we had to specify a value of 1e6 to set the +reference energy to 1 TeV. We did this by accessing the first model in +the container using models[0] +(counting in GammaLib always starts from 0). Then we addressed the PivotEnergy +parameter by specifying ['PivotEnergy']. +And finally we called the value +method that sets the value of a particular parameter.

+
+

After +all this +hard work, you may save your model into a XML file by typing:

+

>>> +models.save('test.xml')
+>>>
+

+

and +you +can load it from an XML file in memory using

+

>>> +newmodels=GModels('test.xml')
+>>> print newmodels
+

+

The +last +print command is to convince yourself that the models have been +loaded properly.

+
+

Much +more is still to come. Please be a little bit patient, I'm working on +it. In the meantime you may check the Doxygen +documentation to see what classes and methods are available.


-

Getting Help

-

Any questions, bug reports, or suggested enhancements related to GammaLib should be submitted @@ -57,6 +160,10 @@ or the gammalib-users@lists.sourceforge.net mailing list.

- - - +
+
+

Last updated by: Jürgen +Knödlseder 20 July +2011 +

+ \ No newline at end of file diff --git a/gammalib.pc.in b/gammalib.pc.in index ef69ffb..8e517ad 100644 --- a/gammalib.pc.in +++ b/gammalib.pc.in @@ -6,7 +6,7 @@ includedir=${prefix}/include Name: GammaLib Description: Versatile toolbox for analysis of astronomical gamma-ray data URL: http://gammalib.sourceforge.net/ -Version: 0.4.9 +Version: 0.4.10 Requires: Requires.private: @CFITSIO@ Conflicts: -- libgit2 0.21.4