Commit 01e297cddb59fea07466fcaa53fda76fc01876c1

Authored by Christoph Deil
1 parent 808c9fdd

Rename `center` to `centre` everywhere.

(I chose `centre` because there were more `centre` than `center`
around.)
doc/source/user_manual/glossary.rst
@@ -21,7 +21,7 @@ Glossary @@ -21,7 +21,7 @@ Glossary
21 21
22 - **HEASARC** (`<http://heasarc.gsfc.nasa.gov/>`_) 22 - **HEASARC** (`<http://heasarc.gsfc.nasa.gov/>`_)
23 23
24 - High Energy Astrophysics Science Archive Research Center. 24 + High Energy Astrophysics Science Archive Research Centre.
25 25
26 - **Python** (`<http://www.python.org/>`_) 26 - **Python** (`<http://www.python.org/>`_)
27 27
doc/source/user_manual/modules/support.rst
@@ -211,7 +211,7 @@ Function Description @@ -211,7 +211,7 @@ Function Description
211 ``gammalib::fill`` Fill string with a number of replications of a string. 211 ``gammalib::fill`` Fill string with a number of replications of a string.
212 ``gammalib::left`` Left justify string to achieve a given length of characters. 212 ``gammalib::left`` Left justify string to achieve a given length of characters.
213 ``gammalib::right`` Right justify string to achieve a given length of characters. 213 ``gammalib::right`` Right justify string to achieve a given length of characters.
214 -``gammalib::center`` Center string to achieve a given length of characters. 214 +``gammalib::centre`` Centre string to achieve a given length of characters.
215 ``gammalib::parformat`` Format string for parameter value display. 215 ``gammalib::parformat`` Format string for parameter value display.
216 ``gammalib::plaw_photon_flux`` Compute photon flux under a power law. 216 ``gammalib::plaw_photon_flux`` Compute photon flux under a power law.
217 ``gammalib::plaw_energy_flux`` Compute energy flux under a power law. 217 ``gammalib::plaw_energy_flux`` Compute energy flux under a power law.
include/GTools.hpp
@@ -76,7 +76,7 @@ namespace gammalib { @@ -76,7 +76,7 @@ namespace gammalib {
76 const char& c = ' '); 76 const char& c = ' ');
77 std::string right(const std::string& s, const int& n, 77 std::string right(const std::string& s, const int& n,
78 const char& c = ' '); 78 const char& c = ' ');
79 - std::string center(const std::string& s, const int& n, 79 + std::string centre(const std::string& s, const int& n,
80 const char& c = ' '); 80 const char& c = ' ');
81 std::string parformat(const std::string& s, const int& indent = 0); 81 std::string parformat(const std::string& s, const int& indent = 0);
82 double plaw_photon_flux(const double& emin, 82 double plaw_photon_flux(const double& emin,
inst/cta/src/GCTAModelBackground.cpp
@@ -1196,7 +1196,7 @@ GModelTemporal* GCTAModelBackground::xml_temporal(const GXmlElement&amp; temporal) c @@ -1196,7 +1196,7 @@ GModelTemporal* GCTAModelBackground::xml_temporal(const GXmlElement&amp; temporal) c
1196 /***********************************************************************//** 1196 /***********************************************************************//**
1197 * @brief Kernel for zenith angle Npred integration of background model 1197 * @brief Kernel for zenith angle Npred integration of background model
1198 * 1198 *
1199 - * @param[in] theta Offset angle from ROI center (radians). 1199 + * @param[in] theta Offset angle from ROI centre (radians).
1200 * 1200 *
1201 * Computes 1201 * Computes
1202 * 1202 *
inst/cta/test/test_CTA.cpp
@@ -362,7 +362,7 @@ void TestGCTAResponse::test_response_irf_diffuse(void) @@ -362,7 +362,7 @@ void TestGCTAResponse::test_response_irf_diffuse(void)
362 GEnergy emax(100.0, "TeV"); 362 GEnergy emax(100.0, "TeV");
363 GEbounds ebounds(nebins, emin, emax); 363 GEbounds ebounds(nebins, emin, emax);
364 364
365 - // Setup event cube centered on Cen A 365 + // Setup event cube centreed on Cen A
366 GCTAEventCube cube(map, ebounds, gti); 366 GCTAEventCube cube(map, ebounds, gti);
367 367
368 // Setup dummy CTA observation 368 // Setup dummy CTA observation
@@ -515,7 +515,7 @@ void TestGCTAModelBackground::test_modelbg_npred(void) @@ -515,7 +515,7 @@ void TestGCTAModelBackground::test_modelbg_npred(void)
515 const GModelSpectralPlaw* spec = dynamic_cast<const GModelSpectralPlaw*>(bck->spectral()); 515 const GModelSpectralPlaw* spec = dynamic_cast<const GModelSpectralPlaw*>(bck->spectral());
516 const GModelSpatialRadialGauss* spat = dynamic_cast<const GModelSpatialRadialGauss*>(bck->spatial()); 516 const GModelSpatialRadialGauss* spat = dynamic_cast<const GModelSpatialRadialGauss*>(bck->spatial());
517 517
518 - // Get Integration center for ROI position 518 + // Get Integration centre for ROI position
519 double src_ra = spat->ra(); 519 double src_ra = spat->ra();
520 double src_dec = spat->dec(); 520 double src_dec = spat->dec();
521 double sigma = spat->sigma(); 521 double sigma = spat->sigma();
inst/cta/test/test_irf_offset.py
@@ -57,11 +57,11 @@ def shell_model(ra=0.3, dec=0.3, radius=0.3, width=0.1): @@ -57,11 +57,11 @@ def shell_model(ra=0.3, dec=0.3, radius=0.3, width=0.1):
57 Set shell model. 57 Set shell model.
58 """ 58 """
59 # Set shell centre 59 # Set shell centre
60 - center = GSkyDir()  
61 - center.radec_deg(ra, dec) 60 + centre = GSkyDir()
  61 + centre.radec_deg(ra, dec)
62 62
63 # Set radial model 63 # Set radial model
64 - radial = GModelRadialShell(center, radius, width, False) 64 + radial = GModelRadialShell(centre, radius, width, False)
65 65
66 # Set spectral model 66 # Set spectral model
67 spectral = GModelSpectralPlaw(1.0, -2.0) 67 spectral = GModelSpectralPlaw(1.0, -2.0)
@@ -81,11 +81,11 @@ def disk_model(ra=359.6, dec=-0.2, radius=0.4): @@ -81,11 +81,11 @@ def disk_model(ra=359.6, dec=-0.2, radius=0.4):
81 Set disk model. 81 Set disk model.
82 """ 82 """
83 # Set disk centre 83 # Set disk centre
84 - center = GSkyDir()  
85 - center.radec_deg(ra, dec) 84 + centre = GSkyDir()
  85 + centre.radec_deg(ra, dec)
86 86
87 # Set radial model 87 # Set radial model
88 - radial = GModelRadialDisk(center, radius) 88 + radial = GModelRadialDisk(centre, radius)
89 89
90 # Set spectral model 90 # Set spectral model
91 spectral = GModelSpectralPlaw(1.0, -2.0) 91 spectral = GModelSpectralPlaw(1.0, -2.0)
@@ -105,11 +105,11 @@ def gauss_model(ra=359.6, dec=+0.1, sigma=0.2): @@ -105,11 +105,11 @@ def gauss_model(ra=359.6, dec=+0.1, sigma=0.2):
105 Set Gaussian model. 105 Set Gaussian model.
106 """ 106 """
107 # Set Gaussian centre 107 # Set Gaussian centre
108 - center = GSkyDir()  
109 - center.radec_deg(ra, dec) 108 + centre = GSkyDir()
  109 + centre.radec_deg(ra, dec)
110 110
111 # Set radial model 111 # Set radial model
112 - radial = GModelRadialGauss(center, sigma) 112 + radial = GModelRadialGauss(centre, sigma)
113 113
114 # Set spectral model 114 # Set spectral model
115 spectral = GModelSpectralPlaw(1.0, -2.0) 115 spectral = GModelSpectralPlaw(1.0, -2.0)
inst/cta/test/test_model.py
@@ -53,11 +53,11 @@ def shell_model(ra=0.3, dec=0.3, radius=0.3, width=0.1): @@ -53,11 +53,11 @@ def shell_model(ra=0.3, dec=0.3, radius=0.3, width=0.1):
53 Set shell model. 53 Set shell model.
54 """ 54 """
55 # Set shell centre 55 # Set shell centre
56 - center = GSkyDir()  
57 - center.radec_deg(ra, dec) 56 + centre = GSkyDir()
  57 + centre.radec_deg(ra, dec)
58 58
59 # Set radial model 59 # Set radial model
60 - radial = GModelSpatialRadialShell(center, radius, width, False) 60 + radial = GModelSpatialRadialShell(centre, radius, width, False)
61 61
62 # Set spectral model 62 # Set spectral model
63 spectral = GModelSpectralPlaw(1.0, -2.0, GEnergy(100.0, "MeV")) 63 spectral = GModelSpectralPlaw(1.0, -2.0, GEnergy(100.0, "MeV"))
@@ -77,11 +77,11 @@ def disk_model(ra=359.6, dec=-0.2, radius=0.4): @@ -77,11 +77,11 @@ def disk_model(ra=359.6, dec=-0.2, radius=0.4):
77 Set disk model. 77 Set disk model.
78 """ 78 """
79 # Set disk centre 79 # Set disk centre
80 - center = GSkyDir()  
81 - center.radec_deg(ra, dec) 80 + centre = GSkyDir()
  81 + centre.radec_deg(ra, dec)
82 82
83 # Set radial model 83 # Set radial model
84 - radial = GModelSpatialRadialDisk(center, radius) 84 + radial = GModelSpatialRadialDisk(centre, radius)
85 85
86 # Set spectral model 86 # Set spectral model
87 spectral = GModelSpectralPlaw(1.0, -2.0, GEnergy(100.0, "MeV")) 87 spectral = GModelSpectralPlaw(1.0, -2.0, GEnergy(100.0, "MeV"))
@@ -101,11 +101,11 @@ def gauss_model(ra=359.6, dec=+0.1, sigma=0.2): @@ -101,11 +101,11 @@ def gauss_model(ra=359.6, dec=+0.1, sigma=0.2):
101 Set Gaussian model. 101 Set Gaussian model.
102 """ 102 """
103 # Set Gaussian centre 103 # Set Gaussian centre
104 - center = GSkyDir()  
105 - center.radec_deg(ra, dec) 104 + centre = GSkyDir()
  105 + centre.radec_deg(ra, dec)
106 106
107 # Set radial model 107 # Set radial model
108 - radial = GModelSpatialRadialGauss(center, sigma) 108 + radial = GModelSpatialRadialGauss(centre, sigma)
109 109
110 # Set spectral model 110 # Set spectral model
111 spectral = GModelSpectralPlaw(1.0, -2.0, GEnergy(100.0, "MeV")) 111 spectral = GModelSpectralPlaw(1.0, -2.0, GEnergy(100.0, "MeV"))
pyext/GLog.i
@@ -111,7 +111,7 @@ public: @@ -111,7 +111,7 @@ public:
111 void right(const std::string& arg, const int& n) { 111 void right(const std::string& arg, const int& n) {
112 (*self) << gammalib::right(arg, n); 112 (*self) << gammalib::right(arg, n);
113 } 113 }
114 - void center(const std::string& arg, const int& n) {  
115 - (*self) << gammalib::center(arg, n); 114 + void centre(const std::string& arg, const int& n) {
  115 + (*self) << gammalib::centre(arg, n);
116 } 116 }
117 } 117 }
pyext/GTools.i
@@ -72,7 +72,7 @@ namespace gammalib { @@ -72,7 +72,7 @@ namespace gammalib {
72 std::string fill(const std::string& s, int n); 72 std::string fill(const std::string& s, int n);
73 std::string left(const std::string& s, int n, char c = ' '); 73 std::string left(const std::string& s, int n, char c = ' ');
74 std::string right(const std::string& s, int n, char c = ' '); 74 std::string right(const std::string& s, int n, char c = ' ');
75 - std::string center(const std::string& s, int n, char c = ' '); 75 + std::string centre(const std::string& s, int n, char c = ' ');
76 std::string parformat(const std::string& s, const int& indent = 0); 76 std::string parformat(const std::string& s, const int& indent = 0);
77 double plaw_photon_flux(const double& emin, 77 double plaw_photon_flux(const double& emin,
78 const double& emax, 78 const double& emax,
src/app/GApplication.cpp
@@ -425,7 +425,7 @@ void GApplication::log_header(void) @@ -425,7 +425,7 @@ void GApplication::log_header(void)
425 425
426 // Dump header 426 // Dump header
427 log << gammalib::fill("*", header_width) << std::endl; 427 log << gammalib::fill("*", header_width) << std::endl;
428 - log << "*" << gammalib::center(m_name, header_width-2) << "*" << std::endl; 428 + log << "*" << gammalib::centre(m_name, header_width-2) << "*" << std::endl;
429 log << "* " << gammalib::fill("-", header_width-4) << " *" << std::endl; 429 log << "* " << gammalib::fill("-", header_width-4) << " *" << std::endl;
430 log << "* Version: " << gammalib::left(m_version, header_width-12) << "*" << std::endl; 430 log << "* Version: " << gammalib::left(m_version, header_width-12) << "*" << std::endl;
431 log << gammalib::fill("*", header_width) << std::endl; 431 log << gammalib::fill("*", header_width) << std::endl;
src/sky/GSkyRegionCircle.cpp
@@ -471,7 +471,7 @@ bool GSkyRegionCircle::contains(const GSkyRegion&amp; reg) const @@ -471,7 +471,7 @@ bool GSkyRegionCircle::contains(const GSkyRegion&amp; reg) const
471 const GSkyRegionCircle* regcirc = 471 const GSkyRegionCircle* regcirc =
472 dynamic_cast<const GSkyRegionCircle*>(&reg); 472 dynamic_cast<const GSkyRegionCircle*>(&reg);
473 473
474 - // Calculate angular distance between the centers 474 + // Calculate angular distance between the centres
475 double ang_dist = m_centre.dist_deg(regcirc->centre()); 475 double ang_dist = m_centre.dist_deg(regcirc->centre());
476 476
477 // Check if the region is contained in this 477 // Check if the region is contained in this
@@ -512,7 +512,7 @@ bool GSkyRegionCircle::overlaps(const GSkyRegion&amp; reg) const @@ -512,7 +512,7 @@ bool GSkyRegionCircle::overlaps(const GSkyRegion&amp; reg) const
512 const GSkyRegionCircle* regcirc = 512 const GSkyRegionCircle* regcirc =
513 dynamic_cast<const GSkyRegionCircle*>(&reg); 513 dynamic_cast<const GSkyRegionCircle*>(&reg);
514 514
515 - // Calculate angular distance between the centers 515 + // Calculate angular distance between the centres
516 double ang_dist = m_centre.dist_deg(regcirc->centre()); 516 double ang_dist = m_centre.dist_deg(regcirc->centre());
517 517
518 // Check if the distance is smaller than the sum of both radii 518 // Check if the distance is smaller than the sum of both radii
src/support/GTools.cpp
@@ -660,16 +660,16 @@ std::string gammalib::right(const std::string&amp; s, const int&amp; n, const char&amp; c) @@ -660,16 +660,16 @@ std::string gammalib::right(const std::string&amp; s, const int&amp; n, const char&amp; c)
660 660
661 661
662 /***********************************************************************//** 662 /***********************************************************************//**
663 - * @brief Center string to achieve a length of n characters 663 + * @brief Centre string to achieve a length of n characters
664 * 664 *
665 * @param[in] s String to be centred. 665 * @param[in] s String to be centred.
666 * @param[in] n Requested total width. 666 * @param[in] n Requested total width.
667 * @param[in] c Left fill character. 667 * @param[in] c Left fill character.
668 * 668 *
669 - * Center string by adding whitespace to the left and the right to achieve a 669 + * Centre string by adding whitespace to the left and the right to achieve a
670 * length of n characters. 670 * length of n characters.
671 ***************************************************************************/ 671 ***************************************************************************/
672 -std::string gammalib::center(const std::string& s, const int& n, const char& c) 672 +std::string gammalib::centre(const std::string& s, const int& n, const char& c)
673 { 673 {
674 // Compute number of characters to fill left and right 674 // Compute number of characters to fill left and right
675 int n_right = (n-s.length()) / 2; 675 int n_right = (n-s.length()) / 2;
test/example_model_xml_io.py
@@ -24,15 +24,15 @@ from gammalib import * @@ -24,15 +24,15 @@ from gammalib import *
24 # Set the location / centre of the source model to 24 # Set the location / centre of the source model to
25 # Right Ascension = 42.0 deg and Declination = 43 deg 25 # Right Ascension = 42.0 deg and Declination = 43 deg
26 # =================================================== 26 # ===================================================
27 -center = GSkyDir()  
28 -center.radec_deg(42.0, 43.0) 27 +centre = GSkyDir()
  28 +centre.radec_deg(42.0, 43.0)
29 29
30 # 30 #
31 # Create a point source with power law spectral shape 31 # Create a point source with power law spectral shape
32 # Normalization: 1.0e-7 ph/cm2/s/MeV @ 100 MeV 32 # Normalization: 1.0e-7 ph/cm2/s/MeV @ 100 MeV
33 # Spectral index: -2.1 33 # Spectral index: -2.1
34 # =================================================== 34 # ===================================================
35 -point_spatial = GModelSpatialPointSource(center) 35 +point_spatial = GModelSpatialPointSource(centre)
36 point_spectrum = GModelSpectralPlaw(1.0e-7, -2.1, GEnergy(100.0, "MeV")) 36 point_spectrum = GModelSpectralPlaw(1.0e-7, -2.1, GEnergy(100.0, "MeV"))
37 point = GModelSky(point_spatial, point_spectrum) 37 point = GModelSky(point_spatial, point_spectrum)
38 point.name('My point source') 38 point.name('My point source')
@@ -43,7 +43,7 @@ point.name(&#39;My point source&#39;) @@ -43,7 +43,7 @@ point.name(&#39;My point source&#39;)
43 # Normalization: 4.2e-7 ph/cm2/s/MeV @ 100 MeV 43 # Normalization: 4.2e-7 ph/cm2/s/MeV @ 100 MeV
44 # Spectral index: -2.4 44 # Spectral index: -2.4
45 # =================================================== 45 # ===================================================
46 -gauss_spatial = GModelSpatialRadialGauss(center, 3.0) 46 +gauss_spatial = GModelSpatialRadialGauss(centre, 3.0)
47 gauss_spectrum = GModelSpectralPlaw(4.2e-7, -2.4, GEnergy(100.0, "MeV")) 47 gauss_spectrum = GModelSpectralPlaw(4.2e-7, -2.4, GEnergy(100.0, "MeV"))
48 gauss = GModelSky(gauss_spatial, gauss_spectrum) 48 gauss = GModelSky(gauss_spatial, gauss_spectrum)
49 gauss.name('My Gaussian source') 49 gauss.name('My Gaussian source')
test/example_radial_models.py
@@ -37,7 +37,7 @@ def test_radial_model(name, model, clobber=True): @@ -37,7 +37,7 @@ def test_radial_model(name, model, clobber=True):
37 time = GTime() 37 time = GTime()
38 for inx in range(image.npix()): 38 for inx in range(image.npix()):
39 dir = image.inx2dir(inx) 39 dir = image.inx2dir(inx)
40 - theta = center.dist(dir) 40 + theta = centre.dist(dir)
41 image[inx] = model.eval(theta, energy, time) 41 image[inx] = model.eval(theta, energy, time)
42 42
43 # Write it to file 43 # Write it to file
@@ -62,10 +62,10 @@ if __name__ == &#39;__main__&#39;: @@ -62,10 +62,10 @@ if __name__ == &#39;__main__&#39;:
62 Test radial model integration. 62 Test radial model integration.
63 """ 63 """
64 # Set model location / centre 64 # Set model location / centre
65 - center = GSkyDir()  
66 - center.radec_deg(0.3, 0.1) 65 + centre = GSkyDir()
  66 + centre.radec_deg(0.3, 0.1)
67 67
68 # Test models 68 # Test models
69 - test_radial_model(name='gauss', model=GModelSpatialRadialGauss(center, 0.3))  
70 - test_radial_model(name='disk', model=GModelSpatialRadialDisk(center, 0.8))  
71 - test_radial_model(name='shell', model=GModelSpatialRadialShell(center, 0.5, 0.1)) 69 + test_radial_model(name='gauss', model=GModelSpatialRadialGauss(centre, 0.3))
  70 + test_radial_model(name='disk', model=GModelSpatialRadialDisk(centre, 0.8))
  71 + test_radial_model(name='shell', model=GModelSpatialRadialShell(centre, 0.5, 0.1))
test/test_GApplication.py
@@ -89,7 +89,7 @@ class Test(GPythonTestSuite): @@ -89,7 +89,7 @@ class Test(GPythonTestSuite):
89 log("\n") 89 log("\n")
90 log.right("Right", 10) 90 log.right("Right", 10)
91 log("\n") 91 log("\n")
92 - log.center("Center", 10) 92 + log.centre("Centre", 10)
93 log("\n") 93 log("\n")
94 log.header0("Header 0") 94 log.header0("Header 0")
95 log("\n") 95 log("\n")
@@ -112,7 +112,7 @@ class Test(GPythonTestSuite): @@ -112,7 +112,7 @@ class Test(GPythonTestSuite):
112 ref.append("HiggsHiggsHiggs\n") 112 ref.append("HiggsHiggsHiggs\n")
113 ref.append("Left \n") 113 ref.append("Left \n")
114 ref.append(" Right\n") 114 ref.append(" Right\n")
115 - ref.append(" Center \n") 115 + ref.append(" Centre \n")
116 ref.append("\n") 116 ref.append("\n")
117 ref.append("+==========+\n") 117 ref.append("+==========+\n")
118 ref.append("| Header 1 |\n") 118 ref.append("| Header 1 |\n")
@@ -134,7 +134,7 @@ class Test(GPythonTestSuite): @@ -134,7 +134,7 @@ class Test(GPythonTestSuite):
134 calls.append("fill()") 134 calls.append("fill()")
135 calls.append("left()") 135 calls.append("left()")
136 calls.append("right()") 136 calls.append("right()")
137 - calls.append("center()") 137 + calls.append("centre()")
138 calls.append("header0()") 138 calls.append("header0()")
139 calls.append("header1()") 139 calls.append("header1()")
140 calls.append("header1()") 140 calls.append("header1()")
test/test_GSky.cpp
@@ -930,7 +930,7 @@ void TestGSky::test_GSkyRegionCircle_logic(void) @@ -930,7 +930,7 @@ void TestGSky::test_GSkyRegionCircle_logic(void)
930 930
931 // Test contain dirs 931 // Test contain dirs
932 test_assert(refregion.contains(refdir_radeczerozero),"test for containment"); 932 test_assert(refregion.contains(refdir_radeczerozero),"test for containment");
933 - test_assert(refregion.contains(centre), "test if center in circle"); 933 + test_assert(refregion.contains(centre), "test if centre in circle");
934 test_assert(!refregion.contains(refdir_outside_refregion), "test2 for containment"); 934 test_assert(!refregion.contains(refdir_outside_refregion), "test2 for containment");
935 935
936 // Test contain regions 936 // Test contain regions