COMPASS  5.4.4
End-to-end AO simulation tool using GPU acceleration
common/atmos.py
1 import numpy as np
2 import json
3 
4 def atmos_to_json(atmos, name=""):
5  """return a json description of a the atmos
6 
7  Args:
8  atmos : (Param_atmos) : compass atmospheric parameters
9  """
10  json_atm = {
11  "nLayer" : atmos.get_nscreens(),
12  "r0" : atmos.get_r0(),
13  "h" : atmos.get_alt().tolist(),
14  "fracCn2" : atmos.get_frac().tolist(),
15  "L0" : atmos.get_L0().tolist(),
16  "windDir" : atmos.get_winddir().tolist(),
17  "windSpeed" : atmos.get_windspeed().tolist()
18  }
19  if(name != ""):
20  json_atm["name"] = name
21  return json_atm
22 
23 
25  notice = {
26  "name": " : profile name",
27  "nLayer": " : number of layers in the turbulent profile",
28  "r0": "r0 at 500 nm (fried parameter)",
29  "h": " meter : (list) altitude of each layer",
30  "fracCn2": " percent : (list) cn2 fraction of each layer",
31  "L0": "meter : (list) outer scale of each layer",
32  "windDir": " degree : (list) wind sirection of each layer",
33  "windSpeed": " meter/s : (list) wind speed of each layer"
34  }
35  return notice
def atmos_json_notice()
Definition: common/atmos.py:24
def atmos_to_json(atmos, name="")
return a json description of a the atmos
Definition: common/atmos.py:9