Skip to content

Commit

Permalink
Adding fixes discussed on nomad-FAIR 05b34e6916b3429630289bf8f1fecd46…
Browse files Browse the repository at this point in the history
…f859037c
  • Loading branch information
atomprobe-tc committed May 8, 2024
1 parent 16b3f51 commit a405514
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ A detailed summary is available in the [reference section of the documentation](

# Getting started
[A getting started tutorial](https://github.com/FAIRmat-NFDI/pynxtools-apm/tree/main/examples) is offered that guides you
how to use the apm reader for converting your data to NeXus from a Jupyter notebook. Note that not every combination of
supported file formats and input for the parser allows to fill required and recommended fields and attributes of the NXapm
application definition. Therefore, you may need to provide an ELN file that contains the missing values in order for the
how to use the apm reader for converting your data to NeXus using a Jupyter notebook. That notebook details also the commands how to convert data via command line calls. Note that not every combination of input from a supported file format and other, typically electronic lab notebook, input for the parser allows filling the required and recommended fields and attributes of the NXapm application definition.
Therefore, you may need to provide an ELN file that contains the missing values in order for the
validation step of the APM reader to pass.

# Contributing
Expand All @@ -49,7 +48,7 @@ git clone https://github.com/FAIRmat-NFDI/pynxtools-apm.git --branch main --recu
cd pynxtools_apm
python -m pip install --upgrade pip
python -m pip install -e .
python -m pip install -e ".[dev]"
python -m pip install -e ".[dev,docs]"
```

<!---There is also a [pre-commit hook](https://pre-commit.com/#intro) available
Expand All @@ -71,4 +70,4 @@ python -m pytest -sv tests
```

## Contact person in FAIRmat for this reader
Markus Kühbach
[Markus Kühbach](https://www.fairmat-nfdi.eu/fairmat/about-fairmat/team-fairmat)
4 changes: 2 additions & 2 deletions pynxtools_apm/config/eln_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@

APM_INSTRUMENT_STATIC_TO_NEXUS = {
"prefix_trg": "/ENTRY[entry*]/measurement/instrument",
"prefix_src": "atom_probe/",
"prefix_src": "instrument/",
"map": [("analysis_chamber/flight_path", "nominal_flight_path/value")],
"map_to_str": [
"status",
Expand All @@ -105,7 +105,7 @@

APM_INSTRUMENT_DYNAMIC_TO_NEXUS = {
"prefix_trg": "/ENTRY[entry*]/measurement/event_data_apm_set/EVENT_DATA_APM[event_data_apm]/instrument",
"prefix_src": "atom_probe/",
"prefix_src": "instrument/",
"use": [("control/target_detection_rate/@units", "ions/pulse")],
"map": [
("control/target_detection_rate", "target_detection_rate"),
Expand Down
4 changes: 2 additions & 2 deletions pynxtools_apm/utils/create_nx_default_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def create_default_plot_reconstruction(template: dict, entry_id: int) -> dict:
axes = []
for dim in dims:
axes.append(f"axis_{dim}")
template[f"{trg}@AXISNAME_indices[axis_{dim}]"] = np.uint32(col)
template[f"{trg}@AXISNAME_indices[axis_{dim}_indices]"] = np.uint32(col)
col += 1
template[f"{trg}@axes"] = axes

Expand Down Expand Up @@ -169,7 +169,7 @@ def create_default_plot_mass_spectrum(template: dict, entry_id: int) -> dict:
)
template[f"{trg}@signal"] = "intensity"
template[f"{trg}@axes"] = "axis_mass_to_charge"
template[f"{trg}@AXISNAME_indices[axis_mass_to_charge]"] = np.uint32(0)
template[f"{trg}@AXISNAME_indices[axis_mass_to_charge_indices]"] = np.uint32(0)
template[f"{trg}DATA[intensity]"] = {
"compress": np.asarray(hist1d[0], np.uint32),
"strength": 1,
Expand Down
6 changes: 3 additions & 3 deletions pynxtools_apm/utils/oasis_eln_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ def parse_instrument_dynamic(self, template: dict) -> dict:
def parse_pulser_source(self, template: dict) -> dict:
"""Copy data into the (laser)/source section of the pulser."""
# additional laser-specific details only relevant when the laser was used
if "atom_probe/pulser/pulse_mode" in self.yml:
if self.yml["atom_probe/pulser/pulse_mode"] == "voltage":
if "instrument/pulser/pulse_mode" in self.yml:
if self.yml["instrument/pulser/pulse_mode"] == "voltage":
return template

src = "atom_probe/pulser/laser_source"
src = "instrument/pulser/laser_source"
if src in self.yml.keys():
if isinstance(self.yml[src], list):
if all(isinstance(entry, dict) for entry in self.yml[src]) is True:
Expand Down

0 comments on commit a405514

Please sign in to comment.