cpism.html 128 KB
Newer Older
GZhao's avatar
GZhao committed
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
</li>
<li><dl class="simple">
<dt>expt: float</dt><dd><ul>
<li><p>Exposure time of the each image.</p></li>
</ul>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>nframe: int</dt><dd><ul>
<li><p>Number of frames in the image.</p></li>
</ul>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>emgain: int</dt><dd><ul>
<li><p>EM gain of the camera.</p></li>
</ul>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>obsid: str</dt><dd><ul>
<li><p>Observation ID. Obsid must be 11 digits and start with 5 for CPIC. See pharse_obsid() for details.</p></li>
</ul>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>rotation: float</dt><dd><ul>
<li><p>Rotation angle of the image.</p></li>
</ul>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>shift: list</dt><dd><ul>
<li><p>Shift of the image.</p></li>
</ul>
</dd>
</dl>
</li>
</ul>
</p></li>
<li><p><strong>gnc_info</strong> (<em>dict</em>) – Dictionary of GNC information.
Contains the keywords in the primary header. See primary_hdu() for details.</p></li>
<li><p><strong>csst_format</strong> (<em>bool</em><em>, </em><em>optional</em>) – Whether to save the fits file in CSST format, by default True.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="csst_cpic_sim.io.save_fits_simple">
<span class="sig-prename descclassname"><span class="pre">csst_cpic_sim.io.</span></span><span class="sig-name descname"><span class="pre">save_fits_simple</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">images</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">obs_info</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">output_folder</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'./'</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#csst_cpic_sim.io.save_fits_simple" title="Permalink to this definition"></a></dt>
<dd><p>Save the image to a fits file with a simple header to TMP directory.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>images</strong> (<em>numpy.ndarray</em>) – Image array to be written.</p></li>
<li><p><strong>obs_info</strong> (<em>dict</em>) – Dictionary of observation informations. See <cite>save_fits</cite> function.</p></li>
</ul>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>Filename of the saved fits file.</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="csst_cpic_sim.io.set_up_logger">
<span class="sig-prename descclassname"><span class="pre">csst_cpic_sim.io.</span></span><span class="sig-name descname"><span class="pre">set_up_logger</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">log_dir</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#csst_cpic_sim.io.set_up_logger" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</section>
<section id="csst-cpic-sim-config-module">
<h2>csst_cpic_sim.config module<a class="headerlink" href="#csst-cpic-sim-config-module" title="Permalink to this heading"></a></h2>
<span class="target" id="module-csst_cpic_sim.config"></span><dl class="py function">
<dt class="sig sig-object py" id="csst_cpic_sim.config.iso_time">
<span class="sig-prename descclassname"><span class="pre">csst_cpic_sim.config.</span></span><span class="sig-name descname"><span class="pre">iso_time</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">time</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#csst_cpic_sim.config.iso_time" title="Permalink to this definition"></a></dt>
<dd><p>Transfer relative time to iso time format</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>time</strong> (<em>str</em><em> or </em><em>float</em>) – The relative time in seconds.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The iso time format.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="csst_cpic_sim.config.load_refdata_path">
<span class="sig-prename descclassname"><span class="pre">csst_cpic_sim.config.</span></span><span class="sig-name descname"><span class="pre">load_refdata_path</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">config_aim</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#csst_cpic_sim.config.load_refdata_path" title="Permalink to this definition"></a></dt>
<dd><p>Load refdata path.
The refdata path is stored in config_aim file. If not found, set it.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>config_aim</strong> (<em>str</em>) – config_aim file path</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="csst_cpic_sim.config.relative_time">
<span class="sig-prename descclassname"><span class="pre">csst_cpic_sim.config.</span></span><span class="sig-name descname"><span class="pre">relative_time</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">time</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#csst_cpic_sim.config.relative_time" title="Permalink to this definition"></a></dt>
<dd><p>Transfer iso time format to relative time in seconds</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>time</strong> (<em>str</em><em> or </em><em>float</em>) – The iso time format.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The relative time in seconds.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>float</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="csst_cpic_sim.config.replace_cpism_refdata">
<span class="sig-prename descclassname"><span class="pre">csst_cpic_sim.config.</span></span><span class="sig-name descname"><span class="pre">replace_cpism_refdata</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">config</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">dict</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">output</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'$'</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">None</span></span></span><a class="headerlink" href="#csst_cpic_sim.config.replace_cpism_refdata" title="Permalink to this definition"></a></dt>
<dd><p>Replace the cpism_refdata in the config.
In the config file, we use ${cpism_refdata} to indicate the cpism_refdata.
This function is used to replace the cpism_refdata in the config, or replace back.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>config</strong> (<em>dict</em>) – config dict.</p></li>
<li><p><strong>output</strong> (<em>str</em>) – ‘$’ or ‘other’. If output is ‘$’, then replace the cpism_refdata in the config with ${cpism_refdata}.
If output is ‘other’, then replace the ${cpism_refdata} in the config file with the real path.
‘$’ is used meanly to generate a demo config file.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="csst_cpic_sim.config.setup_config">
<span class="sig-prename descclassname"><span class="pre">csst_cpic_sim.config.</span></span><span class="sig-name descname"><span class="pre">setup_config</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">new_config</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#csst_cpic_sim.config.setup_config" title="Permalink to this definition"></a></dt>
<dd><p>Set up config from a dict.
Some of the configs need to calcuate.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>new_config</strong> (<em>dict</em>) – new config dict.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>None</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="csst_cpic_sim.config.which_focalplane">
<span class="sig-prename descclassname"><span class="pre">csst_cpic_sim.config.</span></span><span class="sig-name descname"><span class="pre">which_focalplane</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">band</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#csst_cpic_sim.config.which_focalplane" title="Permalink to this definition"></a></dt>
<dd><p>Return the name of the focalplane which the band belongs to.
right now only support vis</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>band</strong> (<em>str</em>) – The name of the band.</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The name of the focalplane.
‘vis’ or ‘nir’ or ‘wfs’</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>str</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><p><strong>ValueError</strong> – If the band is not in [‘f565’, ‘f661’, ‘f743’, ‘f883’, ‘f940’, ‘f1265’, ‘f1425’, ‘f1542’, ‘wfs’]</p>
</dd>
</dl>
</dd></dl>

