nanograv / PINT

PINT is not TEMPO3 -- Software for high-precision pulsar timing
Other
118 stars 101 forks source link

Broken backward compatibility for spacecraft alias to STL_GEO special location #1723

Closed juliadeneva closed 6 months ago

juliadeneva commented 6 months ago

When using a tim file containing spacecraft-topocentric TOAs, the alias 'spacecraft' is no longer accepted instead of STL_GEO. This breaks backwards compatibility with tim files made when this alias was the default written to tim files edited and saved with pintk, including tim files published as supplementary electronic material to papers.

paulray commented 6 months ago

The removal of 'spacecraft' was a side effect of PR #865 by @kerrm

dlakaplan commented 6 months ago

Do you have a sample tim file (or a link to a relevant paper) for testing?

juliadeneva commented 6 months ago

You can try any of the supplementary *.tim.nicer files from this paper:

https://arxiv.org/abs/1902.07130

kerrm commented 6 months ago

Here is a direct link to one of the .tim files Julia pointed to:

https://arxiv.org/src/1902.07130v1/anc/supplementary-materials/B1937-nanograv-all-frozen-dmx.tim.nicer

Is it just a matter of adding "spacecraft" as an alias here?

line 281 of special_locations.py: T2SpacecraftObs("stl_geo", aliases=["STL_GEO"], overwrite=True)

juliadeneva commented 6 months ago

That, and what pintk writes when a tim file is edited and saved should not be 'spacecraft' if other programs like Tempo2 don't recognize it. I'm not sure what the pintk behavior is now but those tim files were saved with it and at the time that was the default behavior.

dlakaplan commented 6 months ago

Just that change is not sufficient. I also find errors with some of the flags. Looking further.

juliadeneva commented 6 months ago

Ben Perera, who contacted me about this problem, said he had to change '-name' to '-creator' in addition to replacing spacecraft with stl_geo to be able to use those files.

dlakaplan commented 6 months ago

Yes, that allows it to be read. I don't think there is a downside to putting spacecraft back in as an alias. That's an easy fix. Once it's read in it is converted to stl_geo, so I think further reading by tempo2 etc will be OK. And in pintk you can also specify the output format if needed.

paulray commented 6 months ago

Where does -name nicer come from? photon_toa.py does not write a flag like that, just -t NICER

juliadeneva commented 6 months ago

It looks like pintk (or perhaps python scripts I had using PINT) changed a bunch of things when I edited the tim files to remove outliers, not just the 'spacecraft' observatory ID. The files made by photon_toa.py have 'photon_toa' as the first field in each line, while the ones that were included with the paper have 'pint' as the first field.

dlakaplan commented 6 months ago

Closed by #1724 (at least for the main part - other changes to the tim file may still need attention)