Closed HajimeKawahara closed 2 years ago
Hi @HajimeKawahara,
Sorry to hear that you are having problems with the code. My first thought would be that GMAT is not executing correctly, and therefore is not producing the required output file.
Could you send over the contents of the /assam/propagator/GMAT/
directory? I will take a look to see if there is an issue with the generated files.
Kind regards,
Max
@maxhlc Thank you for the quick reply! here is the contents.
beecomb ~/assam/assam/propagator/GMAT(main)>ls -lh
total 16K
-rw-rw-r-- 1 kawahara kawahara 6.6K Nov 25 12:31 GMAT_modified.script
-rw-rw-r-- 1 kawahara kawahara 6.5K Nov 25 12:14 GMAT_template.script
Ok, that definitely means that GMAT is not executing as there is no output. Could you send the GMAT_modified.script
file?
Here is GMAT_modified.script
:
https://gist.github.com/HajimeKawahara/ae5bdd7acdf208c00dd5eaab65142a49
Thank you.
It looks like it is formatted correctly. Does the script run (and produce the output file) if you execute it manually through the GMAT GUI?
Ah, I see. This looks related to how to call GMAT. I use the Linux version of GMAT, in a remote environment (GUI unavailable), gmat-ubuntu-x64-R2020a.tar.gz, downloaded here. But, probably I should use the Windows version instead.
In theory it should be OS agnostic, however on the Python side I might have implemented it in a way that only works on Windows.
GMAT is called by GMATInterface.execute_script()
in assam/propagator/gmat_interface.py
. Lines 135-141 of that file define the command that is executed, under the assumption that GMAT is on the system path. It might be as simple as updating command = "GMAT"
to instead use the full path to the GMAT executable.
Thank you! @maxhlc In fact, it worked after some correction of the lines you specified!
@ykawashima, this procedure allows me to execute python main.py
(in Ubuntu 20.04 environment)
Download gmat-ubuntu-x64-R2020a.tar.gz, from here. Ungzip it. Copy R2020a/lib/* to /usr/lib or just set LD_LIBRARY_PATH to this directory.
assam/propagator/gmat_interface.py
The executable on CUI is GMAT/R2020a/bin/GmatConsole
. You don't need -m -x flags in this case. So, for instance,
# Define command to run GMAT
# command = "GMAT"
command = "/home/kawahara/GMAT/R2020a/bin/GmatConsole"
# Define flags when running GMAT
# (-r: run script, -m: run minimised, -x: exit when finished)
# flags = "-r -m -x"
flags = "-r"
cd assam
python main.py
This results in
beecomb ~/assam(features/linux)>python main.py
/home/kawahara/anaconda3/lib/python3.7/site-packages/pandas/compat/_optional.py:138: UserWarning: Pandas requires version '2.7.0' or newer of 'numexpr' (version '2.6.8' currently installed).
warnings.warn(msg, UserWarning)
/home/kawahara/assam/assam/propagator/GMAT/GMAT_output.dat <==
GMAT Execution: 0%| | 0/1 [00:00<?, ?it/s]
********************************************
*** GMAT Console Application
********************************************
General Mission Analysis Tool
Console Based Version
Build Date: Apr 30 2020 09:12:53
GMAT working directory set to '/home/kawahara/GMAT/R2020a/bin/'
Moderator is updating data files...
Moderator is creating core engine...
libmx.so: cannot open shared object file: No such file or directory
*** Library "../plugins/libMatlabInterface" did not open.
Skipping "../plugins/libOpenFramesInterface": GUI plugins are skipped in console mode
Successfully set Planetary Source to use: DE405
Successfully set Planetary Source to use: DE405
Successfully set Planetary Source to use: DE405
Setting nutation file to ../data/planetary_coeff/NUTATION.DAT
Setting leap seconds file to ../data/time/tai-utc.dat
2021-11-26 08:08:12 GMAT Moderator successfully created core engine
Interpreting scripts from the file.
***** file: /home/kawahara/assam/assam/propagator/GMAT/GMAT_modified.script
Successfully set Planetary Source to use: DE405
Successfully set Planetary Source to use: DE405
Successfully interpreted the script
.................... Print out the whole sequence ........................................
Command::NoOp
Command::BeginMissionSequence
Command::Propagate
.................... End sequence ........................................................
Running mission...
Successfully set Planetary Source to use: DE405
Successfully set Planetary Source to use: DE405
Kernel ../data/planetary_ephem/spk/DE405AllPlanets.bsp has been loaded.
Kernel ../data/planetary_coeff/SPICEPlanetaryConstantsKernel.tpc has been loaded.
Kernel ../data/time/SPICELeapSecondKernel.tls has been loaded.
Kernel ../data/planetary_coeff/SPICEEarthPredictedKernel.bpc has been loaded.
Kernel ../data/planetary_coeff/SPICEEarthCurrentKernel.bpc has been loaded.
Kernel ../data/planetary_coeff/earth_latest_high_prec.bpc has been loaded.
Kernel ../data/planetary_coeff/SPICELunaCurrentKernel.bpc has been loaded.
Kernel ../data/planetary_coeff/SPICELunaFrameKernel.tf has been loaded.
Mission run completed.
===> Total Run Time: 57.917 seconds
========================================
*** GMAT Integration test (Console version) successful! ***
Moderator is deleting core engine...
GMAT Execution: 100%|█████████████████████████████████████████████████████████████████████| 1/1 [00:58<00:00, 58.20s/it]
Downloading https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets/de430.bsp
|==================================================================================| 119M/119M (100.00%) 4s
Solar Body Generation: 100%|████████████████████████████████████████████████████████████| 10/10 [00:35<00:00, 3.56s/it]
Target Generation: 100%|██████████████████████████████████████████████████████████████| 350/350 [00:30<00:00, 11.60it/s]
Target Visibility: 100%|██████████████████████████████████████████████████████████████| 350/350 [01:48<00:00, 3.23it/s]
Target Contacts: 100%|████████████████████████████████████████████████████████████████| 350/350 [05:22<00:00, 1.09it/s]
Target Overall Statistics: 100%|█████████████████████████████████████████████████████| 350/350 [00:01<00:00, 208.73it/s]
Calculating Predecessors: 100%|████████████████████████████████████████████| 1359750/1359750 [00:27<00:00, 50221.56it/s]
Scheduling: 100%|██████████████████████████████████████████████████████████| 1359750/1359750 [00:33<00:00, 40662.66it/s]
The colormap="crest" does not work on my environment, so needed to modify, but anyway it worked! Thanks a lot @maxhlc.
Thank you very much @maxhlc and @HajimeKawahara !! It worked in my environment too.
I'm glad to hear that this resolved the issue!
@maxhlc @kawatadaisuke
@ykawashima and I are now trying to use assam. Thank you for sharing this code! Our question is, when performing main.py, we had the same error on GMAT_output.dat Can you show us some tutorial to start to use assam?
Best
Hajime Kawahara