</section>
<section id="csst-cpic-sim-utils-module">
<h2>csst_cpic_sim.utils module<a class="headerlink" href="#csst-cpic-sim-utils-module" title="Permalink to this heading"></a></h2>
<span class="target" id="module-csst_cpic_sim.utils"></span><dl class="py class">
<dt class="sig sig-object py" id="csst_cpic_sim.utils.Logger">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">csst_cpic_sim.utils.</span></span><span class="sig-name descname"><span class="pre">Logger</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">filename</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">level</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'INFO'</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#csst_cpic_sim.utils.Logger" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="csst_cpic_sim.utils.psf_imshow">
<span class="sig-prename descclassname"><span class="pre">csst_cpic_sim.utils.</span></span><span class="sig-name descname"><span class="pre">psf_imshow</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">psf</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">vmin</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1e-08</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">vmax</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">0.1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">log</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">region</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#csst_cpic_sim.utils.psf_imshow" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="csst_cpic_sim.utils.random_seed_select">
<span class="sig-prename descclassname"><span class="pre">csst_cpic_sim.utils.</span></span><span class="sig-name descname"><span class="pre">random_seed_select</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">seed</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">-</span> <span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#csst_cpic_sim.utils.random_seed_select" title="Permalink to this definition"></a></dt>
<dd><p>Select a random seed for numpy.random and return it.</p>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="csst_cpic_sim.utils.region_replace">
<span class="sig-prename descclassname"><span class="pre">csst_cpic_sim.utils.</span></span><span class="sig-name descname"><span class="pre">region_replace</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">background</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">front</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">shift</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">bmask</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">1.0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fmask</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">1.0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">padded_in</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">padded_out</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">subpix</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#csst_cpic_sim.utils.region_replace" title="Permalink to this definition"></a></dt>
<dd><p>replace a region of the background with the front image.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>background</strong> (<em>np.ndarray</em>) – The background image.</p></li>
<li><p><strong>front</strong> (<em>np.ndarray</em>) – The front image.</p></li>
<li><p><strong>shift</strong> (<em>list</em>) – The [x, y] shift of the front image. Unit: pixel.
Relative to the lower-left corner of the background image.
[0, 0] means the lower-left corner of the front image is at the lower-left corner of the background image.</p></li>
<li><p><strong>bmask</strong> (<em>float</em>) – The mask of the background image. Default: 1.0
0.0 means the background image is masked.
1.0 means the background image is fully added.</p></li>
<li><p><strong>fmask</strong> (<em>float</em>) – The mask of the front image. Default: 1.0
0.0 means the front image is masked (not added).
1.0 means the front image is fully added.</p></li>
<li><p><strong>padded_in</strong> (<em>bool</em>) – Whether the input background image is padded. Default: False
In the function, the background image is padded by the size of the front image.
If True, means the background image is padded.</p></li>
<li><p><strong>padded_out</strong> (<em>bool</em>) – Whether the output image is padded. Default: False
In the function, the background image is padded by the size of the front image.
If True, means the output image is padded.
padded_in and padded_out are designed for the case that replace_region fuction is called multiple times.</p></li>
<li><p><strong>subpix</strong> (<em>bool</em>) – Whether the shift is subpixel. Default: False
If True, the shift is subpixel, using scipy.ndimage.shift to shift the front image.
If False, the shift is integer, using numpy slicing to shift the front image.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The output image.
shape = background.shape if padded_out = False
shape = background.shape + 2 * front.shape if padded_out = True</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>np.ndarray</p>
</dd>
</dl>
</dd></dl>

