Skip to content

Commit 1449239

Browse files
authored
CoDICE L1A Lo species refactor and CDF attrs (IMAP-Science-Operations-Center#2313)
1 parent c6a1a11 commit 1449239

15 files changed

Lines changed: 1106 additions & 439 deletions

imap_processing/cdf/config/imap_codice_l1a_variable_attrs.yaml

Lines changed: 54 additions & 204 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ hi_priorities_attrs: &hi_priorities_default
6363
epoch_delta_minus:
6464
CATDESC: Time from acquisition start to acquisition center
6565
FIELDNAM: epoch_delta_minus
66-
FILLVAL: *int_fillval
67-
FORMAT: I18
66+
FILLVAL: *real_fillval
67+
FORMAT: F30.9
6868
LABLAXIS: epoch_delta_minus
6969
SCALETYP: linear
7070
UNITS: ns
@@ -75,13 +75,13 @@ epoch_delta_minus:
7575
epoch_delta_plus:
7676
CATDESC: Time from acquisition center to acquisition end
7777
FIELDNAM: epoch_delta_plus
78-
FILLVAL: *int_fillval
79-
FORMAT: I18
78+
FILLVAL: *real_fillval
79+
FORMAT: F30.9
8080
LABLAXIS: epoch_delta_plus
8181
SCALETYP: linear
8282
UNITS: ns
83-
VALIDMIN: *min_int
84-
VALIDMAX: *max_int
83+
VALIDMIN: *min_epoch
84+
VALIDMAX: *max_epoch
8585
VAR_TYPE: support_data
8686

8787
esa_step:
@@ -284,7 +284,7 @@ direct_events_attrs: &direct_events
284284
VALIDMIN: 0
285285
VALIDMAX: 10000
286286

287-
energy_table:
287+
voltage_table:
288288
CATDESC: ElectroStatic Analyzer Energy Values
289289
DEPEND_1: esa_step
290290
FIELDNAM: Energy Table
@@ -298,8 +298,9 @@ energy_table:
298298

299299
k_factor:
300300
CATDESC: K Factor constant that is used to convert voltages to energies
301+
DEPEND_1: spin_sector
301302
FIELDNAM: K Factor
302-
FORMAT: F5.2
303+
FORMAT: F6.2
303304
LABLAXIS: K Factor
304305
SCALETYP: linear
305306
UNITS: " "
@@ -1263,221 +1264,70 @@ lo-nsw-priority-p6_hplus_heplusplus:
12631264
LABL_PTR_1: spin_sector_label
12641265
LABL_PTR_2: esa_step_label
12651266

1266-
# lo-sw-species
1267-
lo-sw-species-hplus:
1268-
<<: *counters
1269-
CATDESC: H+ Sunward Species
1270-
FIELDNAM: SW - H+
1271-
DEPEND_1: esa_step
1272-
DEPEND_2: spin_sector
1273-
LABL_PTR_1: esa_step_label
1274-
LABL_PTR_2: spin_sector_label
1275-
1276-
lo-sw-species-heplusplus:
1277-
<<: *counters
1278-
CATDESC: He++ Sunward Species
1279-
FIELDNAM: SW - He++
1280-
DEPEND_1: esa_step
1281-
DEPEND_2: spin_sector
1282-
LABL_PTR_1: esa_step_label
1283-
LABL_PTR_2: spin_sector_label
1284-
1285-
lo-sw-species-cplus4:
1286-
<<: *counters
1287-
CATDESC: C+4 Sunward Species
1288-
FIELDNAM: SW - C+4
1289-
DEPEND_1: esa_step
1290-
DEPEND_2: spin_sector
1291-
LABL_PTR_1: esa_step_label
1292-
LABL_PTR_2: spin_sector_label
1293-
1294-
lo-sw-species-cplus5:
1295-
<<: *counters
1296-
CATDESC: C+5 Sunward Species
1297-
FIELDNAM: SW - C+5
1298-
DEPEND_1: esa_step
1299-
DEPEND_2: spin_sector
1300-
LABL_PTR_1: esa_step_label
1301-
LABL_PTR_2: spin_sector_label
1302-
1303-
lo-sw-species-cplus6:
1304-
<<: *counters
1305-
CATDESC: C+6 Sunward Species
1306-
FIELDNAM: SW - C+6
1307-
DEPEND_1: esa_step
1308-
DEPEND_2: spin_sector
1309-
LABL_PTR_1: esa_step_label
1310-
LABL_PTR_2: spin_sector_label
1311-
1312-
lo-sw-species-oplus5:
1313-
<<: *counters
1314-
CATDESC: O+5 Sunward Species
1315-
FIELDNAM: SW - O+5
1316-
DEPEND_1: esa_step
1317-
DEPEND_2: spin_sector
1318-
LABL_PTR_1: esa_step_label
1319-
LABL_PTR_2: spin_sector_label
1320-
1321-
lo-sw-species-oplus6:
1322-
<<: *counters
1323-
CATDESC: O+6 Sunward Species
1324-
FIELDNAM: SW - O+6
1325-
DEPEND_1: esa_step
1326-
DEPEND_2: spin_sector
1327-
LABL_PTR_1: esa_step_label
1328-
LABL_PTR_2: spin_sector_label
1329-
1330-
lo-sw-species-oplus7:
1331-
<<: *counters
1332-
CATDESC: O+7 Sunward Species
1333-
FIELDNAM: SW - O+7
1334-
DEPEND_1: esa_step
1335-
DEPEND_2: spin_sector
1336-
LABL_PTR_1: esa_step_label
1337-
LABL_PTR_2: spin_sector_label
1338-
1339-
lo-sw-species-oplus8:
1340-
<<: *counters
1341-
CATDESC: O+8 Sunward Species
1342-
FIELDNAM: SW - O+8
1343-
DEPEND_1: esa_step
1344-
DEPEND_2: spin_sector
1345-
LABL_PTR_1: esa_step_label
1346-
LABL_PTR_2: spin_sector_label
1347-
1348-
lo-sw-species-ne:
1349-
<<: *counters
1350-
CATDESC: Ne Sunward Species
1351-
FIELDNAM: SW - Ne
1352-
DEPEND_1: esa_step
1353-
DEPEND_2: spin_sector
1354-
LABL_PTR_1: esa_step_label
1355-
LABL_PTR_2: spin_sector_label
1356-
lo-sw-species-mg:
1357-
<<: *counters
1358-
CATDESC: Mg Sunward Species
1359-
FIELDNAM: SW - Mg
1360-
DEPEND_1: esa_step
1361-
DEPEND_2: spin_sector
1362-
LABL_PTR_1: esa_step_label
1363-
LABL_PTR_2: spin_sector_label
1364-
1365-
lo-sw-species-si:
1366-
<<: *counters
1367-
CATDESC: Si Sunward Species
1368-
FIELDNAM: SW - Si
1369-
DEPEND_1: esa_step
1370-
DEPEND_2: spin_sector
1371-
LABL_PTR_1: esa_step_label
1372-
LABL_PTR_2: spin_sector_label
1373-
lo-sw-species-fe_loq:
1374-
<<: *counters
1375-
CATDESC: Fe lowQ Sunward Species
1376-
FIELDNAM: SW - Fe lowQ
1377-
DEPEND_1: esa_step
1378-
DEPEND_2: spin_sector
1379-
LABL_PTR_1: esa_step_label
1380-
LABL_PTR_2: spin_sector_label
1381-
1382-
lo-sw-species-fe_hiq:
1383-
<<: *counters
1384-
CATDESC: Fe highQ Sunward Species
1385-
FIELDNAM: SW - Fe highQ
1386-
DEPEND_1: esa_step
1387-
DEPEND_2: spin_sector
1388-
LABL_PTR_1: esa_step_label
1389-
LABL_PTR_2: spin_sector_label
1390-
1391-
lo-sw-species-heplus:
1392-
<<: *counters
1393-
CATDESC: He+ Pickup Ion Sunward Species
1394-
FIELDNAM: SW - He+ (PUI)
1395-
DEPEND_1: esa_step
1396-
DEPEND_2: spin_sector
1397-
LABL_PTR_1: esa_step_label
1398-
LABL_PTR_2: spin_sector_label
1399-
1400-
lo-sw-species-cnoplus:
1401-
<<: *counters
1402-
CATDESC: CNO+ Pickup Ion Sunward Species
1403-
FIELDNAM: SW - CNO+ (PUI)
1404-
DEPEND_1: esa_step
1405-
DEPEND_2: spin_sector
1406-
LABL_PTR_1: esa_step_label
1407-
LABL_PTR_2: spin_sector_label
1408-
1409-
# lo-nsw-species
1410-
lo-nsw-species-hplus:
1411-
<<: *counters
1412-
CATDESC: H+ Non-sunward Species
1413-
FIELDNAM: NSW - H+
1414-
DEPEND_1: esa_step
1415-
DEPEND_2: spin_sector
1416-
LABL_PTR_1: esa_step_label
1417-
LABL_PTR_2: spin_sector_label
1418-
1419-
lo-nsw-species-heplusplus:
1420-
<<: *counters
1421-
CATDESC: He++ Non-sunward Species
1422-
FIELDNAM: NSW - He++
1423-
DEPEND_1: esa_step
1424-
DEPEND_2: spin_sector
1425-
LABL_PTR_1: esa_step_label
1426-
LABL_PTR_2: spin_sector_label
1427-
1428-
lo-nsw-species-c:
1429-
<<: *counters
1430-
CATDESC: C Non-sunward Species
1431-
FIELDNAM: NSW - C
1432-
DEPEND_1: esa_step
1433-
DEPEND_2: spin_sector
1434-
LABL_PTR_1: esa_step_label
1435-
LABL_PTR_2: spin_sector_label
1436-
1437-
lo-nsw-species-o:
1438-
<<: *counters
1439-
CATDESC: O Non-sunward Species
1440-
FIELDNAM: NSW - O
1441-
DEPEND_1: esa_step
1442-
DEPEND_2: spin_sector
1443-
LABL_PTR_1: esa_step_label
1444-
LABL_PTR_2: spin_sector_label
1445-
1446-
lo-nsw-species-ne_si_mg:
1447-
<<: *counters
1448-
CATDESC: Ne-Si-Mg Non-sunward Species
1449-
FIELDNAM: NSW - Ne_Si_Mg
1267+
# lo species attrs
1268+
lo-species-attrs:
1269+
CATDESC: "{species} {direction} Species"
1270+
DEPEND_0: epoch
14501271
DEPEND_1: esa_step
14511272
DEPEND_2: spin_sector
1273+
DISPLAY_TYPE: time_series
1274+
FIELDNAM: "{direction} - {species}"
1275+
FILLVAL: *int_fillval
1276+
FORMAT: I7
14521277
LABL_PTR_1: esa_step_label
14531278
LABL_PTR_2: spin_sector_label
1279+
UNITS: counts
1280+
VALIDMIN: 0
1281+
VALIDMAX: *max_uint32
1282+
VAR_TYPE: data
14541283

1455-
lo-nsw-species-fe:
1456-
<<: *counters
1457-
CATDESC: Fe Non-sunward Species
1458-
FIELDNAM: NSW - Fe
1284+
lo-pui-species-attrs:
1285+
CATDESC: "{species} Pickup Ion {direction} Species"
1286+
DEPEND_0: epoch
14591287
DEPEND_1: esa_step
14601288
DEPEND_2: spin_sector
1289+
DISPLAY_TYPE: time_series
1290+
FIELDNAM: "{direction} - {species}"
1291+
FILLVAL: *int_fillval
1292+
FORMAT: I7
14611293
LABL_PTR_1: esa_step_label
14621294
LABL_PTR_2: spin_sector_label
1295+
UNITS: counts
1296+
VALIDMIN: 0
1297+
VALIDMAX: *max_uint32
1298+
VAR_TYPE: data
14631299

1464-
lo-nsw-species-heplus:
1465-
<<: *counters
1466-
CATDESC: He+ Non-sunward Species
1467-
FIELDNAM: NSW - He+
1300+
lo-species-unc-attrs:
1301+
CATDESC: "{species} {direction} Species uncertainty"
1302+
DEPEND_0: epoch
14681303
DEPEND_1: esa_step
14691304
DEPEND_2: spin_sector
1305+
DISPLAY_TYPE: time_series
1306+
FIELDNAM: "{direction} - {species}"
1307+
FILLVAL: *real_fillval
1308+
FORMAT: F20.9
14701309
LABL_PTR_1: esa_step_label
14711310
LABL_PTR_2: spin_sector_label
1311+
UNITS: counts
1312+
VALIDMIN: 0
1313+
VALIDMAX: *max_uint32
1314+
VAR_TYPE: data
14721315

1473-
lo-nsw-species-cnoplus:
1474-
<<: *counters
1475-
CATDESC: CNO+ Non-sunward Species
1476-
FIELDNAM: NSW - CNO+
1316+
lo-pui-species-unc-attrs:
1317+
CATDESC: "{species} Pickup Ion {direction} Species uncertainty"
1318+
DEPEND_0: epoch
14771319
DEPEND_1: esa_step
14781320
DEPEND_2: spin_sector
1321+
DISPLAY_TYPE: time_series
1322+
FIELDNAM: "{direction} - {species}"
1323+
FILLVAL: *real_fillval
1324+
FORMAT: F20.9
14791325
LABL_PTR_1: esa_step_label
14801326
LABL_PTR_2: spin_sector_label
1327+
UNITS: counts
1328+
VALIDMIN: 0
1329+
VALIDMAX: *max_uint32
1330+
VAR_TYPE: data
14811331

14821332
# lo-ialirt
14831333
lo-ialirt-heplusplus:

imap_processing/cdf/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def load_cdf(
2929
3030
Parameters
3131
----------
32-
file_path : Path or ImapFilePath or str
32+
file_path : pathlib.Path or ImapFilePath or str
3333
The path to the CDF file or ImapFilePath object.
3434
remove_xarray_attrs : bool
3535
Whether to remove the xarray attributes that get injected by the
@@ -98,7 +98,7 @@ def write_cdf(
9898
9999
Returns
100100
-------
101-
file_path : Path
101+
file_path : pathlib.Path
102102
Path to the file created.
103103
"""
104104
# Create the filename from the global attributes

imap_processing/cli.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
# from imap_processing import cdf
5050
# In code:
5151
# call cdf.utils.write_cdf
52-
from imap_processing.codice import codice_l1a, codice_l1b, codice_l2
52+
from imap_processing.codice import codice_l1b, codice_l2, codice_new_l1a
5353
from imap_processing.glows.l1a.glows_l1a import glows_l1a
5454
from imap_processing.glows.l1b.glows_l1b import glows_l1b, glows_l1b_de
5555
from imap_processing.glows.l2.glows_l2 import glows_l2
@@ -612,14 +612,8 @@ def do_processing(
612612
datasets: list[xr.Dataset] = []
613613

614614
if self.data_level == "l1a":
615-
science_files = dependencies.get_file_paths(source="codice")
616-
if len(science_files) != 1:
617-
raise ValueError(
618-
f"CoDICE L1A requires exactly one input science file, received: "
619-
f"{science_files}."
620-
)
621615
# process data
622-
datasets = codice_l1a.process_codice_l1a(science_files[0])
616+
datasets = codice_new_l1a.process_l1a(dependencies)
623617

624618
if self.data_level == "l1b":
625619
science_files = dependencies.get_file_paths(source="codice")

0 commit comments

Comments
 (0)