irfpy.cy1orb.Cy1Orbit
¶
Chandrayaan-1 orbital position
This will provide low-level access of orbit/attitude data.
For practical use, you may use high-level module, irfpy.cy1orb.pvat2
.
Note
This module should not be used for data analysis.
Use irfpy.cy1orb.pvat2
See also Position of Chandrayaan-1.
The Cy1PvatRaw
and Cy1Pvat
classes are the lowest-API classes.
They represent a single master orbit-attitude file.
The master files are generated by some other tools (sorry, I forgot the software…
We have dataset!).
Cy1Orbit
and Cy1Attitude
is a second lowest-API classes.
- class irfpy.cy1orb.Cy1Orbit.Cy1PvatRaw(baseurl=None, rcfile=None)[source]¶
Bases:
object
CY-1 PVAT file reader.
PVAT file should be a format of 23-column ascii file that SARA spice module will produce. The data is normally read through
getPvatOfOrbit()
method:>>> pvat=Cy1PvatRaw() >>> data=pvat.getPvatOfOrbit(1234)
In this case, orbit 1234 data is loaded into Ntime x 22 matrix. One column (the 3rd column) is disregarded because it is not float.
In the above case, data is stored into the np.array instance. The array is cached into memory in the instance of
Cy1PvatRaw
.clearCache()
method will remove the memory cache.>>> pvat = Cy1PvatRaw() >>> onr = 1280 >>> data = pvat.getPvatOfOrbit(onr) >>> print(data.shape) # For the version 2 of PVAT dataset. (7082, 22)
- JD = 0¶
- ET = 1¶
- XLSE = 2¶
- YLSE = 3¶
- ZLSE = 4¶
- R = 5¶
- XME = 6¶
- YME = 7¶
- ZME = 8¶
- LAT = 9¶
- LON = 10¶
- ALT = 11¶
- XSCXL = 12¶
- XSCYL = 13¶
- XSCZL = 14¶
- YSCXL = 15¶
- YSCYL = 16¶
- YSCZL = 17¶
- SZA = 18¶
- ELV = 19¶
- NADIR = 20¶
- VELOC = 21¶
- class irfpy.cy1orb.Cy1Orbit.Cy1Pvat(baseurl=None, rcfile=None)[source]¶
Bases:
irfpy.cy1orb.Cy1Orbit.Cy1PvatRaw
Chandrayaan-1 PVAT file.
The PVAT file is in two format. Human readable version (master) and pickled version (cache). This class handles both the file format.
>>> pvat = Cy1Pvat() >>> onr = 1280 >>> data = pvat.getPvatOfOrbit(onr) >>> print(data.shape) (7082, 22) >>> data = pvat.getPvatOfOrbit(onr)
If you do not want to use cache file, you may use
Cy1PvatRaw
class. The location of the PVAT master file should be specified by.irfpyrc
file with entry ofcy1orb/pvatbase
. The PVAT cache file should be specified with an entry ofcy1orb/pvatcachedir
.Note that if the
pvatbase
is specified as remote directory, no cache is used.To remove the cache, you just use shell with
% rm /path/to/cache/pvat_????.pickle.gz
- class irfpy.cy1orb.Cy1Orbit.Cy1Orbit(baseurl=None, rcfile=None)[source]¶
Bases:
object
Class of CY-1 orbit information.
USAGE:
>>> cy1=Cy1Orbit() >>> pos=cy1.getPosOfOrb(1234) # retrieve 4xN data (time,x,y,z) of the orbit 1234.
It will produce (4, N) data array representing (time, x, y, z) as the first argument.
Create an instance of Cy1Orbit. Inside Cy1Pvat instance is stored.
- getPosOfOrb(orbit)[source]¶
Get the spacecraft position list in LSE coordinates for the specified orbit.
- Returns
4xN array of the data. Time information is a Julday in double-precision.
- getDayEqOfOrb2(orbit)[source]¶
Get the dayside equator crossing time.
- Parameters
orbit – Orbit number.
- Returns
A tuple that have (crossing_time, x, y, z).
crossing_time
isdatetime.datetime
instance.
- getDayEqOfOrb(orbit)[source]¶
Get the [jd_float, x, y, z] of the equator crossing in the dayside. z should be zero (not exactly due to implementation) and x should be plus.
- getPosOfOrb2(orbit)[source]¶
Get the spacecraft position list in LSE coordinates for the specified orbit.
The method returns the orbit data as JdSeries. The functionality is the same as getPosOfOrb() method, but the difference is the convenience of the data processing with compensation of execution time. Compared to the getPosOfOrb() method, it takes 20-30 times more time. :returns: JdSeries of the data. Data is a instance of irfpy.util.vector3d.Vector3d class.
- getNadirAngleOfOrb(orbit)[source]¶
Get the spacecraft nadir direction of the specified orbit.
The spacecraft nadir direction is the angle between X_sc and exact nadir. +X_sc is yaw, so, in nominal cases, it should be zero.
- getPosMeOfOrb(orbit)[source]¶
Get position of spacecraft in the ME coordinate system.
- Returns
4xN array of the data. Time information is a Julday in double-precision.
- class irfpy.cy1orb.Cy1Orbit.Cy1Attitude(baseurl=None, rcfile=None)[source]¶
Bases:
object
Class of CY-1 attitude information.
USAGE:
> cy1att=Cy1Attitude() > list = cy1att.getSc2LseMatrixOfOrb(942)
Create an instance of Cy1Orbit. Inside Cy1Pvat instance is stored.
- getSc2LseMatrixOfOrb(orbit)[source]¶
Get a list of the conversion matrix.
- Returns
Matrix of SC to LSE conversion.
- Return type
JdSeries
The conversion from SC to LSE is implemented. Formulation is:
|Xlse| | XSCXL YSCXL ZSCXL | |Xsc| |Ylse| = | XSCYL YSCYL ZSCYL | |Ysc| |Zlse| | XSCZL YSCZL ZSCZL | |Zsc|