Nat1405 / Nifty4Gemini

A Gemini Data Reduction Pipeline Framework
MIT License
0 stars 0 forks source link

Graphics don't work #5

Closed Nat1405 closed 4 years ago

Nat1405 commented 4 years ago

Graphical IRAF tasks like pyraf.iraf.splot() don't work.

Testing: I inserted the following lines into nifsBaselineCalibration.py to see if splot worked.

image

This resulted in the following error:

2020-05-11 11:02:01.741 python[61639:5076045] -[NSApplication _setup:]: unrecognized selector sent to instance 0x7f8c31c6d9c0
2020-05-11 11:02:01.745 python[61639:5076045] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSApplication _setup:]: unrecognized selector sent to instance 0x7f8c31c6d9c0'
*** First throw call stack:
(
    0   CoreFoundation                      0x00007fff309cfcfd __exceptionPreprocess + 256
    1   libobjc.A.dylib                     0x00007fff5b075a17 objc_exception_throw + 48
    2   CoreFoundation                      0x00007fff30a49b06 -[NSObject(NSObject) __retain_OA] + 0
    3   CoreFoundation                      0x00007fff30971b8f ___forwarding___ + 1485
    4   CoreFoundation                      0x00007fff30971538 _CF_forwarding_prep_0 + 120
    5   libtk8.6.dylib                      0x00000001109ff31d TkpInit + 413
    6   libtk8.6.dylib                      0x000000011095717e Initialize + 2622
    7   _tkinter.so                         0x0000000110782be4 Tcl_AppInit + 84
    8   _tkinter.so                         0x0000000110782448 Tkinter_Create + 1128
    9   libpython2.7.dylib                  0x000000010f7868b4 PyEval_EvalFrameEx + 22980
    10  libpython2.7.dylib                  0x000000010f780c94 PyEval_EvalCodeEx + 2164
    11  libpython2.7.dylib                  0x000000010f702923 function_call + 355
    12  libpython2.7.dylib                  0x000000010f6d9e15 PyObject_Call + 101
    13  libpython2.7.dylib                  0x000000010f6e9212 instancemethod_call + 162
    14  libpython2.7.dylib                  0x000000010f6d9e15 PyObject_Call + 101
    15  libpython2.7.dylib                  0x000000010f78a9ef PyEval_CallObjectWithKeywords + 159
    16  libpython2.7.dylib                  0x000000010f6e71a4 PyInstance_New + 148
    17  libpython2.7.dylib                  0x000000010f6d9e15 PyObject_Call + 101
    18  libpython2.7.dylib                  0x000000010f786538 PyEval_EvalFrameEx + 22088
    19  libpython2.7.dylib                  0x000000010f780c94 PyEval_EvalCodeEx + 2164
    20  libpython2.7.dylib                  0x000000010f78afed fast_function + 109
    21  libpython2.7.dylib                  0x000000010f786359 PyEval_EvalFrameEx + 21609
    22  libpython2.7.dylib                  0x000000010f780c94 PyEval_EvalCodeEx + 2164
    23  libpython2.7.dylib                  0x000000010f780412 PyEval_EvalCode + 34
    24  libpython2.7.dylib                  0x000000010f79f144 PyImport_ExecCodeModuleEx + 212
    25  libpython2.7.dylib                  0x000000010f7a2353 load_source_module + 995
    26  libpython2.7.dylib                  0x000000010f7a1e1f import_submodule + 319
    27  libpython2.7.dylib                  0x000000010f7a18a0 load_next + 272
    28  libpython2.7.dylib                  0x000000010f7a068d PyImport_ImportModuleLevel + 589
    29  libpython2.7.dylib                  0x000000010f77b549 builtin___import__ + 153
    30  libpython2.7.dylib                  0x000000010f7868b4 PyEval_EvalFrameEx + 22980
    31  libpython2.7.dylib                  0x000000010f780c94 PyEval_EvalCodeEx + 2164
    32  libpython2.7.dylib                  0x000000010f702923 function_call + 355
    33  libpython2.7.dylib                  0x000000010f6d9e15 PyObject_Call + 101
    34  libpython2.7.dylib                  0x000000010f7850d2 PyEval_EvalFrameEx + 16866
    35  libpython2.7.dylib                  0x000000010f780c94 PyEval_EvalCodeEx + 2164
    36  libpython2.7.dylib                  0x000000010f780412 PyEval_EvalCode + 34
    37  libpython2.7.dylib                  0x000000010f79f144 PyImport_ExecCodeModuleEx + 212
    38  libpython2.7.dylib                  0x000000010f7a2353 load_source_module + 995
    39  libpython2.7.dylib                  0x000000010f7a1e1f import_submodule + 319
    40  libpython2.7.dylib                  0x000000010f7a18a0 load_next + 272
    41  libpython2.7.dylib                  0x000000010f7a068d PyImport_ImportModuleLevel + 589
    42  libpython2.7.dylib                  0x000000010f77b549 builtin___import__ + 153
    43  libpython2.7.dylib                  0x000000010f7868b4 PyEval_EvalFrameEx + 22980
    44  libpython2.7.dylib                  0x000000010f780c94 PyEval_EvalCodeEx + 2164
    45  libpython2.7.dylib                  0x000000010f702923 function_call + 355
    46  libpython2.7.dylib                  0x000000010f6d9e15 PyObject_Call + 101
    47  libpython2.7.dylib                  0x000000010f7850d2 PyEval_EvalFrameEx + 16866
    48  libpython2.7.dylib                  0x000000010f780c94 PyEval_EvalCodeEx + 2164
    49  libpython2.7.dylib                  0x000000010f78afed fast_function + 109
    50  libpython2.7.dylib                  0x000000010f786359 PyEval_EvalFrameEx + 21609
    51  libpython2.7.dylib                  0x000000010f780c94 PyEval_EvalCodeEx + 2164
    52  libpython2.7.dylib                  0x000000010f780412 PyEval_EvalCode + 34
    53  libpython2.7.dylib                  0x000000010f79f144 PyImport_ExecCodeModuleEx + 212
    54  libpython2.7.dylib                  0x000000010f7a2353 load_source_module + 995
    55  libpython2.7.dylib                  0x000000010f7a1e1f import_submodule + 319
    56  libpython2.7.dylib                  0x000000010f7a18a0 load_next + 272
    57  libpython2.7.dylib                  0x000000010f7a068d PyImport_ImportModuleLevel + 589
    58  libpython2.7.dylib                  0x000000010f77b549 builtin___import__ + 153
    59  libpython2.7.dylib                  0x000000010f7868b4 PyEval_EvalFrameEx + 22980
    60  libpython2.7.dylib                  0x000000010f780c94 PyEval_EvalCodeEx + 2164
    61  libpython2.7.dylib                  0x000000010f702923 function_call + 355
    62  libpython2.7.dylib                  0x000000010f6d9e15 PyObject_Call + 101
    63  libpython2.7.dylib                  0x000000010f7850d2 PyEval_EvalFrameEx + 16866
    64  libpython2.7.dylib                  0x000000010f780c94 PyEval_EvalCodeEx + 2164
    65  libpython2.7.dylib                  0x000000010f78afed fast_function + 109
    66  libpython2.7.dylib                  0x000000010f786359 PyEval_EvalFrameEx + 21609
    67  libpython2.7.dylib                  0x000000010f780c94 PyEval_EvalCodeEx + 2164
    68  libpython2.7.dylib                  0x000000010f78afed fast_function + 109
    69  libpython2.7.dylib                  0x000000010f786359 PyEval_EvalFrameEx + 21609
    70  libpython2.7.dylib                  0x000000010f780c94 PyEval_EvalCodeEx + 2164
    71  libpython2.7.dylib                  0x000000010f78afed fast_function + 109
    72  libpython2.7.dylib                  0x000000010f786359 PyEval_EvalFrameEx + 21609
    73  libpython2.7.dylib                  0x000000010f780c94 PyEval_EvalCodeEx + 2164
    74  libpython2.7.dylib                  0x000000010f78afed fast_function + 109
    75  libpython2.7.dylib                  0x000000010f786359 PyEval_EvalFrameEx + 21609
    76  libpython2.7.dylib                  0x000000010f780c94 PyEval_EvalCodeEx + 2164
    77  libpython2.7.dylib                  0x000000010f78afed fast_function + 109
    78  libpython2.7.dylib                  0x000000010f786359 PyEval_EvalFrameEx + 21609
    79  libpython2.7.dylib                  0x000000010f780c94 PyEval_EvalCodeEx + 2164
    80  libpython2.7.dylib                  0x000000010f78afed fast_function + 109
    81  libpython2.7.dylib                  0x000000010f786359 PyEval_EvalFrameEx + 21609
    82  libpython2.7.dylib                  0x000000010f780c94 PyEval_EvalCodeEx + 2164
    83  libpython2.7.dylib                  0x000000010f78afed fast_function + 109
    84  libpython2.7.dylib                  0x000000010f786359 PyEval_EvalFrameEx + 21609
    85  libpython2.7.dylib                  0x000000010f780c94 PyEval_EvalCodeEx + 2164
    86  libpython2.7.dylib                  0x000000010f702923 function_call + 355
    87  libpython2.7.dylib                  0x000000010f6d9e15 PyObject_Call + 101
    88  libpython2.7.dylib                  0x000000010f7875c0 PyEval_EvalFrameEx + 26320
    89  libpython2.7.dylib                  0x000000010f780c94 PyEval_EvalCodeEx + 2164
    90  libpython2.7.dylib                  0x000000010f78afed fast_function + 109
    91  libpython2.7.dylib                  0x000000010f786359 PyEval_EvalFrameEx + 21609
    92  libpython2.7.dylib                  0x000000010f780c94 PyEval_EvalCodeEx + 2164
    93  libpython2.7.dylib                  0x000000010f702923 function_call + 355
    94  libpython2.7.dylib                  0x000000010f6d9e15 PyObject_Call + 101
    95  libpython2.7.dylib                  0x000000010f7875c0 PyEval_EvalFrameEx + 26320
    96  libpython2.7.dylib                  0x000000010f780c94 PyEval_EvalCodeEx + 2164
    97  libpython2.7.dylib                  0x000000010f702923 function_call + 355
    98  libpython2.7.dylib                  0x000000010f6d9e15 PyObject_Call + 101
    99  libpython2.7.dylib                  0x000000010f6e9212 instancemethod_call + 162
    100 libpython2.7.dylib                  0x000000010f6d9e15 PyObject_Call + 101
    101 libpython2.7.dylib                  0x000000010f6e83de instance_call + 110
    102 libpython2.7.dylib                  0x000000010f6d9e15 PyObject_Call + 101
    103 libpython2.7.dylib                  0x000000010f786538 PyEval_EvalFrameEx + 22088
    104 libpython2.7.dylib                  0x000000010f780c94 PyEval_EvalCodeEx + 2164
    105 libpython2.7.dylib                  0x000000010f78afed fast_function + 109
    106 libpython2.7.dylib                  0x000000010f786359 PyEval_EvalFrameEx + 21609
    107 libpython2.7.dylib                  0x000000010f78b0d3 fast_function + 339
    108 libpython2.7.dylib                  0x000000010f786359 PyEval_EvalFrameEx + 21609
    109 libpython2.7.dylib                  0x000000010f780c94 PyEval_EvalCodeEx + 2164
    110 libpython2.7.dylib                  0x000000010f781158 PyEval_EvalFrameEx + 616
    111 libpython2.7.dylib                  0x000000010f780c94 PyEval_EvalCodeEx + 2164
    112 libpython2.7.dylib                  0x000000010f780412 PyEval_EvalCode + 34
    113 libpython2.7.dylib                  0x000000010f7adeed PyRun_FileExFlags + 157
    114 libpython2.7.dylib                  0x000000010f7ada30 PyRun_SimpleFileExFlags + 816
    115 libpython2.7.dylib                  0x000000010f7c4402 Py_Main + 3506
    116 libdyld.dylib                       0x00007fff5c8433d5 start + 1
    117 ???                                 0x0000000000000004 0x0 + 4
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Abort trap: 6

PANIC in `/Users/nat/miniconda3/envs/iraf27/iraf/noao/bin.macosx/x_onedspec.e': Write to IPC with no reader
Nat1405 commented 4 years ago

The following addition (at the top of nifsBaselineCalibration.py) before importing matplotlib seems to let splot work; more testing is needed to see if all the graphical tasks work.

from sys import platform as sys_pf
if sys_pf == 'darwin':
    import matplotlib
    matplotlib.use("TkAgg")
Nat1405 commented 4 years ago

Seems to be working in a test data reduction with interactive h-line selection in nifsTelluric (commit e5e5a3a813c9). Closing for now.