</section>
<section id="module-csst_cpic_sim">
<span id="module-contents"></span><h2>Module contents<a class="headerlink" href="#module-csst_cpic_sim" title="Permalink to this heading"></a></h2>
<dl class="py class">
<dt class="sig sig-object py" id="csst_cpic_sim.CosmicRayFrameMaker">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">csst_cpic_sim.</span></span><span class="sig-name descname"><span class="pre">CosmicRayFrameMaker</span></span><a class="headerlink" href="#csst_cpic_sim.CosmicRayFrameMaker" title="Permalink to this definition"></a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Cosmic ray frame maker.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>depth</strong> (<em>float</em>) – The depth of the camera pixel in um.</p></li>
<li><p><strong>pitch</strong> (<em>float</em>) – The pitch of the camera pixel in um.</p></li>
<li><p><strong>cr_rate</strong> (<em>float</em>) – The cosmic ray rate per second per cm2.</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="csst_cpic_sim.CosmicRayFrameMaker.make_CR">
<span class="sig-name descname"><span class="pre">make_CR</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">length</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sigma</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">seed</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">-</span> <span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#csst_cpic_sim.CosmicRayFrameMaker.make_CR" title="Permalink to this definition"></a></dt>
<dd><p>make a image of cosmic ray with given length and sigma.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>length</strong> (<em>int</em>) – The length of the cosmic ray in pixel.</p></li>
<li><p><strong>sigma</strong> (<em>float</em>) – The width of the cosmic ray in pixel.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>output</strong> – The image of cosmic ray.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="csst_cpic_sim.CosmicRayFrameMaker.make_cr_frame">
<span class="sig-name descname"><span class="pre">make_cr_frame</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">shape</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">expt</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">seed</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">-</span> <span class="pre">1</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#csst_cpic_sim.CosmicRayFrameMaker.make_cr_frame" title="Permalink to this definition"></a></dt>
<dd><p>make a cosmic ray frame.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>shape</strong> (<em>list</em>) – The size of the image in pixel.</p></li>
<li><p><strong>expt</strong> (<em>float</em>) – The exposure time in second.</p></li>
<li><p><strong>seed</strong> (<em>int</em><em>, </em><em>optional</em>) – The random seed. The default is -1. If seed is -1, the seed will be randomly selected.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>image</strong> – The cosmic ray frame.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="csst_cpic_sim.CosmicRayFrameMaker.random_CR_parameter">
<span class="sig-name descname"><span class="pre">random_CR_parameter</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">expt</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">pixsize</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#csst_cpic_sim.CosmicRayFrameMaker.random_CR_parameter" title="Permalink to this definition"></a></dt>
<dd><p>randomly generate cosmic ray parameters, including number, length, flux, sigma and angle.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>expt</strong> (<em>float</em>) – The exposure time in second.</p></li>
<li><p><strong>pixsize</strong> (<em>list</em>) – The size of the image in pixel.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>CRs</strong> – A list of cosmic ray objects.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>list</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="csst_cpic_sim.extract_target_x_y">
<span class="sig-prename descclassname"><span class="pre">csst_cpic_sim.</span></span><span class="sig-name descname"><span class="pre">extract_target_x_y</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">target</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">dict</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">ra0</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dec0</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">str</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">tuple</span></span></span><a class="headerlink" href="#csst_cpic_sim.extract_target_x_y" title="Permalink to this definition"></a></dt>
<dd><p>extract x, y of target from target dict</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>target</strong> (<em>dict</em>) – target dict. must contain either (ra, dec) or (pangle, spearation)</p></li>
<li><p><strong>ra0</strong> (<em>str</em>) – ra of center star. must be provided if (ra, dec) of target is used</p></li>
<li><p><strong>dec0</strong> (<em>str</em>) – dec of center star. must be provided if (ra, dec) of target is used</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>x, y</strong> – x, y of target in arcsec</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>float</p>
</dd>
<dt class="field-even">Raises</dt>
<dd class="field-even"><ul class="simple">
<li><p><strong>ValueError</strong> – if (ra, dec) of target is used but (ra, dec) of center star is not provided.</p></li>
<li><p><strong>ValueError</strong> – one of (ra, dec) or (pangle, spearation) is not provided.</p></li>
</ul>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="csst_cpic_sim.focal_mask">
<span class="sig-prename descclassname"><span class="pre">csst_cpic_sim.</span></span><span class="sig-name descname"><span class="pre">focal_mask</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">image</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">iwa</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">platescale</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">throughtput</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1e-06</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#csst_cpic_sim.focal_mask" title="Permalink to this definition"></a></dt>
<dd><p>Mask the image outside the inner working angle.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>image</strong> (<em>np.ndarray</em>) – The image to be masked.</p></li>
<li><p><strong>iwa</strong> (<em>float</em>) – The inner working angle. Unit: arcsec.</p></li>
<li><p><strong>platescale</strong> (<em>float</em>) – The platescale of the image. Unit: arcsec/pixel.</p></li>
<li><p><strong>throughtput</strong> (<em>float</em>) – The throughtput of the mask. The default is 1e-6.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>The masked image.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>np.ndarray</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="csst_cpic_sim.planet_contrast">
<span class="sig-prename descclassname"><span class="pre">csst_cpic_sim.</span></span><span class="sig-name descname"><span class="pre">planet_contrast</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">planet_x_au</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">planet_y_au</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">phase_angle</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">radius</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">float</span></span></span><a class="headerlink" href="#csst_cpic_sim.planet_contrast" title="Permalink to this definition"></a></dt>
<dd><p>calculate the contrast of a planet</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>planet_x_au</strong> (<em>float</em>) – x position of the planet in au</p></li>
<li><p><strong>planet_y_au</strong> (<em>float</em>) – y position of the planet in au</p></li>
<li><p><strong>phase_angle</strong> (<em>float</em>) – phase angle of the planet in degree</p></li>
<li><p><strong>radius</strong> (<em>float</em>) – radius of the planet in jupiter radius</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>contrast</strong> – contrast of the planet</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>float</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="csst_cpic_sim.quick_run_v2">
<span class="sig-prename descclassname"><span class="pre">csst_cpic_sim.</span></span><span class="sig-name descname"><span class="pre">quick_run_v2</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">target_str</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">band</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">expt</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">emgain</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">nframe</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">skybg</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Optional</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">]</span></span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">rotation</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">0</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">shift</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">list</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">[0,</span> <span class="pre">0]</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">emset_input</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cr_frame</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">camera_effect</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">True</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">prograss_bar</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">output</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'./'</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">ndarray</span></span></span><a class="headerlink" href="#csst_cpic_sim.quick_run_v2" title="Permalink to this definition"></a></dt>
<dd><p>A quick run function for CPIC.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>target_str</strong> (<em>str</em>) – target string. See the input of <cite>target.target_file_load</cite> for more details.</p></li>
<li><p><strong>band</strong> (<em>str</em>) – band name</p></li>
<li><p><strong>expt</strong> (<em>float</em>) – exposure time in unit of second</p></li>
<li><p><strong>emgain</strong> (<em>float</em>) – EM gain value. Note that emgain is not the same as emset, controled by emset_input keyword.</p></li>
<li><p><strong>nframe</strong> (<em>int</em>) – number of frames</p></li>
<li><p><strong>skybg</strong> (<em>float</em><em> or </em><em>None</em>) – sky background in unit of magnitude. If None, sky background will not be set.</p></li>
<li><p><strong>rotation</strong> (<em>float</em>) – rotation of the telescope. in unit of degree. 0 means North is up.</p></li>
<li><p><strong>shift</strong> (<em>list</em>) – target shift in unit of arcsec</p></li>
<li><p><strong>emset_input</strong> (<em>bool</em>) – if True, emgain paramter is emset. Else, emgain is set using emgain parameter.</p></li>
<li><p><strong>cr_frame</strong> (<em>bool</em>) – if True, cosmic ray frame will be added to the image.</p></li>
<li><p><strong>camera_effect</strong> (<em>bool</em>) – if True, camera effect will be added to the image.</p></li>
<li><p><strong>prograss_bar</strong> (<em>bool</em>) – if True, a prograss_bar will be shown.</p></li>
<li><p><strong>output</strong> (<em>str</em>) – the output directory.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>image_cube</strong></p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>np.ndarray</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="csst_cpic_sim.sky_frame_maker">
<span class="sig-prename descclassname"><span class="pre">csst_cpic_sim.</span></span><span class="sig-name descname"><span class="pre">sky_frame_maker</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">band</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">skybg</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">platescale</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">shape</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#csst_cpic_sim.sky_frame_maker" title="Permalink to this definition"></a></dt>
<dd><p>generate a sky background frame.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>band</strong> (<em>str</em>) – The band of the sky background.</p></li>
<li><p><strong>skybg</strong> (<em>str</em>) – The sky background file name.</p></li>
<li><p><strong>platescale</strong> (<em>float</em>) – The platescale of the camera in arcsec/pixel.</p></li>
<li><p><strong>shape</strong> (<em>tuple</em>) – The shape of the output frame. (y, x)</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>sky_bkg_frame</strong> – The sky background frame.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>numpy.ndarray</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="csst_cpic_sim.spectrum_generator">
<span class="sig-prename descclassname"><span class="pre">csst_cpic_sim.</span></span><span class="sig-name descname"><span class="pre">spectrum_generator</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">targets</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">dict</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">list</span></span></span><a class="headerlink" href="#csst_cpic_sim.spectrum_generator" title="Permalink to this definition"></a></dt>
<dd><p>generate the spectrum due to the input target list</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>targets</strong> (<em>dict</em>) – <p>target dictionary which contains keyword ‘cstar’ (necessary), ‘stars’(optional), ‘planets’ (optional).
The values are:
- cstar: dict</p>
<blockquote>
<div><ul class="simple">
<li><p>center star information. must contain keywords ra, dec, distance, magnitude, sptype</p></li>
</ul>
</div></blockquote>
<ul class="simple">
<li><dl class="simple">
<dt>objects: list of dict, optional, recommended! V2.0 new!</dt><dd><ul>
<li><p>list of targets. each dict must contain ra, dec, magnitude, sptype</p></li>
</ul>
</dd>
</dl>
</li>
</ul>
</p>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>obj_sp_list</strong> – list of [x, y, spectrum, image] of each target</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>list</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="csst_cpic_sim.star_photlam">
<span class="sig-prename descclassname"><span class="pre">csst_cpic_sim.</span></span><span class="sig-name descname"><span class="pre">star_photlam</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">magnitude</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">float</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">sptype</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">is_blackbody</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">mag_input_band</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">'f661'</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">ArraySourceSpectrum</span></span></span><a class="headerlink" href="#csst_cpic_sim.star_photlam" title="Permalink to this definition"></a></dt>
<dd><p>genrate flux spectrum of a star by its observal magnitude and spectral type</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>magnitude</strong> (<em>float</em>) – magnitude of the star</p></li>
<li><p><strong>sptype</strong> (<em>str</em>) – spectral type of the star</p></li>
<li><p><strong>is_blackbody</strong> (<em>bool</em>) – if True, use blackbody spectrum instead of ck04model</p></li>
<li><p><strong>mag_input_band</strong> (<em>str</em>) – bandpass of the input magnitude, default is f661</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>spectrum of the star in photlam unit</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>pysynphot.spectrum.ArraySpectrum</p>
</dd>
</dl>
</dd></dl>

