Comments (15)
ok, i'll make a PR, but the location(latitude and longitude) data is important, would you resolve that for me?
also i am a student from India, trying for GSoC 2021, just to let you know
from orbitdeterminator.
I added some already. some more need to be finished.
https://github.com/aerospaceresearch/orbitdeterminator/tree/Positional_Obs_Report_Formats
from orbitdeterminator.
Hi! Is this issue still open?
i'm a newbie, where should I start?
from orbitdeterminator.
Is the issue still open ?
from orbitdeterminator.
It is open as long as we do not close it.
So feel free to add more and make it more elegant.
from orbitdeterminator.
I was looking into the issue, found that for the conversion to work, four variables are required, namely : elevation, azimuth, UTC time and finally Latitude.
the data provided would already contain three of them excluding Latitude, as latitude would be of the observing station, it would be required to calculate the siderial time and also both of elevation and azimuth.
here is the code taken from
https://github.com/aerospaceresearch/orbitdeterminator/tree/Positional_Obs_Report_Formats
and modified
def load_iod_data(fname):
""" Loads satellite position observation data files following the Interactive
Orbit Determination format (IOD). Currently, the only supported angle format
are 1,2,3&7, as specified in IOD format.
IOD format is described at http://www.satobs.org/position/IODformat.html.
TODO: convert IOD angle formats 4,5&6 from AZ/EL to RA/DEC.
Args:
fname (string): name of the IOD-formatted text file to be parsed
Returns:
x (numpy array): array of satellite position observations following the
IOD format, with angle format code = 2.
"""
import math
# dt is the dtype for IOD-formatted text files
dt = 'S15, i8, S1, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, S8, S7, i8, i8, S1, S1, i8, i8, i8'
# iod_names correspond to the dtype names of each field
iod_names = ['object', 'station', 'stationstatus',
'yr', 'month', 'day',
'hr', 'min', 'sec', 'msec', 'timeM', 'timeX',
'angformat', 'epoch',
'raaz', 'decel', 'radecazelM', 'radecazelX',
'optical', 'vismagsign', 'vismag', 'vismaguncertainty', 'flashperiod']
# iod_delims corresponds to the delimiter for cutting the right variable from each input string
iod_delims = [15, 5, 2,
5, 2, 2,
2, 2, 2, 3, 2, 1,
2, 1,
8, 7, 2, 1,
2, 1, 3, 3, 9]
iod_input_lines = np.genfromtxt(fname, dtype=dt, names=iod_names, delimiter=iod_delims, autostrip=True)
def horizon_to_celestial(ele, al, utc, lat):
"""ele : elevation
al : altitude
AZ/EL = DDDMMSS+DDMMSS MX (MX in seconds of arc)
st : siderial time
lat: latitude
returns right_ascension and declination in order
"""
#todo convert utc to siderial_time(ST)
ELE = math.radians(ele)
AL = math.radians(al)
LAT = math.radians(lat)
ST = math.radians(-1*utc)
sin_dec = (math.sin(LAT)*math.sin(ELE)) + (math.cos(LAT)*math.cos(ELE)*math.cos(AZ))
dec = math.degrees(math.asin(sin_dec))
cos_HA = (math.sin(ELE) - math.sin(LAT)*sin_dec)/(math.cos(LAT)*math.cos(math.asin(sin_dec)))
HA = math.degrees(math.acos(cos_HA))
#if the object is west of observer's meridian
if():
ra = ST - HA
#if the object is east of observer's meridian
else:
ra = ST + HA
return ra, dec
right_ascension = []
declination = []
azimuth = []
elevation = []
for i in range(len(iod_input_lines)):
RA = -1.0
DEC = -1.0
AZ = -1.0
EL = -1.0
if iod_input_lines["angformat"][i] == 1:
# 1: RA/DEC = HHMMSSs+DDMMSS MX (MX in seconds of arc)
RAAZ = iod_input_lines["raaz"][i].decode()
HH = float(RAAZ[0:2])
MM = float(RAAZ[2:4])
SS = float(RAAZ[4:6])
s = float(RAAZ[6])
RA = (HH + (MM + (SS + s / 10.0) / 60.0) / 60.0) / 24.0 * 360.0
DECEL = iod_input_lines["decel"][i].decode()
DD = float(DECEL[1:3])
MM = float(DECEL[3:5])
SS = float(DECEL[5:7])
DEC = DD + (MM + SS / 60.0) / 60.0
if DECEL[0] == "-":
DEC = -1.0 * DEC
elif iod_input_lines["angformat"][i] == 2:
# 2: RA/DEC = HHMMmmm+DDMMmm MX (MX in minutes of arc)
RAAZ = iod_input_lines["raaz"][i].decode()
HH = float(RAAZ[0:2])
MM = float(RAAZ[2:4])
mmm = float(RAAZ[4:7])
RA = (HH + (MM + mmm / 1000.0) / 60.0) / 24.0 * 360.0
DECEL = iod_input_lines["decel"][i].decode()
DD = float(DECEL[1:3])
MM = float(DECEL[3:5])
mm = float(DECEL[5:7])
DEC = DD + (MM + mm / 100.0) / 60.0
if DECEL[0] == "-":
DEC = -1.0 * DEC
elif iod_input_lines["angformat"][i] == 3:
# 3: RA/DEC = HHMMmmm+DDdddd MX (MX in degrees of arc)
RAAZ = iod_input_lines["raaz"][i].decode()
HH = float(RAAZ[0:2])
MM = float(RAAZ[2:4])
mmm = float(RAAZ[4:7])
RA = (HH + (MM + mmm / 1000.0) / 60.0) / 24.0 * 360.0
DECEL = iod_input_lines["decel"][i].decode()
DD = float(DECEL[1:3])
dddd = float(DECEL[3:7])
DEC = (DD + (dddd / 1000.0))
if DECEL[0] == "-":
DEC = -1.0 * DEC
elif iod_input_lines["angformat"][i] == 4:
# 4: AZ/EL = DDDMMSS+DDMMSS MX (MX in seconds of arc)
RAAZ = iod_input_lines["raaz"][i].decode()
DDD = float(RAAZ[0:3])
MM = float(RAAZ[3:5])
SS = float(RAAZ[5:7])
AZ = DDD + (MM + SS / 60.0) / 60.0
DECEL = iod_input_lines["decel"][i].decode()
DD = float(DECEL[1:3])
MM = float(DECEL[3:5])
SS = float(DECEL[5:7])
EL = DD + (MM + SS / 60.0) / 60.0
if DECEL[0] == "-":
EL = -1.0 * EL
UTC = float()
# TODO: convert from AZ/EL to RA/DEC
RA, DEC = horizon_to_celestial(EL, AZ, UTC, LAT)
elif iod_input_lines["angformat"][i] == 5:
# 5: AZ/EL = DDDMMmm+DDMMmm MX (MX in minutes of arc)
RAAZ = iod_input_lines["raaz"][i].decode()
DDD = float(RAAZ[0:3])
MM = float(RAAZ[3:5])
SS = float(RAAZ[5:7])
AZ = DDD + (MM + SS / 60.0) / 60.0
DECEL = iod_input_lines["decel"][i].decode()
DD = float(DECEL[1:3])
MM = float(DECEL[3:5])
mm = float(DECEL[5:7])
EL = DD + (MM + mm / 100.0) / 60.0
if DECEL[0] == "-":
EL = -1.0 * EL
# TODO: convert from AZ/EL to RA/DEC
RA, DEC = horizon_to_celestial(EL, AZ, UTC, LAT)
elif iod_input_lines["angformat"][i] == 6:
# 6: AZ/EL = DDDdddd+DDdddd MX (MX in degrees of arc)
RAAZ = iod_input_lines["raaz"][i].decode()
DDD = float(RAAZ[0:3])
dddd = float(RAAZ[3:7])
AZ = DDD + dddd / 1000.0
DECEL = iod_input_lines["decel"][i].decode()
DD = float(DECEL[1:3])
dddd = float(DECEL[3:7])
EL = DD + dddd / 1000.0
if DECEL[0] == "-":
EL = -1.0 * EL
# TODO: convert from AZ/EL to RA/DEC
RA, DEC = horizon_to_celestial(EL, AZ, UTC, LAT)
elif iod_input_lines["angformat"][i] == 7:
# 7: RA/DEC = HHMMSSs+DDdddd MX (MX in degrees of arc)
RAAZ = iod_input_lines["raaz"][i].decode()
HH = float(RAAZ[0:2])
MM = float(RAAZ[2:4])
SS = float(RAAZ[4:6])
s = float(RAAZ[6])
RA = (HH + (MM + (SS + s / 10.0) / 60.0) / 60.0) / 24.0 * 360.0
DECEL = iod_input_lines["decel"][i].decode()
DD = float(DECEL[1:3])
dddd = float(DECEL[3:7])
DEC = (DD + (dddd / 1000.0))
if DECEL[0] == "-":
DEC = -1.0 * DEC
#else:
# # TODO: when not defined, we assume it is RA/DEC
right_ascension.append(RA)
declination.append(DEC)
azimuth.append(AZ)
elevation.append(EL)
# expanding the input iod data with the position data in different formats
iod = {}
for name in iod_names:
iod[name] = iod_input_lines[name].tolist()
iod["right_ascension"] = right_ascension
iod["declination"] = declination
iod["azimuth"] = azimuth
iod["elevation"] = elevation
return iod
from orbitdeterminator.
Hi, okay, cool.
Why not making a PR out of all your efforts?
It's also easier to read.
It's easier to see changes.
And we can test it with your branch.
Will you?
from orbitdeterminator.
ok, i'll make a PR, but the location(latitude and longitude) data is important, would you resolve that for me?
also i am a student from India, trying for GSoC 2021, just to let you know
It latitude longitude stuff is implemented in the already working part. I think you can just do it similarly. You should test your code anyways and see, if it works :).
I will help of course, so doing a PR into the iod branch would be a good start. Then we can work together on this.
And I expected you to be a gsoc student. ;) We have a lot of new activity lately about it.
If you did not do it already, come into our zulip chat for further chats.
from orbitdeterminator.
should i make a new branch for this?
@hornig
from orbitdeterminator.
@KingShark1 you can use the branch for the report formats.
from orbitdeterminator.
@hornig can you check up on the changes i made?
here's a link to my forked repo
https://github.com/KingShark1/orbitdeterminator
from orbitdeterminator.
@KingShark1 your link is broken (underneath) and on the visible side it links to your repo.
it would help me to see the change you did by either providing a link to your change/commit, or you just directly commit it as a PR to this branch https://github.com/aerospaceresearch/orbitdeterminator/tree/Positional_Obs_Report_Formats
Will have a look then. :)
from orbitdeterminator.
yeah did that!
please update me soon : )
also, there's a bunch of gibberish stuff, due to my vsc enviorment, and a testing file(somethingsomething.py), ignore those two :)
from orbitdeterminator.
would be good if you remove it :)
in the end it needs to run on your computer first :).
from orbitdeterminator.
Hey @hornig
I worked on AZ/EL to RA/DEC conversion part of this issue. I have made changes on the master branch.
To create a PR, should I make a new branch as this branch is quite old ( structure differs a bit from the current master branch ).
Or can I create a PR on the master??
from orbitdeterminator.
Related Issues (20)
- pytest fail after installing orbitdeterminator on MacPro (2019) HOT 2
- Wrong results when running main.py HOT 7
- Where is check_sgp4 used? HOT 2
- the question about the format of the data
- the error when I was using certain modules like the help pdf(pages_20) HOT 3
- Code Unit Testing Philosophy HOT 8
- Doppler: CleanUp HOT 3
- conda install pykep==2.1 raises error HOT 2
- test_old and test_utils fails while test HOT 3
- pykep package not getting installed HOT 2
- No module named 'lamberts_method' HOT 4
- input file format auto detect HOT 5
- Replace PyEphem with SkyField functions HOT 3
- one central place for orbital calculations HOT 3
- Setting standard gravitational parameter according to the central body and find a place for the constants HOT 7
- load in mixed input formats (json, iod, uk, etc...)
- Installation procedure on a MacPro (desktop) running Mac OS X 11.5.2 (Big Sur)
- Faster State Vector processing (SPG4/Skyfield vs ideal Keppler vs...) HOT 1
- IndexError : "list index out of range" ,coming on running "triple_moving_average.py" code HOT 1
- Are the right values in the variables?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from orbitdeterminator.