Skip to content

MGRAV.TXT

Eric E Palmer edited this page Oct 23, 2026 · 1 revision

MGRAV.TXT

Description

MGRAV.TXT is the output from Mgrav.e. This is a bigmap specific data file, similar to SGRAV.TXT. It contains the size of the map, as well as many useful parameters.

  • Line one: imax and jmax (the width of the map)
  • Line two: Position of v (center point?), a 3 component vector (v(k), k1,3)
  • All following lines: (vertex i, j, k and potential, acceleration, slope, elevation). The vertex positions should be identical to the map (maplet or bigmap) that you specified (i.e., row and column format of equal spacing along the surface of the object). * Column 4 is potential???.
  • Column 5 is acceleration (km/s/s). From a review of the output, I grossly assume that it is the gravitational acceleration at that location with respect to a constant height over the entire map (from the middle point of the map).
  • Column 6 is slope (degrees).
  • Column 7 is elevation (km?). Elevation is based upon the deviation from the center point of the map. You will find that the middle of every map will be 0.
        2049        2049
   57.145420074462891       -15.315745353698730       -220.78500366210938     
    0.13277E+03   -0.71393E+02   -0.18624E+03   -0.69832E-01    0.24570E-03    0.95146E+02   -0.47969E+01
    0.13276E+03   -0.71325E+02   -0.18628E+03   -0.69828E-01    0.24570E-03    0.11549E+03   -0.47811E+01
    0.13276E+03   -0.71257E+02   -0.18632E+03   -0.69825E-01    0.24571E-03    0.11527E+03   -0.47653E+01
    0.13275E+03   -0.71189E+02   -0.18636E+03   -0.69821E-01    0.24571E-03    0.11522E+03   -0.47512E+01
    0.13275E+03   -0.71121E+02   -0.18640E+03   -0.69818E-01    0.24572E-03    0.64173E+02   -0.47387E+01
    0.13274E+03   -0.71053E+02   -0.18643E+03   -0.69815E-01    0.24573E-03    0.11524E+03   -0.47271E+01
    0.13274E+03   -0.70985E+02   -0.18646E+03   -0.69813E-01    0.24574E-03    0.64958E+02   -0.47172E+01
    0.13273E+03   -0.70917E+02   -0.18650E+03   -0.69811E-01    0.24576E-03    0.11555E+03   -0.47081E+01
....


Script

Here is a simple perl script that will rip off columns. You run this in unix by "perl scriptname > output.txt"


open FILE, "MGRAV.TXT" or die $!;

$data=<FILE>;
chomp ($line);
$data =~ s/\s+/\t/g;
@items = split('  ', $data);  # Break line into an array
$i=$items[1];
$j=$items[2];

$dump=<FILE>;

$cnt=0;
while (<FILE>) {
   chomp;                  # remove trailing linefeed
   $data = $_;             # 
   $data =~ s/\s+/\t/g;    # convert blocks of spaces to tabs
   @items = split('  ', $data);  # Break line into an array

   printf ("%3.5f ", $items[7]);    # slope


   $cnt++;
   if ($cnt >= $i) {
      $cnt=0;
      printf ("\n");
   };
}
close (FILE);
printf ("\n");


Clone this wiki locally