Ls vs. Julian Dates vs. Gregorian Dates
KRC works in J2000 dates (Time from Jan 1 noon,2000 UT) = Julian date 2451545.0
Contents |
Step 1: Generate Ephemerids
Go to https://ssd.jpl.nasa.gov/horizons.cgi and use the following template:
- Ephemeris Type [change] : OBSERVER
- Target Body [change] : Mars [499]
- Observer Location [change] : Solar System Barycenter (SSB) [500@0]
- Time Span [change] : Start=1990-01-01, Stop=2040-01-01, Step=1 d
- Table Settings [change] : QUANTITIES=14,18; date/time format=BOTH; angle format=DEG; output units=KM-D; range units=KM
- Display/Output [change] : default (formatted HTML)
>>Generate Ephemeris<<
For satellites, use the parent body as the target body (Europa=> Jupiter for example) 1990-2040 is only adequate for body as far as Jupiter; for other bodies further away, expand this time window by multiple decades/centuries.
Step 2: Create Data File
Copy output table in text file on ~/Desktop/ (only copy the ephemerid data, not the headers or footers generated by Horizon)
Name file JPL_Horizon.txt
Step 3: Processing and Formatting
Run these lines in Davinci:
Table = read_lines("~/Desktop/JPL_Horizon.txt") Length = length(Table) Date_Greg = Table[:12,,1] Date_JD = Table[20:28,,1] ObsSub_LAT = atod(Table[53:60,,1]) hEcl_Lon = atod(Table[64:71,,1]) BUFFER = double(cat(0.,0.,axis=x)) for(i=1;i<=Length-1;i+=1){ if((ObsSub_LAT[1,i,1] < 0.)&&(ObsSub_LAT[1,i+1,1] > 0.)){ Line = cat(ObsSub_LAT[1,i:i+1,1],hEcl_Lon[1,i:i+1,1],axis=x) BUFFER = cat(BUFFER,Line,axis=y) } } DELTA_Ls = fit(y=BUFFER[2,2:,1],x=BUFFER[1,2:,1],"linear",plot=1)[1,1,1] Ls = float(hEcl_Lon - DELTA_Ls) Ls[where Ls < 0.] = Ls + 360. Ls[where Ls > 360.] = Ls - 360. Ls_2 = Ls[1,1,1] + "" for(i=2;i<=Length;i+=1){ Ls_2 = cat(Ls_2,Ls[1,i,1]+"",axis=y) } OUT = Date_Greg + " " + Date_JD + " " + Ls_2 write(OUT,"~/Desktop/BODY_Ls_Date.ascii",ascii,force=1)
The content of BODY_Ls_Date.ascii should now look like this:
1990-Jan-01 2447892.5 320.3994 1990-Jan-02 2447893.5 321.2871 1990-Jan-03 2447894.5 322.1805 1990-Jan-04 2447895.5 323.0793 1990-Jan-05 2447896.5 323.9838 1990-Jan-06 2447897.5 324.894 1990-Jan-07 2447898.5 325.8099 1990-Jan-08 2447899.5 326.7318 1990-Jan-09 2447900.5 327.6592 1990-Jan-10 2447901.5 328.5927 etc.
Step 4: Move File
Rename the file with the name of the body. For example Bennu_Ls_Date.ascii, Europa_Ls_Date.ascii, Mars_Ls_Date.ascii, Moon_Ls_Date.ascii etc.
Move the file to ~/Applications/davinci/Contents/Resources/library/script_files/krc_support/porb_defaults/
Step 5: Usage
For bodies associated with a BODY_Ls.ascii files, seasons can now be defined as Ls (ls), Julian Date (JD), and Gregorian Date (GD):
OUT = krc(body="Moon",lat=25.,ls=90.)
For a specific Gregorian Date, GD (currently ranging from 1990-Jan-01 to 2040-Jan-01), the format is ????-Mmm-DD, with Mmm:Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec;
OUT = krc(body="Moon",lat=12.,GD="2010-Jan-05")
or a specific Julian Date JD:
OUT = krc(body="Moon",lat=12.,JD=2455201)