Code Monkey home page Code Monkey logo

orbitpy's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

orbitpy's Issues

Warning while running the STK coverage validation script

Following warning is displayed when running the tests/validation/test_coveragecalculator_GridCoverage_with_STK.py script.

RuntimeWarning: invalid value encountered in true_divide

 percentDiff = (val1 - val2) / ((val1 + val2)/2)

propcov-cpp ECI to EarthFixed conversion is computed ignoring Earth's rotation term

Corresponding function: CoverageChecker::GetEarthFixedSatState(Real jd, const Rvector6& scCartState)

This becomes important when we wish the attitude (one of the axis) of the spacecraft to align to the spacecraft ground-track, which in turn requires one of the axis of the spacecraft body to be aligned to the spacecraft velocity in Earth-Fixed frame.

Strange error in which it appears a `Rvector` object is not being passed properly.

[ FAILED ] 1 test, listed below:

When the commented tests in the referenced file are included in testing, the error is produced. It appears that the arguments are not passed properly from the INSTANTIATE_TEST_CASE_P to the GetParam(). (Note that the last element of the clock array is not what is expected.)

This same error does not happen in the GMATCustomSensor GTest (TestGMATCustomSensor.cpp).

Julian Date UT1 to Gregorian UTC and vice-versa conversion does not consider the difference in UTC, UT1

This produces a error of < 1s. Suggest to modify the time-representation to be in Gregorian Date UT1.

Negligible changes in code is required, since actually until now the indicated Gregorian Date UTC was actually Gregorian Date UT1 (conversion from Julian Date UT1 to Gregorian Date UT1 was performed without accounting for DUT1). Only the print to csv file is changed to indicate that the time is in Gregorian Date UT1.

`coveragecalculator`: Optimize File IO for coverage reports.

The current process in the coveragecalculator class for writing coverage reports is inefficient.

            # compute coverage
            points = cov_checker.CheckPointCoverage() # list of indices of the GPs accessed shall be returned
            if len(points)>0: #If no ground-points are accessed at this time, skip writing the row altogether.
                for pnt in points:
                    coords = self.grid.get_lat_lon_from_index(pnt)
                    access_writer.writerow([time_index, pnt, coords.latitude, coords.longitude])

For every individual point accessed, the coordinates are requested one at a time. This requires a lot of python function calls and back and forth between python and C++. It would be better to request them all at once using something along the lines of self.grid.get_lats_lons_from_indices(pnts).

Spacecraft class not updating the Date along with the states, see: bool Spacecraft::SetOrbitState(const AbsoluteDate &t, const Rvector6 &kepl)

Mail - Ravindra, Vinay (ARC-SG)[Bay Area Environmental Research Institute] - Outlook.pdf
[EXTERNAL] RE: build/start TAT-C
Ravindra, Vinay (ARC-SG)[Bay Area Environmental Research Institute]
Tue 9/15/2020 4:45 PM
Hi Paul,

Thanks for the feedback. I think the behaviour of the results with closely repeating ground track for a polar-orbit is consistent with the error in the date input to the ECI to lat/lon conversion. Perhaps the jDate was erroneously at a fixed value in the iteration loop implying in effect the rotation of Earth is not being modeled. (The latitude thus changes while longitude is nearly the same, but not the same because it is not 90 deg inclination orbit.)

I think your fix is correct. The bug is in the GMAT part of the code. Line 455, prop->Propagate (*orbitDate); which is supposed to propagate (and also update the corresponding state elements) the satellite tied with the prop object (Line 363). It appears though that only the six Cartesian states X,Y,Z,VX,VY,VZ of the satellite are being updated in the Spacecraft class (and hence the sat object) and the time is not updated.

