Code Monkey home page Code Monkey logo

Comments (9)

paulray avatar paulray commented on August 16, 2024

@paulray is working on this.

from pint.

paulray avatar paulray commented on August 16, 2024

Currently if you call model.phase(toas.table), it tries to evaluate the full model for each TOA. It actually should not evaluate the solar system delay terms for TOAs at the 'Barycenter'. This needs to be fixed so that one could have TOA tables that intermix Barycentric and normal TOAs.

from pint.

scottransom avatar scottransom commented on August 16, 2024

I think it is likely a one-liner (or near one-liner) that we can put in to the solar_system_geometric_delay() method to return 0 for TOAs where the observatory is Barycenter.

from pint.

demorest avatar demorest commented on August 16, 2024

Shouldn't this all already work out OK if the observatory position is set correctly (ie to 0,0,0) for the barycentered TOAs?

from pint.

scottransom avatar scottransom commented on August 16, 2024

Ah, but that isn't the correct barycenter position.... that is the geocenter position. And we want that as well.

from pint.

scottransom avatar scottransom commented on August 16, 2024

(unless you meant in barycenter coordinates!)

from pint.

demorest avatar demorest commented on August 16, 2024

Yes, I meant the vector stored along with pint TOAs ("toas['ssb_obs_pos']") which is relative to the barycenter. This is what the astrometry class uses.. if it's zero things should work fine although I agree we might want a special case just to avoid unnecessary calculation.

I don't know if barycentered TOAs (which as we've discussed before are kind of a hack to begin with) typically have had SS shapiro delay applied or not... depending on how this was done the shapiro delay part might need disabling, or changing as the observatory wasn't really at the barycenter.

from pint.

paulray avatar paulray commented on August 16, 2024

It should be easy to correct, but I am having trouble figuring out the Python to make it work (elegantly).
An example of a function that needs to be modified is below. The 'toas' argument is really the toas.table, which is grouped by observatory. So, how do we elegantly loop over the groups and make the delay = 0.0 for the 'Barycenter' key and use the computation for the rest?

def solar_system_shapiro_delay(self, toas):
    """
    Returns total shapiro delay to due solar system objects.
    If the PLANET_SHAPIRO model param is set to True then
    planets are included, otherwise only the value for the
    Sun is calculated.

    Requires Astrometry or similar model that provides the
    ssb_to_psb_xyz method for direction to pulsar.

    If planets are to be included, TOAs.compute_posvels() must
    have been called with the planets=True argument.
    """
    psr_dir = self.ssb_to_psb_xyz(epoch=toas['tdbld'].astype(numpy.float64))
    delay = self.ss_obj_shapiro_delay(toas['obs_sun_pos'],
                                      psr_dir, self._ss_mass_sec['sun'])
    if self.PLANET_SHAPIRO.value:
        for pl in ('jupiter', 'saturn', 'venus', 'uranus'):
            delay += self.ss_obj_shapiro_delay(toas['obs_'+pl+'_pos'],
                                               psr_dir, self._ss_mass_sec[pl])
    return delay

from pint.

demorest avatar demorest commented on August 16, 2024

I believe this was fixed. If not, someone re-open it.

from pint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.