×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

Missing timestamp in FITS Header

  • Posts: 1009
  • Thank you received: 133
For changing the Z you could use sed. But make a backup of the files first. Then do
sed -i -e  "s/Z' /'  /"  *.fits
5 years 4 months ago #32603

Please Log in or Create an account to join the conversation.

  • Posts: 474
  • Thank you received: 168
- download the script
- edit these lines at the top of the file:
var inputDirectory = "K:/cache/PI/21P/2018-09-07/registered/";
var outputDirectory = "K:/cache/PI/21P/2018-09-07/registered/repl/";
to match where your subs are and where you want the "fixed" subs to be. They can't be the same directory and I think the output directory must already exist, not sure.

- if you have fits files instead of already registered xisf files, change xisf to fits on this line:
for ( let D = searchDirectory( inputDirectory + "*.xisf", false/*recursive*/ ), i = 0; i < D.length; ++i )
- rename it to strip_date_obs.js
- in PI go to SCRIPT menu and select "Execute Script File..." and select this script file, fixed subs should now start appearing in the output directory, double check them before replacing the originals :)
5 years 4 months ago #32605

Please Log in or Create an account to join the conversation.

  • Posts: 321
  • Thank you received: 19
OK i will try all you wrote. BUT

#1 is "download the script"

OK, call me an Idiot but WHERE can i find that? i see no link nowhere...

Sorry
Skywatcher EQ6-R | Lacerta 10" Carbon-Newton | Lacerta MFoc Motorfocus | Moravian G2 8300 Color | Canon EOS 5DMarkIIIa | Lodestar X2 guiding cam | KSTARS 3.4.3. on my outdoor-Laptop with KDE-Neon/Plasma | KSTARS 3.4.3. on Remote-IMac with Catalina | KSTARS 3.4.3 on Remote-Macbook Air with Catalina
5 years 4 months ago #32606

Please Log in or Create an account to join the conversation.

  • Posts: 474
  • Thank you received: 168
It was attached to my first message, I think the direct link is www.indilib.org/media/kunena/attachments...7/strip_date_obs.txt
5 years 4 months ago #32607

Please Log in or Create an account to join the conversation.

  • Posts: 321
  • Thank you received: 19
So the "download" in this case is simply to COPY the text?

I was searching for a classic download, a file or something. Sorry but this exceeds my knowledge by far.

So i will copy the text and then fill it in somewhere?

Create a text-file?

I mean i have to fill it in somewhere, to be able to edit it, right?
Skywatcher EQ6-R | Lacerta 10" Carbon-Newton | Lacerta MFoc Motorfocus | Moravian G2 8300 Color | Canon EOS 5DMarkIIIa | Lodestar X2 guiding cam | KSTARS 3.4.3. on my outdoor-Laptop with KDE-Neon/Plasma | KSTARS 3.4.3. on Remote-IMac with Catalina | KSTARS 3.4.3 on Remote-Macbook Air with Catalina
5 years 4 months ago #32608

Please Log in or Create an account to join the conversation.

  • Posts: 2877
  • Thank you received: 812
There is a script editor in PixInsight, it is located in the View Menu and it brings up one of those tabs on the side
The following user(s) said Thank You: the.cakemaker
5 years 4 months ago #32610

Please Log in or Create an account to join the conversation.

  • Posts: 1957
  • Thank you received: 420

I was thinking about sed as well but please note that sed works differently on MacOS than on Linux so those command line options may not be entirely correct.


Wouter
The following user(s) said Thank You: the.cakemaker
5 years 4 months ago #32611

Please Log in or Create an account to join the conversation.

  • Posts: 321
  • Thank you received: 19
Thanx@all i‘ll give this a go.

Cheers
Niki