See:
https://gitlab.tatc-git.net/tat-c/tat-c/-/blob/new_folder_structure/modules/orbits/oc/src/Propagator.cpp (Line 256)
https://gitlab.tatc-git.net/tat-c/tat-c/-/blob/new_folder_structure/modules/orbits/oc/src/Spacecraft.cpp (Line 527, the function variable 't' should perhaps be used to update Spacecraft class variable orbitEpoch)
We did not come across the same problem in Dshield since we do not use the ECI to lat/lon conversion functionality. I am surprised about that error since I remember Gabe showing some nice heat-map plots of coverage, revisits etc which spanned the entire globe. Perhaps it crept in at a later stage of the project.

Best,
Vinay

propcov-cpp: Presence/absence of delete operations in destructor functions in `Propagator`, `Spacecraft`, `CoverageChecker` could cause memory problems.

  • The destructor function in Propagator, Spacecraft have been modified to comment out the delete operation on objects (orbit-state, orbit-epoch, attitude, interpolator) to which the class instance variables point to. This is because the objects are created outside and not by the Propagator/Spacecraft classes, and hence it seems better to not have the classes delete them. Hope it doesn't create any problems.

    • (On the other hands the objects pointed to by the instance variables, can be changed by the respective classes, hence these objects have a 1-1 association with these classes, and hence would make sense for them to be deleted by the classes)
  • Issue with Spacecraft class: When the copy operation is used, the objects are created by the Spacecraft class itself, in which case the deletion becomes the responsibility of the Spacecraft class.

  • See the CoverageChecker class which on other hand does not create PointGroup, Spacecraft objects (in the copy function). In this case the CoverageChecker class does not change the PointGroup or Spacecraft objects. In case of Spacecraft class however the OrbitState, OrbitEpoch, Attitude, Interpolator objects can be changed by the Spacecraft class itself, which would necessitate cloning of the respective objects in the copy function.

  • Memory problems may (not sure) happen if the CoverageChecker object is copied, and the copy/ original is destroyed. (Since some objects (pointArray, centralBody) appear to be shared between the copies.)

propcov-cpp `PointGroup`: requires longitudes to be between -pi to +pi strictly

In the PointGroup class, need to modify the strict requirement on the range of longitude values. Currently the range is -pi to +pi.
While reading the grid file data, the PointGroup class filters out points not satisfying the above constraint.

See 35f5cf2

As long as this issue is there, the range of longitude values must fall within -pi to pi, else there shall be erroneous behavior, results.

Modify this behavior to also accept longitude values in the range 0 to 2pi.

`propcov`: The classes supporting the `DSPIPCustomSensor` appear to require that the clock angles be in the range 0deg to 360 deg. Change behaviour to accept clock angles in any range.

Polygon::util::cartesianToSpherical function is used by the classes in the polygon folder and it forces the clock angle to be in the range 0 deg to 360 deg. Errors ensue if this forcing is removed.

It would be better to find where in the code there is actual requirement of the clock angles to be in the range 0 deg to 360 deg and perhaps add the forcing there.

Confusing and/or misnamed variable, function names relating to attitude configuration in GMAT-OC

The attitude configuration and calculations in GMAT-OC have confusing variable names and function names. For eg:

  1. In Spacecraft::CheckTargetVisibility(....):

    • R_NI = GetBodyFixedToInertial(bodyFixedState); NI indicates Inertial to Nadir, but the function name is BodyFixed to Inertial. There is no Nadir in the function name?

It seems that R_NI here may actually be the rotation matrix from Earth-Fixed to Nadir. Correspondingly GetBodyFixedToInertial() must be named as GetBodyFixedToReference? where BodyFixed refers to EarthFixed and Reference refers to Nadir.

  1. The function Spacecraft::GetBodyFixedToInertial(.....) is as follows:
Rmatrix33 Spacecraft::GetBodyFixedToInertial(const Rvector6 &bfState)
{
   return attitude->InertialToReference(bfState); 
}

The return matrix name and the function name does not gel.

  1. In NadirPointingAttitude::InertialToReference the returned matrix is named as R_fixed_to_nadir_transposed implying it is R_nadir_to_fixed. But this does not gel with the function name InertialToReference

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.