i4Ds / STIXCore

STIX Core functionalities
BSD 3-Clause "New" or "Revised" License
3 stars 3 forks source link

Roll angle calculations fails #223

Closed nicHoch closed 2 years ago

nicHoch commented 2 years ago

with the kernels loaded automatically from the synced folder on pub099 the roll angle calculations fails:

    # load the test kernel
    from stixcore.data.test import test_data
    _spm = SpiceKernelManager(test_data.ephemeris.KERNELS_DIR)
    sp = Spice(_spm.get_latest_mk())
    # DOES WORK
    pos = sp.get_orientation(date=datetime(2020, 10, 7, 12), frame='SOLO_HEEQ')
    print(pos)
    # DOES NOT WORK
    try:
        pos = sp.get_orientation(date=datetime(2021, 10, 7, 12), frame='SOLO_HEEQ')
        print(pos)
    except Exception as e:
        print(e)

    # load the latest kernel on pub099
    _spm = SpiceKernelManager(Path("/data/stix/spice/kernels/"))
    sp = Spice(_spm.get_latest_mk())
    sp.meta_kernel_path
    # DOES NOT WORK
    try:
        pos = sp.get_orientation(date=datetime(2020, 10, 7, 12), frame='SOLO_HEEQ')
        print(pos)
    except Exception as e:
        print(e)

returns

<Quantity 1.10233721 deg>, <Quantity -6.59174806 deg>, <Quantity -52.53633971 deg>
Spice returns not found for function: ckgp
Spice returns not found for function: ckgp
samaloney commented 2 years ago

Just to keep track I think this issue is due to the kernels and not the code but we should probably put a try catch somewhere perhaps in the get_orientation function?

With fresh kernels zip downloaded from here

spp = Spice('<path/to/unziped/kernels/mk/solo_ANC_soc-flown-mk_v107_20220411_001.tm')
spp.get_orientation(date=datetime(2020, 10, 7, 12), frame='SOLO_HEEQ')
(<Quantity 1.10233721 deg>,
 <Quantity -6.59174806 deg>,
 <Quantity -52.53633971 deg>)
samaloney commented 2 years ago

I think this can be close now @nicHoch?

nicHoch commented 2 years ago

fixed in: #204