Gesendet von iPhone mit Tapatalk
Skywatcher EQ6-R | Lacerta 10" Carbon-Newton | Lacerta MFoc Motorfocus | Moravian G2 8300 Color | Canon EOS 5DMarkIIIa | Lodestar X2 guiding cam | KSTARS 3.4.3. on my outdoor-Laptop with KDE-Neon/Plasma | KSTARS 3.4.3. on Remote-IMac with Catalina | KSTARS 3.4.3 on Remote-Macbook Air with Catalina
5 years 4 months ago #32612

Please Log in or Create an account to join the conversation.

  • Posts: 321
  • Thank you received: 19
OK.

Managed to "make" a script with the right pathes and stuff. Now...

What exactly does this script, as it is written in the link, do?

I mean my files are copied to the output foler, but nothing happened to the line with the datestamp...

And when i "read" the script i can not find a part, where it says it does anything to any file...

This "SED-Line" you guys posted above, do i use it in the script? And if yes, where?

And do i have to write this <code> or not?
Skywatcher EQ6-R | Lacerta 10" Carbon-Newton | Lacerta MFoc Motorfocus | Moravian G2 8300 Color | Canon EOS 5DMarkIIIa | Lodestar X2 guiding cam | KSTARS 3.4.3. on my outdoor-Laptop with KDE-Neon/Plasma | KSTARS 3.4.3. on Remote-IMac with Catalina | KSTARS 3.4.3 on Remote-Macbook Air with Catalina
Last edit: 5 years 4 months ago by the.cakemaker.
5 years 4 months ago #32615

Please Log in or Create an account to join the conversation.

  • Posts: 1957
  • Thank you received: 420
sed is a unix command that can be used instead of the script for PixInsight. You can safely ignore both comments about sed if you decide to use the PixInsight script which I recommend you do.


Wouter
5 years 4 months ago #32616

Please Log in or Create an account to join the conversation.

  • Posts: 321
  • Thank you received: 19
OK. I´d like to do so but i do not know where to write what i want to be changed in the script...
I know, you guys are into coding but unfortunately i am absolutely not...
Skywatcher EQ6-R | Lacerta 10" Carbon-Newton | Lacerta MFoc Motorfocus | Moravian G2 8300 Color | Canon EOS 5DMarkIIIa | Lodestar X2 guiding cam | KSTARS 3.4.3. on my outdoor-Laptop with KDE-Neon/Plasma | KSTARS 3.4.3. on Remote-IMac with Catalina | KSTARS 3.4.3 on Remote-Macbook Air with Catalina
5 years 4 months ago #32617

Please Log in or Create an account to join the conversation.

  • Posts: 474
  • Thank you received: 168
If the files are copied that means the script completed normally and found the keyword in them (it doesn't write out files that don't have the specified keyword), it doesn't touch the original files so make sure you check the new files. It should also print the new timestamps to process console while doing so, something like:
Reading image:
X:/indi/2018-09-19/Light/Red/Light_Red_60_secs_2018-09-19T23-53-25_028.fits
47 FITS keywords extracted.
Reading FITS image: 16-bit integers, 1 channel(s), 3326x2504 pixels: done
2018-09-19T20:52:15.287
X:/indi/2018-09-19/Light/Red/Light_Red_60_secs_2018-09-19T23-53-25_028.fits
 
Writing file:
X:/indi/2018-09-19/Light/Red/test/Light_Red_60_secs_2018-09-19T23-53-25_028.fits
** Warning: Deprecated format: FITS
47 FITS keywords embedded.
Writing FITS image: 16-bit unsigned integers, 1 channel(s), 3326x2504 pixels: done
53 FITS keywords extracted.

The original file has:
DATE-OBS= '2018-09-19T20:52:15.287Z' / UTC start date of observation
and the copied one has:
DATE-OBS= '2018-09-19T20:52:15.287' / UTC start date of observation
which comet align happily accepts.

The script is very simple, it finds all the xisf/fits files on input directory, loads them one by one, goes through their keywords and if it finds the specified (DATE-OBS), it strips the last character off and then writes the file to output directory.
5 years 4 months ago #32618

Please Log in or Create an account to join the conversation.

Time to create page: 0.845 seconds