Commit 71ac6b8480094736ead9ded0755f06b6cb0052c8
1 parent
4e783631
Cleanup ctphase (#1982)
Remove commented out code that constructed m_phase from a GXmlElement object. Ensure documentation is generated for "::read_phase_info_from_xml()". Reset initial values in ctphase.par file.
Showing
2 changed files
with
7 additions
and
65 deletions
src/ctphase/ctphase.cpp
| ... | ... | @@ -541,77 +541,19 @@ void ctphase::get_parameters(void) |
| 541 | 541 | (*this)["f1"].is_valid()&& |
| 542 | 542 | (*this)["f2"].is_valid()) { |
| 543 | 543 | |
| 544 | - // The following creates an XML object responsible for initializing | |
| 545 | - // 'm_phase'. This was done as the default values for the parameters in | |
| 546 | - // 'GModelTemporalPhaseCurve' are such that the ranges are predefined. | |
| 547 | - // Initializing 'm_phase' from an XML object circumvents this restriction. | |
| 548 | -/* | |
| 549 | - GXmlElement norm; | |
| 550 | - norm.name("parameter"); | |
| 551 | - norm.attribute("name", "Normalization"); | |
| 552 | - norm.attribute("value", "1"); | |
| 553 | - norm.attribute("min", "0"); | |
| 554 | - norm.attribute("max", "1000"); | |
| 555 | - | |
| 556 | - GXmlElement mjd; | |
| 557 | - mjd.name("parameter"); | |
| 558 | - mjd.attribute("name", "MJD"); | |
| 559 | - mjd.attribute("value", (*this)["mjd"].value()); | |
| 560 | - mjd.attribute("min", (*this)["mjd"].min()); | |
| 561 | - mjd.attribute("max", (*this)["mjd"].max()); | |
| 562 | - | |
| 563 | - GXmlElement p0; | |
| 564 | - p0.name("parameter"); | |
| 565 | - p0.attribute("name", "Phase"); | |
| 566 | - p0.attribute("value", (*this)["p0"].value()); | |
| 567 | - p0.attribute("min", (*this)["p0"].min()); | |
| 568 | - p0.attribute("max", (*this)["p0"].max()); | |
| 569 | - | |
| 570 | - GXmlElement f0; | |
| 571 | - f0.name("parameter"); | |
| 572 | - f0.attribute("name", "F0"); | |
| 573 | - f0.attribute("value", (*this)["f0"].value()); | |
| 574 | - f0.attribute("min", (*this)["f0"].min()); | |
| 575 | - f0.attribute("max", (*this)["f0"].max()); | |
| 576 | - | |
| 577 | - GXmlElement f1; | |
| 578 | - f1.name("parameter"); | |
| 579 | - f1.attribute("name", "F1"); | |
| 580 | - f1.attribute("value", (*this)["f1"].value()); | |
| 581 | - f1.attribute("min", (*this)["f1"].min()); | |
| 582 | - f1.attribute("max", (*this)["f1"].max()); | |
| 583 | - | |
| 584 | - GXmlElement f2; | |
| 585 | - f2.name("parameter"); | |
| 586 | - f2.attribute("name", "F2"); | |
| 587 | - f2.attribute("value", (*this)["f2"].value()); | |
| 588 | - f2.attribute("min", (*this)["f2"].min()); | |
| 589 | - f2.attribute("max", (*this)["f2"].max()); | |
| 590 | - | |
| 591 | - GXmlElement info; | |
| 592 | - info.append(norm); | |
| 593 | - info.append(mjd); | |
| 594 | - info.append(p0); | |
| 595 | - info.append(f0); | |
| 596 | - info.append(f1); | |
| 597 | - info.append(f2); | |
| 598 | - | |
| 599 | - info.attribute("file",""); | |
| 600 | - */ | |
| 601 | - | |
| 544 | + // Create the temporal phase curve object from the supplied parameters | |
| 602 | 545 | m_phase = GModelTemporalPhaseCurve(); |
| 603 | -// m_phase.read(info); | |
| 604 | 546 | m_phase.norm(1.0); |
| 605 | 547 | m_phase.mjd((*this)["mjd"].real()); |
| 606 | 548 | m_phase.phase((*this)["p0"].real()); |
| 607 | 549 | m_phase.f0((*this)["f0"].real()); |
| 608 | 550 | m_phase.f1((*this)["f1"].real()); |
| 609 | 551 | m_phase.f2((*this)["f2"].real()); |
| 610 | - | |
| 611 | 552 | } |
| 553 | + | |
| 612 | 554 | else { |
| 613 | 555 | GException::invalid_value("ctphase::get_parameters()", |
| 614 | - "Invalid parameter value for p0, mjd, f0, f1, or f2."); | |
| 556 | + "Invalid parameter value for p0, mjd, f0, f1, or f2."); | |
| 615 | 557 | } |
| 616 | 558 | |
| 617 | 559 | // Get other User parameters |
| ... | ... | @@ -631,7 +573,7 @@ void ctphase::get_parameters(void) |
| 631 | 573 | return; |
| 632 | 574 | } |
| 633 | 575 | |
| 634 | -/************************************************************************* | |
| 576 | +/***********************************************************************//** | |
| 635 | 577 | * @brief Read phase information from XML file |
| 636 | 578 | * |
| 637 | 579 | * @exception GException::par_error | ... | ... |
src/ctphase/ctphase.par
| ... | ... | @@ -26,11 +26,11 @@ source, s, h, ,,, "Source in model file to use for phase information" |
| 26 | 26 | # |
| 27 | 27 | # Phase information parameters |
| 28 | 28 | #===================== |
| 29 | -mjd, r, a,59000,,, "Reference MJD for phase information" | |
| 29 | +mjd, r, a,51544.5,,, "Reference MJD for phase information" | |
| 30 | 30 | p0, r, a,0.0,0.0,1.0, "Phase at reference MJD" |
| 31 | 31 | f0, r, a,1,,, "Frequency at reference MJD [Hz]" |
| 32 | -f1, r, a,1e-8,,, "First freq. derivative at reference MJD [s^-1]" | |
| 33 | -f2, r, a,1e-8,,, "Second freq. derivative at reference MJD [s^-2]" | |
| 32 | +f1, r, a,0.0,,, "First freq. derivative at reference MJD [s^-1]" | |
| 33 | +f2, r, a,0.0,,, "Second freq. derivative at reference MJD [s^-2]" | |
| 34 | 34 | |
| 35 | 35 | # |
| 36 | 36 | # Standard parameters | ... | ... |