<dl class="py function">
<dt class="sig sig-object py" id="csst_cpic_sim.vis_observation">
<span class="sig-prename descclassname"><span class="pre">csst_cpic_sim.</span></span><span class="sig-name descname"><span class="pre">vis_observation</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">target:</span> <span class="pre">dict,</span> <span class="pre">skybg:</span> <span class="pre">float,</span> <span class="pre">expt:</span> <span class="pre">float,</span> <span class="pre">nframe:</span> <span class="pre">int,</span> <span class="pre">band:</span> <span class="pre">str,</span> <span class="pre">emset:</span> <span class="pre">int,</span> <span class="pre">obsid:</span> <span class="pre">int</span> <span class="pre">=</span> <span class="pre">41000000000,</span> <span class="pre">rotation:</span> <span class="pre">float</span> <span class="pre">=</span> <span class="pre">0,</span> <span class="pre">shift:</span> <span class="pre">list</span> <span class="pre">=</span> <span class="pre">[0,</span> <span class="pre">0],</span> <span class="pre">gnc_info:</span> <span class="pre">dict</span> <span class="pre">=</span> <span class="pre">{},</span> <span class="pre">csst_format:</span> <span class="pre">bool</span> <span class="pre">=</span> <span class="pre">True,</span> <span class="pre">camera=&lt;csst_cpic_sim.camera.CpicVisEmccd</span> <span class="pre">object&gt;,</span> <span class="pre">crmaker=&lt;csst_cpic_sim.camera.CosmicRayFrameMaker</span> <span class="pre">object&gt;,</span> <span class="pre">nsample:</span> <span class="pre">int</span> <span class="pre">=</span> <span class="pre">1,</span> <span class="pre">emgain=None,</span> <span class="pre">prograss_bar=None,</span> <span class="pre">output='./'</span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><span class="pre">ndarray</span></span></span><a class="headerlink" href="#csst_cpic_sim.vis_observation" title="Permalink to this definition"></a></dt>
<dd><p>Observation simulation main process on visable band using EMCCD.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>target</strong> (<em>dict</em>) – target dictionary. See the input of <cite>target.spectrum_generator</cite> for more details.</p></li>
<li><p><strong>skybg</strong> (<em>float</em>) – sky background in unit of magnitude/arcsec^2</p></li>
<li><p><strong>expt</strong> (<em>float</em>) – exposure time in unit of second</p></li>
<li><p><strong>nframe</strong> (<em>int</em>) – number of frames</p></li>
<li><p><strong>band</strong> (<em>str</em>) – band name</p></li>
<li><p><strong>emset</strong> (<em>int</em>) – EM gain setting value. 1023(0x3FF) for ~1.0× EM gain.</p></li>
<li><p><strong>obsid</strong> (<em>int</em>) – observation ID. Start from 4 for CPIC, 01 for science observation. See the input of io.obsid_parser for more details.</p></li>
<li><p><strong>rotation</strong> (<em>float</em>) – rotation of the telescope. in unit of degree. 0 means North is up.</p></li>
<li><p><strong>shift</strong> (<em>list</em>) – target shift in unit of arcsec</p></li>
<li><p><strong>gnc_info</strong> (<em>dict</em>) – gnc_info dictionary. See the input of io.primary_hdu for more details.</p></li>
<li><p><strong>csst_format</strong> (<em>bool</em>) – if True, the output fits file will be in the csst format.</p></li>
<li><p><strong>crmaker</strong> (<a class="reference internal" href="#csst_cpic_sim.CosmicRayFrameMaker" title="csst_cpic_sim.CosmicRayFrameMaker"><em>CosmicRayFrameMaker</em></a>) – CosmicRayFrameMaker object. See the input of camera.CosmicRayFrameMaker for more details.</p></li>
<li><p><strong>nsample</strong> (<em>int</em>) – number of samples for wide bandpass.</p></li>
<li><p><strong>emgain</strong> (<em>float</em><em> or </em><em>None</em>) – if None, emgain are set using emset parameter. Else, emgain are set using emgain parameter.</p></li>
<li><p><strong>prograss_bar</strong> (<em>bool</em>) – if True, a prograss_bar will be shown.</p></li>
<li><p><strong>output</strong> (<em>str</em>) – the output directory.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p><strong>image_cube</strong></p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>np.ndarray</p>
</dd>
</dl>
</dd></dl>

</section>
</section>


           </div>
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="notebooks/5_psf_example.html" class="btn btn-neutral float-left" title="点扩散函数仿真" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2023, CSST/CPIC Group.</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>
For faster browsing, not all history is shown. View entire blame