Tutorial for extract JPL to ssc

All tutorials about Celestia go in here. For Celestia itself, add-ons, textures, scripting, etc.
Avatar
Topic author
gironde M
Posts: 276
Joined: 16.12.2016
Age: 66
With us: 1 year 10 months
Location: Montigny-Les-Metz, Grand Est, Lorraine, Moselle, France

Tutorial for extract JPL to ssc

Post #1by gironde » 04.10.2018, 10:43

1)
here is the my model ssc for all asteroids :
"" "Sol"
{
Class "asteroid"
Mesh "asteroid.cmod"
Texture "asteroid.jpg"
Radius # not specified, calculate by H= and albedo
EllipticalOrbit
{
Epoch 2458000.5 # 2017 Sep 04
Period
Eccentricity 0
SemiMajorAxis
Inclination
AscendingNode
ArgOfPericenter
MeanAnomaly
}

UniformRotation
{
Period 1.0# Approximate value
}

Albedo 0.25 # not specified, median value 0.25
InfoURL "https://ssd.jpl.nasa.gov"
}


that is, Excel will edit lines in this format, with line breaks and tabs


:hi:

Added after 3 minutes 40 seconds:
2) go to https://ssd.jpl.nasa.gov/sbdb_query.cgi

3) here you have to select the fields you want

Extract on JPL Small-Body Database Search Engine
========================================================================
- step 1
object group: [All] or NEO or PHA
object kind: All or [Asteroids] or Comets
numbered state: [All] or numbered or unnumbered

Limit to selected orbit class(es): selected one
check case
Limit by object characteristics:
by selected physical or orbital parameter, operateur, value (ex. [diameter] [>=] [10] [Adds] all diameter sup. or equal to 10km)

- step 2 and 3
Output Fields:
Pre-defined field sets: nothing
------------------------------------
NEO flag (Y/N) {neo} -- in object fields
PHA flag(Y/N) {pha}-- in object fields
[objet IAU name {name} -- name ou vide -- in object fields
[objet full name/designation] {full_name} -- [prim.desing.-name-first alternate] ou [prim.desing.-first alternate] ou [first alternate] -- in object fields
[objet primary designation] {pdes} -- [prim.design. ou first alternate] -- in object fields
[H] (mag) absolute magnitude -- in object fields
[object diameter] km [radius = diameter/2] -- in object fields

[epoch] (JED) -- in orbital and model parameter fields
period (Years) orbital period {per_y}-- in orbital and model parameter fields
[e] eccentricity -- in orbital and model parameter fields
[a] (au) semimajor axis -- in orbital and model parameter fields
[i] (deg) inclination -- in orbital and model parameter fields
[node] (deg) longitude of ascending node {om} -- in orbital and model parameter fields
[peri] arg of perihelion (deg) {w} -- in orbital and model parameter fields
[M] (deg) mean anomaly {ma} -- in orbital and model parameter fields

[rotation period] rot_per (h) [ defaut = 1] -- in object fields
[geometric albedo] albedo [defaut = 0.25] -- in object fields
----------------------------------

- step 6
Format Options:
CSV

======================================================

:hi:

Added after 9 minutes 52 seconds:
by clicking on 'generate table', we extract the data in html directly on the screen or in txt format csv file.
I get a txt / csv file of this type:
the first line is the name of the requested fields

neo,pha,name,full_name,pdes,H,diameter,epoch,per_y,e,a,i,om,w,ma,rot_per,albedo
N,N,," 15760 (1992 QB1)",15760,7.1,,2458000.5,288.928805032214,.06547351504010455,43.70405755366057,2.187683117120486,359.4365289463323,.6028682591387464,31.00478178198676,,
N,N,," 15788 (1993 SB)",15788,7.9,,2458000.5,244.822144383809,.3168653720922044,39.13466887589128,1.938500650675891,354.854742449308,79.40829992307691,352.1477592111634,,
N,N,," 15789 (1993 SC)",15789,7.0,328,2458000.5,246.83862313354,.1852680404666586,39.34926355225443,5.162406960572474,354.7012386687122,315.645941488373,68.96865137926659,,0.022
N,N,," 15807 (1994 GV9)",15807,7.4,,2458000.5,292.339191110655,.06188621535805661,44.0472932555076,.560512673700405,176.6315354661247,311.2751449320815,69.41148469713558,,
N,N,," 15809 (1994 JS)",15809,7.8,,2458000.5,276.301577912721,.2205074618744048,42.42124809015642,14.02441766122744,56.24492528153257,236.7734946962532,352.8868525526989,,
N,N,Arawn," 15810 Arawn (1994 JR1)",15810,7.7,,2458000.5,248.658593401922,.1216137236119147,39.54244448509541,3.806264324334046,144.706954028479,102.3577951669649,30.97556432388182,,
N,N,," 15820 (1994 TB)",15820,7.3,,2458000.5,245.820459733873,.3129325949476554,39.24098343303483,12.13976407325359,317.4001497700241,99.12797939447138,357.9033648048788,6.5,
N,N,," 15836 (1995 DA2)",15836,7.7,,2458000.5,221.040689061193,.07468659738816442,36.55746018413618,6.553750801568296,127.4844023426362,337.9478552402734,56.06084421507061,,
N,N,," 15874 (1996 TL66)",15874,5.4,,2458000.5,752.434466704501,.5765727809780552,82.72567494353629,24.02066865838157,217.8481516250407,184.4869705901423,7.787502110294972,12.,
N,N,," 15875 (1996 TP66)",15875,7.0,,2458000.5,245.487604135007,.3276214885109567,39.20555234232803,5.693042994660483,316.7706828912174,75.13300593696664,25.5360282560322,,
N,N,," 15883 (1997 CR29)",15883,7.1,,2458000.5,324.282539644901,.2108971349769096,47.20017138142993,19.15169277617993,127.1932966607755,301.9381658289097,68.58606181163469,,

each line corresponds to an asteroid
:hi:

Joshoctober16
Posts: 5
Joined: 28.08.2018
With us: 1 month 22 days

Post #2by Joshoctober16 » 04.10.2018, 11:25

uh i think a strange glitch happend and erased step 4 and 5? also uh after for example the little example on the bottom like what do i do with that on excel? (i dont know much about excel sorry).

Avatar
Topic author
gironde M
Posts: 276
Joined: 16.12.2016
Age: 66
With us: 1 year 10 months
Location: Montigny-Les-Metz, Grand Est, Lorraine, Moselle, France

Post #3by gironde » 04.10.2018, 11:27

Then, open the txt / csv file in a blank Excel spreadsheet using the file opening txt, csv filter.

then you have to format the columns to get this (the order is important)
Sans titre 2.jpg

I planned a macro in Excel that when called, it generates me the lines for ssc. This is why the order of the columns is important.

Working with macros is tricky and does not allow mistakes. It is necessary to know the language vba of Excel which in addition is different according to the Excel versions.

Excel does not know how to generate return, linefeed and tabs that can be exploited in notepad ++, that's why I use sequences of characters that will be interpreted in notepad ++ for a final adaptation.

sTAB for a tabulation
sCRLF for a line break (return + linefeed)
CHR (34) represents "

In notepad ++ in extended mode, a search / replace must replace:
sTAB by \ t
sCRLF by \ r \ n
CHR (34) by "

It sounds complicated, and it is, but effective

attached a spreadsheet that contains the macro (the result is retrieved in column 24)
Attachments
Modele classeur après extraction.zip
(12.54 KiB) Downloaded 2 times


Return to “Tutorials”

Who is online

Users browsing this forum: 2 guests