Group Abstract Group Abstract

Message Boards Message Boards

0
|
29 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Import[] is changing the context and with it fails to import the file I want

Posted 13 hours ago

I have this small notebook snippet. This one was working about a year ago.

In[4]:= (* Set HistoryLength *)
$HistoryLength = 1;
(* Set working directory *)
SetDirectory["/Volumes/Data/Projects/SpeckleSH/Data"];
Directory[]

Out[6]= "/Volumes/Data/Projects/SpeckleSH/Data"

(* Read fits files. Scientific contains 999 pictures, \
waveform contains 2000 pictures *)
fps = Import["/Volumes/Data/Projects/SpeckleSH/Data/q880_0284.fits", 
   "RawData"];
fps[[1, 1]]

In[1]:= Directory[]

Out[1]= "/Volumes/Home/janos"

In[1]:= fps // Length

Out[1]= 0

So, Import[] is changing the directory specified by SetDirectory back to the user home directory, and cannot find the file, although it is specified with a full path. What is wrong here? Thanks ahead, János

POSTED BY: Janos Lobb
Posted 12 hours ago

I cannot reproduce. Based on what you're showing, I assume there was something about the data that caused the kernel to crash. You don't show any output for fps[[1,1]], and that would be consistent with the kernel crashing and therefore not evaluating fps[[1,1]], If you then evaluated the expressions following that, the output you showed would also be consistent with a crash, e.g. Directory[] pointing to your home directory. So I would check your data. It might be too large or malformed somehow.

Just in case that's not the explanation, you might want to provide your Mathematica version and your operating system to better help debug.

POSTED BY: Eric Rimbey
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard