I've been looking for documentation of the data fields used in the Location command, and I'm afraid I've not had much luck in finding any.
From information I've gathered from:
http://www.shatters.net/~t00fri/celestia/apidocs/classLocation.html#a9
http://www.shatters.net/~t00fri/celestia/apidocs/location_8cpp-source.html
http://www.shatters.net/~t00fri/celestia/apidocs/location_8h-source.html
...I find the following values are defined and applicable:
parent ("name" "path/")
position (LongLat)
size
importance
feature type (Type)
infourl (InfoURL)
Can someone define the following for me?
position - LongLat expressed as decimal degrees or ?
size - ???
importance - ???
locs.ssc file definitions?
-
Topic authorLordFerret
- Posts: 737
- Joined: 24.08.2006
- Age: 68
- With us: 18 years 3 months
- Location: NJ USA
- t00fri
- Developer
- Posts: 8772
- Joined: 29.03.2002
- Age: 22
- With us: 22 years 7 months
- Location: Hamburg, Germany
Re: locs.ssc file definitions?
LordFerret wrote:I've been looking for documentation
of the data fields used in the Location command, and I'm
afraid I've not had much luck in finding any.
From information I've gathered from:
...
...I find the following values are defined and applicable:
parent ("name" "path/")
position (LongLat)
size
importance
feature type (Type)
infourl (InfoURL)
Can someone define the following for me?
position - LongLat expressed as decimal degrees or ?
size - ???
importance - ???
As to the size and importance parameters, there are two aspects:
1) their definition and use in the Celestia code
2) their values set via my theoretical approach, designed
to avoid overlapping labels on the screen.
(1):
size and importance are /private/ variables of the
Location class. Hence in general, their use proceeds via
getImportance() and getSize() . The values for these
variables are read in solarsys.cpp and they are used in
render.cpp (lines 4715 ff in CVS) as you can easily find
out.
(2) :
The values attributed from my theoretical considerations
are derived in my commented Maple worksheet in this
thread
http://www.celestiaproject.net/forum/viewtopic ... ight=maple
with the reference for the worksheet being
http://www.celestiaproject.net/~t00fri/images/moon_weights.pdf
Anybody with a little math knowledge (beyond
highschool ) should be able to easily understand the
derivation
The resulting formulae are entered into a Perl script
Code: Select all
#!/usr/bin/perl
# Author: Fridger.Schrempp@desy.de
# Works with STDIN
use Math::Libm ':all';
open(LOCS, ">moon_locs3.ssc") || die "Can not create moon_locs3.ssc\n";
# boilerplate
($ver = "Revision: 1.0 ") =~ s/\$//g;
($me = $0) =~ s/.*\///;
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime;
$year += 1900;
$mon += 1;
print LOCS "# Processed $year-$mon-$mday $hour:$min:$sec UTC\n";
print LOCS "# by Dr. Fridger Schrempp, fridger.schrempp\@desy.de\n";
print LOCS "# ------------------------------------------------------ \n";
print LOCS "\n";
# number of visible labels at 40000km distance
$nLabs = 1.3*1.69;
$size = 0;
while (<>) {
if ($_ =~/Size (\d+\.*\d*)/){
$size =$1;
if ( $size != 0 ){
$Imp=-.1706114861+460.2441624*sqrt($nLabs)/sqrt(-4476.499998*erf(.6141851462*log($size)-1.697056275)+4476.499998);
printf LOCS " Size %6.2f\n", $size;
printf LOCS " Importance %6.2f\n", $Imp;
} else {
next;
}
} elsif ($_ =~/Type "(\w+)"/ && $size == 0){
$type = $1;
$size = 349.0 if ($type eq "CR");
$size = 661.3 if ($type eq "FL");
$size = 741.3 if ($type eq "FO");
$size = 1328.75 if ($type eq "LI");
$size = 299.56 if ($type eq "MO");
$size = 90.54 if ($type eq "PE");
$size = 2726.3 if ($type eq "PL");
$size = 2471.4 if ($type eq "RE");
$size=0.1;
$Imp=-.1706114861+460.2441624*sqrt($nLabs)/sqrt(-4476.499998*erf(.6141851462*log($size)-1.697056275)+4476.499998);
printf LOCS " Size %6.2f\n", $size;
printf LOCS " Importance %6.2f\n", $Imp;
printf LOCS " Type "%s"\n", $type;
# print STDOUT "$Imp\n";
} else {
print LOCS "$_";
}
}
that prints out the final location file moon_locs3.ssc to be
used in Celestia. The input file was not from Grant but
rather from the latest official IAU sources for the crater names on the USGS
site. It is correct, however, that
Grant had spotted that there was a major update and
notified me about this fact.
So far what I did.
For a number of other bodies including Venus & Mars, I
pursued an analogous proceedure for generating the
respective location files, distinguished by
non-overlapping labels!
In all cases the official IAU name files from the
USGS site were used with one exception: the complete
list of earth capitals (which was iterated many times
between Grant and myself) and notably my
Earth_Gazetteer file with 40000+ Earth locations. Only the Perl
script for the latter involves a UTF-8 module that
properly prints out UTF-8 notation for the various location
names on Earth.
Bye Fridger
-
Topic authorLordFerret
- Posts: 737
- Joined: 24.08.2006
- Age: 68
- With us: 18 years 3 months
- Location: NJ USA
Thankyou Fridger! I will read through the links you've provided. This information will be of great help, and I appreciate your taking the time to provide these definitions!
{FYI: I've never actually programmed in C language or Perl, however I can read and understand them both - they're very similar to other languages that I have worked with.}
Thanks again!
{FYI: I've never actually programmed in C language or Perl, however I can read and understand them both - they're very similar to other languages that I have worked with.}
Thanks again!