Commit 01e297cddb59fea07466fcaa53fda76fc01876c1
1 parent
808c9fdd
Rename `center` to `centre` everywhere.
(I chose `centre` because there were more `centre` than `center` around.)
Showing
16 changed files
with
47 additions
and
47 deletions
doc/source/user_manual/glossary.rst
doc/source/user_manual/modules/support.rst
| ... | ... | @@ -211,7 +211,7 @@ Function Description |
| 211 | 211 | ``gammalib::fill`` Fill string with a number of replications of a string. |
| 212 | 212 | ``gammalib::left`` Left justify string to achieve a given length of characters. |
| 213 | 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 | 215 | ``gammalib::parformat`` Format string for parameter value display. |
| 216 | 216 | ``gammalib::plaw_photon_flux`` Compute photon flux under a power law. |
| 217 | 217 | ``gammalib::plaw_energy_flux`` Compute energy flux under a power law. | ... | ... |
include/GTools.hpp
| ... | ... | @@ -76,7 +76,7 @@ namespace gammalib { |
| 76 | 76 | const char& c = ' '); |
| 77 | 77 | std::string right(const std::string& s, const int& n, |
| 78 | 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 | 80 | const char& c = ' '); |
| 81 | 81 | std::string parformat(const std::string& s, const int& indent = 0); |
| 82 | 82 | double plaw_photon_flux(const double& emin, | ... | ... |
inst/cta/src/GCTAModelBackground.cpp
| ... | ... | @@ -1196,7 +1196,7 @@ GModelTemporal* GCTAModelBackground::xml_temporal(const GXmlElement& temporal) c |
| 1196 | 1196 | /***********************************************************************//** |
| 1197 | 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 | 1201 | * Computes |
| 1202 | 1202 | * | ... | ... |
inst/cta/test/test_CTA.cpp
| ... | ... | @@ -362,7 +362,7 @@ void TestGCTAResponse::test_response_irf_diffuse(void) |
| 362 | 362 | GEnergy emax(100.0, "TeV"); |
| 363 | 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 | 366 | GCTAEventCube cube(map, ebounds, gti); |
| 367 | 367 | |
| 368 | 368 | // Setup dummy CTA observation |
| ... | ... | @@ -515,7 +515,7 @@ void TestGCTAModelBackground::test_modelbg_npred(void) |
| 515 | 515 | const GModelSpectralPlaw* spec = dynamic_cast<const GModelSpectralPlaw*>(bck->spectral()); |
| 516 | 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 | 519 | double src_ra = spat->ra(); |
| 520 | 520 | double src_dec = spat->dec(); |
| 521 | 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 | 57 | Set shell model. |
| 58 | 58 | """ |
| 59 | 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 | 63 | # Set radial model |
| 64 | - radial = GModelRadialShell(center, radius, width, False) | |
| 64 | + radial = GModelRadialShell(centre, radius, width, False) | |
| 65 | 65 | |
| 66 | 66 | # Set spectral model |
| 67 | 67 | spectral = GModelSpectralPlaw(1.0, -2.0) |
| ... | ... | @@ -81,11 +81,11 @@ def disk_model(ra=359.6, dec=-0.2, radius=0.4): |
| 81 | 81 | Set disk model. |
| 82 | 82 | """ |
| 83 | 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 | 87 | # Set radial model |
| 88 | - radial = GModelRadialDisk(center, radius) | |
| 88 | + radial = GModelRadialDisk(centre, radius) | |
| 89 | 89 | |
| 90 | 90 | # Set spectral model |
| 91 | 91 | spectral = GModelSpectralPlaw(1.0, -2.0) |
| ... | ... | @@ -105,11 +105,11 @@ def gauss_model(ra=359.6, dec=+0.1, sigma=0.2): |
| 105 | 105 | Set Gaussian model. |
| 106 | 106 | """ |
| 107 | 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 | 111 | # Set radial model |
| 112 | - radial = GModelRadialGauss(center, sigma) | |
| 112 | + radial = GModelRadialGauss(centre, sigma) | |
| 113 | 113 | |
| 114 | 114 | # Set spectral model |
| 115 | 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 | 53 | Set shell model. |
| 54 | 54 | """ |
| 55 | 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 | 59 | # Set radial model |
| 60 | - radial = GModelSpatialRadialShell(center, radius, width, False) | |
| 60 | + radial = GModelSpatialRadialShell(centre, radius, width, False) | |
| 61 | 61 | |
| 62 | 62 | # Set spectral model |
| 63 | 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 | 77 | Set disk model. |
| 78 | 78 | """ |
| 79 | 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 | 83 | # Set radial model |
| 84 | - radial = GModelSpatialRadialDisk(center, radius) | |
| 84 | + radial = GModelSpatialRadialDisk(centre, radius) | |
| 85 | 85 | |
| 86 | 86 | # Set spectral model |
| 87 | 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 | 101 | Set Gaussian model. |
| 102 | 102 | """ |
| 103 | 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 | 107 | # Set radial model |
| 108 | - radial = GModelSpatialRadialGauss(center, sigma) | |
| 108 | + radial = GModelSpatialRadialGauss(centre, sigma) | |
| 109 | 109 | |
| 110 | 110 | # Set spectral model |
| 111 | 111 | spectral = GModelSpectralPlaw(1.0, -2.0, GEnergy(100.0, "MeV")) | ... | ... |
pyext/GLog.i
| ... | ... | @@ -111,7 +111,7 @@ public: |
| 111 | 111 | void right(const std::string& arg, const int& n) { |
| 112 | 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 | 72 | std::string fill(const std::string& s, int n); |
| 73 | 73 | std::string left(const std::string& s, int n, char c = ' '); |
| 74 | 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 | 76 | std::string parformat(const std::string& s, const int& indent = 0); |
| 77 | 77 | double plaw_photon_flux(const double& emin, |
| 78 | 78 | const double& emax, | ... | ... |
src/app/GApplication.cpp
| ... | ... | @@ -425,7 +425,7 @@ void GApplication::log_header(void) |
| 425 | 425 | |
| 426 | 426 | // Dump header |
| 427 | 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 | 429 | log << "* " << gammalib::fill("-", header_width-4) << " *" << std::endl; |
| 430 | 430 | log << "* Version: " << gammalib::left(m_version, header_width-12) << "*" << std::endl; |
| 431 | 431 | log << gammalib::fill("*", header_width) << std::endl; | ... | ... |
src/sky/GSkyRegionCircle.cpp
| ... | ... | @@ -471,7 +471,7 @@ bool GSkyRegionCircle::contains(const GSkyRegion& reg) const |
| 471 | 471 | const GSkyRegionCircle* regcirc = |
| 472 | 472 | dynamic_cast<const GSkyRegionCircle*>(®); |
| 473 | 473 | |
| 474 | - // Calculate angular distance between the centers | |
| 474 | + // Calculate angular distance between the centres | |
| 475 | 475 | double ang_dist = m_centre.dist_deg(regcirc->centre()); |
| 476 | 476 | |
| 477 | 477 | // Check if the region is contained in this |
| ... | ... | @@ -512,7 +512,7 @@ bool GSkyRegionCircle::overlaps(const GSkyRegion& reg) const |
| 512 | 512 | const GSkyRegionCircle* regcirc = |
| 513 | 513 | dynamic_cast<const GSkyRegionCircle*>(®); |
| 514 | 514 | |
| 515 | - // Calculate angular distance between the centers | |
| 515 | + // Calculate angular distance between the centres | |
| 516 | 516 | double ang_dist = m_centre.dist_deg(regcirc->centre()); |
| 517 | 517 | |
| 518 | 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& s, const int& n, const char& 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 | 665 | * @param[in] s String to be centred. |
| 666 | 666 | * @param[in] n Requested total width. |
| 667 | 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 | 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 | 674 | // Compute number of characters to fill left and right |
| 675 | 675 | int n_right = (n-s.length()) / 2; | ... | ... |
test/example_model_xml_io.py
| ... | ... | @@ -24,15 +24,15 @@ from gammalib import * |
| 24 | 24 | # Set the location / centre of the source model to |
| 25 | 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 | 31 | # Create a point source with power law spectral shape |
| 32 | 32 | # Normalization: 1.0e-7 ph/cm2/s/MeV @ 100 MeV |
| 33 | 33 | # Spectral index: -2.1 |
| 34 | 34 | # =================================================== |
| 35 | -point_spatial = GModelSpatialPointSource(center) | |
| 35 | +point_spatial = GModelSpatialPointSource(centre) | |
| 36 | 36 | point_spectrum = GModelSpectralPlaw(1.0e-7, -2.1, GEnergy(100.0, "MeV")) |
| 37 | 37 | point = GModelSky(point_spatial, point_spectrum) |
| 38 | 38 | point.name('My point source') |
| ... | ... | @@ -43,7 +43,7 @@ point.name('My point source') |
| 43 | 43 | # Normalization: 4.2e-7 ph/cm2/s/MeV @ 100 MeV |
| 44 | 44 | # Spectral index: -2.4 |
| 45 | 45 | # =================================================== |
| 46 | -gauss_spatial = GModelSpatialRadialGauss(center, 3.0) | |
| 46 | +gauss_spatial = GModelSpatialRadialGauss(centre, 3.0) | |
| 47 | 47 | gauss_spectrum = GModelSpectralPlaw(4.2e-7, -2.4, GEnergy(100.0, "MeV")) |
| 48 | 48 | gauss = GModelSky(gauss_spatial, gauss_spectrum) |
| 49 | 49 | gauss.name('My Gaussian source') | ... | ... |
test/example_radial_models.py
| ... | ... | @@ -37,7 +37,7 @@ def test_radial_model(name, model, clobber=True): |
| 37 | 37 | time = GTime() |
| 38 | 38 | for inx in range(image.npix()): |
| 39 | 39 | dir = image.inx2dir(inx) |
| 40 | - theta = center.dist(dir) | |
| 40 | + theta = centre.dist(dir) | |
| 41 | 41 | image[inx] = model.eval(theta, energy, time) |
| 42 | 42 | |
| 43 | 43 | # Write it to file |
| ... | ... | @@ -62,10 +62,10 @@ if __name__ == '__main__': |
| 62 | 62 | Test radial model integration. |
| 63 | 63 | """ |
| 64 | 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 | 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 | 89 | log("\n") |
| 90 | 90 | log.right("Right", 10) |
| 91 | 91 | log("\n") |
| 92 | - log.center("Center", 10) | |
| 92 | + log.centre("Centre", 10) | |
| 93 | 93 | log("\n") |
| 94 | 94 | log.header0("Header 0") |
| 95 | 95 | log("\n") |
| ... | ... | @@ -112,7 +112,7 @@ class Test(GPythonTestSuite): |
| 112 | 112 | ref.append("HiggsHiggsHiggs\n") |
| 113 | 113 | ref.append("Left \n") |
| 114 | 114 | ref.append(" Right\n") |
| 115 | - ref.append(" Center \n") | |
| 115 | + ref.append(" Centre \n") | |
| 116 | 116 | ref.append("\n") |
| 117 | 117 | ref.append("+==========+\n") |
| 118 | 118 | ref.append("| Header 1 |\n") |
| ... | ... | @@ -134,7 +134,7 @@ class Test(GPythonTestSuite): |
| 134 | 134 | calls.append("fill()") |
| 135 | 135 | calls.append("left()") |
| 136 | 136 | calls.append("right()") |
| 137 | - calls.append("center()") | |
| 137 | + calls.append("centre()") | |
| 138 | 138 | calls.append("header0()") |
| 139 | 139 | calls.append("header1()") |
| 140 | 140 | calls.append("header1()") | ... | ... |
test/test_GSky.cpp
| ... | ... | @@ -930,7 +930,7 @@ void TestGSky::test_GSkyRegionCircle_logic(void) |
| 930 | 930 | |
| 931 | 931 | // Test contain dirs |
| 932 | 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 | 934 | test_assert(!refregion.contains(refdir_outside_refregion), "test2 for containment"); |
| 935 | 935 | |
| 936 | 936 | // Test contain regions | ... | ... |