bug-gnuastro
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tutorial PSF subtraction


From: Alejandro Serrano Borlaff
Subject: Re: Tutorial PSF subtraction
Date: Tue, 10 Jan 2023 12:40:23 -0800

Hi Mohammad,

You were right, the ls of my Mac is printing everything on a separate line. However, no aliases have been defined! The plot thickens, I am afraid.

I worked around the problem by typing the wildcard string directly into astaritmetic, and it worked. I completed the tutorial by doing that. Thank you so much for such an interesting document!

I am now struggling to apply it to an HST image. It seems that WCSlib does not like the distorted WCS of HST. But maybe I should submit another ticket for that problem!

Best,
Alex









El mar, 10 ene 2023 a las 9:32, Mohammad Akhlaghi (<mohammad@akhlaghi.org>) escribió:
Thanks Alex,

Indeed, this different behavior is very peculiar/strange! This is a very
basic operation and they should behave similarly.

Just to see if this is an OS issue or a shell issue, can you try running
the 'bash' command so you enter Bash (assuming it is present in your
OS), then try setting 'imgs' and printing its value?

After that test, open a new terminal so you enter your default shell.

About the next problem, your guess is right: indeed, the shell has given
the full string (including the new line characters!) to Arithmetic as a
single token! This is again very strange and I hadn't seen this occur
before!

These new-line characters were put in 'imgs' by 'ls'. But this is again
non-standard! 'ls' usually prints all the names on a single line. For
example on my computer (assuming I have two files called 'junk1.txt' and
'junk2.txt'), I see this:

imgs=$(ls *.txt)
echo $imgs
junk1.txt junk2.txt

'ls' has an option '-1' (number one) for printing each file on a
separate line. You can see the effect here:

imgs=$(ls -1 *.txt)
echo $imgs
junk1.txt
junk2.txt

Probably your 'ls' an alias to a customized 'ls' command that includes
the '-1' option! You can check with this command:

alias | grep ls

If this is indeed the case, you can remove the alias for 'ls' with this
command:

unalias ls

Then try setting 'imgs' and inspecting its value (to have all the files
in one line).

If this is not the case, then things get more complicated, but I'll wait
until you reply ;-).

Cheers,
Mohammad


--
==================================================================
Ex Luna, Scientia

Alejandro S. Borlaff, PhD  -  NASA / BAERI Researcher
NASA Space Science and Astrobiology Division (Code ST)
NASA Ames Research Center, N245-6, Moffett Field, California (94035) USA              
Webpage :  https://borlaff.github.io/
GitHub: https://github.com/Borlaff
Twitter: @asborlaff
==================================================================

reply via email to

[Prev in Thread] Current Thread [Next in Thread]