-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FDJUMP implementation (Hacky version) #1615
Conversation
@rossjjennings @gooddc Can you try this and see if it does what you need? |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #1615 +/- ##
==========================================
+ Coverage 68.15% 68.25% +0.09%
==========================================
Files 98 99 +1
Lines 22702 22784 +82
Branches 3904 3916 +12
==========================================
+ Hits 15473 15551 +78
- Misses 6270 6273 +3
- Partials 959 960 +1
☔ View full report in Codecov by Sentry. |
The changes don't seem to fully work with timing_model.py Trying to set the list of free_params equal to a list including FD1JUMP returns the following error:
|
@goodc Can you try with "FD1JUMP1" instead of "FD1JUMP"? Does this usually work with other mask parameters? What happens when you set |
Okay, I didn't realize it needed to be FD1JUMP1 not FD1JUMP. JUMP doesn't work: only JUMP1, JUMP2, etc. For multiple FDJUMPs will the formatting be FD1JUMP1, FD1JUMP2, FD1JUMP3 or FD1JUMP1, FD1JUMP2, FD1JUMP3? |
For multiple FD1JUMPs it will be.FD1JUMP1, FD1JUMP2, etc. In FDxJUMPy, x is the FD index (power of the radio frequency in the FD delay expression), and y is the mask index. |
Ah okay. I'm not sure I fully understand how this compares to the way that tempo2 is doing this. Does that mean that FD1JUMPn is tied to FD1, FD2JUMPn is tied to FD2, etc.? |
Yes. There is an extra complication though. In tempo2, FDx delay is proportional to (log(freq/1_GHz))**x, whereas FDJUMPx (FDxJUMP in PINT) is proportional to (freq/1_GHz)**x without the logarithm. You can control this in PINT using the FDJUMPLOG parameter, which is not there in tempo2. It is set to be tempo2-compatible by default. |
src/pint/models/fdjump.py
Outdated
Caveat | ||
------ | ||
`FDJUMP`s have two indices: the polynomial/FD/prefix index and the system/mask | ||
index. i.e., they have properties of both `maskParameter`s such as `JUMP`s and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be ":class:~pint.models.parameter.maskParameter
" and similar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem to work properly in a note box.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. In that case I think still using double back ticks is better. Otherwise the formatting gets confused.
This PR implements the system-dependent FD parameters (FDJUMPs).
(See #1480)
In PINT,
maskParameter
s andprefixParameter
s have identical naming schemes. This makes it very challenging to implement FDJUMPs, which have properties of bothmaskParameter
s andprefixParameter
s.So I am doing a stopgap measure here, by renaming "FDJUMPn" --> "FDnJUMP" so that the mask and prefix indices don't interfere with each other. This also means that we would need an upper bound on the number of allowed prefix indices (n). I have set this to 20. This is controlled by the
pint.models.fdjump.fdjump_max_index
variable.The above choice also leads to an inconsistency with tempo2 due to the parameter name being "FDnJUMP" instead of "FDJUMPn". I have added a preprocessing step to ensure that the tempo2 par files with "FDJUMPn" are read correctly. In addition, tempo2-compatible par files with "FDJUMPn" can be written out using the
format="tempo2"
option.A proper solution to this will be to overhaul the
maskParameter
naming scheme (e.g. #1059). However, I am not doing this here since we need this quickly for the IPTA EDR3.I have also put a boolean parameter FDJUMPLOG to control whether the FDjumps act on the log-frequency or the frequency. This is False by default to make it consistent with tempo2. Note that regular FD parameters act on the log-frequency .