Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AutoCalibrate.py script expects user to execute command in same directory as the DATAFN and DARKFN. #11

Open
StopkaKris opened this issue Jun 2, 2024 · 1 comment

Comments

@StopkaKris
Copy link

Hi Hemant,

I am logging this bug based on our conservation:

The AutoCalibrate.py script takes as input the path to the Ceria scan and the dark file. When I ran this, the “CeO2_3s_100x100_att000_840mm_71p68keV_000412.edf.ge5.corr.csv” file was generated in the same directory where I ran the .sh script that calls this function, which was different than where I have my data and dark files. I got the error below because the script expects that the user will always execute the script/command to AutoCalibrate.py in the same directory as the DATAFN and DARKFN.

AutoCalibrate.py fails on line 134. This can be fixed if line 1453 in CalibrantOMP.c considers the directory where the script is executed.

Running MIDAS calibration, might take a few minutes.     Trial Nr: 1
Path of int:
/scratch/negishi/kstopka/sangid_sep22/ge5/CeO2_3s_100x100_att000_840mm_71p68keV_000412.edf.ge5
Traceback (most recent call last):
  File "/home/kstopka/opt/MIDAS/utils/AutoCalibrate.py", line 314, in <module>
    rOrig = runMIDAS(rawFN)
            ^^^^^^^^^^^^^^^
  File "/home/kstopka/opt/MIDAS/utils/AutoCalibrate.py", line 134, in runMIDAS
    results = np.genfromtxt(fn+'.corr.csv',skip_header=1)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/apps/spack/negishi/apps/anaconda/2024.02-py311-gcc-8.5.0-lr57z2f/lib/python3.11/site-packages/numpy/lib/npyio.py", line 1980, in genfromtxt
    fid = np.lib._datasource.open(fname, 'rt', encoding=encoding)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/apps/spack/negishi/apps/anaconda/2024.02-py311-gcc-8.5.0-lr57z2f/lib/python3.11/site-packages/numpy/lib/_datasource.py", line 193, in open
    return ds.open(path, mode, encoding=encoding, newline=newline)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/apps/spack/negishi/apps/anaconda/2024.02-py311-gcc-8.5.0-lr57z2f/lib/python3.11/site-packages/numpy/lib/_datasource.py", line 533, in open
    raise FileNotFoundError(f"{path} not found.")
FileNotFoundError: /scratch/negishi/kstopka/sangid_sep22/ge5/CeO2_3s_100x100_att000_840mm_71p68keV_000412.edf.ge5.corr.csv not found.

Best regards,
Krzysztof Stopka

@marinerhemant
Copy link
Owner

I'm looking into making this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants