SE-tool for operation scenario analysis
operation-scneario # 運用シナリオ解析
├─ docs # 関連メモ (削除するかも)
│
├─ csv # 運用シナリオ情報 (CSV): 結果がここに出力される
│
├─ json # 設計情報管理
│ ├─ components # コンポーネント情報 (Ex: 製品名, 電力, 熱特性, 重量)
│ │
│ ├─ operation-scenario # 運用シナリオ (現在はまだ使用されていない.)
│ │
│ ├─ operation_mode # 運用 (電源) モード (Ex: 機器動作モード)
│ │
│ ├─ orbit # 軌道情報
│ │
│ └─ spacecraft # 宇宙機情報
│
├─ notebook # 解析Jupyter Notebookファイル
│ └─ test_analysis.ipynb # 試験用解析
│
├─ src # 解析用モジュール
│ ├─ db_loader.py # データベース読み込みクラス
│ │
│ └─ operation_scenario.py # 運用シナリオ解析クラス
│
├─ README.md #
└─ requirements.txt #
pip3 install -r requirements.txt
If you want to make a local environment, use venv package
python3 -m venv venv
. venv/bin/activate
pip3 install -r requirements.txt
We recommend to use the json_editor. By uploading the schema files, you can edit json files using a GUI.
File Name | Description |
---|---|
json/components/(Subsystem)_(ComponentName).json | json files for components |
json/components/component_schema.json | json schema for components |
json/operation_mode/(MissionName)/(Mode_Name).json | json files for operation (power) mode. Defined for each mission |
json/operation_mode/(MissionName)/_Mode2Pointing.json | json file that assigns pointing direction for each operation mode. |
json/spacecraft/(SpacecraftName).json | json file for spacecraft configurations. |
Refer to test_analysis.ipynb for examples.
Basic flows for writing jupyter notebook analysis files are shown below.
Step1. Define mission name and load json files using DBLoader.
json_basedir = '../json'
spacecraft_name = "NSPO"
db_loader = DBLoader(json_basedir, spacecraft_name)
Step2: Define operation scenario parameters (Ex: orbit parameters) and initialize OperationScenario Class.
mode2pointing_file = os.path.join(json_basedir,"operation_mode","NSPO","_Mode2Pointing.json")
mode2pointing = json.load(open(mode2pointing_file,"r"))
ops = OperationSceneario(altitude=400, beta=72/180*np.pi, t0_sun_ratio=0, pass_time_average=400,
mode2pointing=mode2pointing, dt=30)
Step3: Assign baseline opration Modes
ops.alloc_operation_mode_to_ecp_type([2,3], 'Eclipse')
ops.alloc_operation_mode_to_ecp_type([0,1], 'AOCS_Keeping_Sun_Pointing')
Step4: Overwrite operation mode using trigger functions
operaion_modes = ["AOCS_Unloading"]
durations = [1800]
trigger_ecp_type = 1 # sun + non-pass
shift_t = 540
ops.alloc_operation_modes_by_ecp_type_trigger(operation_modes=operaion_modes, durations=durations,
trigger_ecp_type=trigger_ecp_type,
shift_t=shift_t)
Step5: Run calculation
ops.run(db_loader.sp_dict)
Step6: Postprocessing
There are example of visualizing generated power transition and eclipse/pass trainsition in json/testanalysis.ipynb
You can output the operation dataframe to a csv file using the following function
ops.dataframe.to_csv("../csv/(Filename).csv")