Skip to content
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

Write observations to file in MPC and/or DES format #351

Open
2 of 5 tasks
monocongo opened this issue Jun 22, 2022 · 3 comments
Open
2 of 5 tasks

Write observations to file in MPC and/or DES format #351

monocongo opened this issue Jun 22, 2022 · 3 comments
Labels
data feature request request for new functionality new feature
Milestone

Comments

@monocongo
Copy link

This is a request for

  • a new feature
  • an enhancement to existing sbpy functionality
  • somethings else: [explain here]

The requested changes will be implemented by

  • me
  • the sbpy developers

High-level concept
I would like to query MPC observations for an object and then write the observations data to a file which is suitable as input to OpenOrb for orbit computations. I propose we add a function to the Obs class which would allow writing to file in DES or MPC format.

Please advise if there is already a way to do this using sbpy, I am a novice user still unfamiliar with this package.

Explain the relevance to sbpy
This is related to the sbpy.Data.Obs class

Proposal details
Write the file in DES and MPC formats using Python standard library.

Example (pseudo-)code

observations = Obs.from_mpc(targetid=designation, id_type='asteroid designation')
file_path = f'/home/james/data/observations_{designation}.mpc'
observations.to_file(path=file_path, format='DES')
@monocongo monocongo added the feature request request for new functionality label Jun 22, 2022
@mkelley
Copy link
Member

mkelley commented Jun 24, 2022

Hi @monocongo , this sounds like a good idea. We have a to_file method in DataClass (from which Obs objects are derived) that passes parameters on to astropy.table.Table.write. Perhaps the Obs object should implement its own version that writes the DES or MPC formats if requested, or else passes on to the DataClass.to_file for other formats. Regardless, please give this a try, starting with methods that format the object into strings, e.g., Obs.to_mpc80 and Obs.to_des.

@mkelley mkelley added the data label Jun 24, 2022
@mkelley mkelley added this to the v0.4 milestone Jun 24, 2022
@mkelley
Copy link
Member

mkelley commented Jun 24, 2022

I've marked this as a v0.4 milestone, due by Aug 1, but if that timescale isn't good for you, let me know and I can change this to v0.5 (~1 Feb) at any time.

monocongo added a commit to monocongo/sbpy that referenced this issue Jun 26, 2022
monocongo added a commit to monocongo/sbpy that referenced this issue Jun 26, 2022
@mkelley
Copy link
Member

mkelley commented Jun 9, 2023

I'm still happy to have this contribution, but we're going to make a release in the next week, so I will re-milestone this to v0.5.

@mkelley mkelley modified the milestones: v0.4, v0.5 Jun 9, 2023
@mkelley mkelley modified the milestones: v0.5, v0.6 Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data feature request request for new functionality new feature
Projects
None yet
Development

No branches or pull requests

2 participants