Mono images getting...
 
Share:
Notifications
Clear all

15th Feb 2024: Astro Pixel Processor 2.0.0-beta29 released - macOS native File Chooser, macOS CMD-Q fixed, read-only Fits on network fixed and other bug fixes

7th December 2023:  added payment option Alipay to purchase Astro Pixel Processor from China, Hong Kong, Macau, Taiwan, Korea, Japan and other countries where Alipay is used.

 

Mono images getting interpreted as RGGB bayer images in ASI183MM-Pro

18 Posts
6 Users
2 Likes
1,485 Views
(@michael-h-f-wilkinson)
Main Sequence Star
Joined: 6 years ago
Posts: 14
Topic starter  

For some reason, while FITSwork and GIMP read the data as mono, APP insists on interpreting them as OSC colour images with RGGB. While I know OSC camera data which are accidentally seen as mono can be forced to the correct Bayer pattern, the reverse is not obvious. I did get one batch to process correctly, but the second set of images refuses to be treated as grey scale, so I cannot neatly merge the data. What is going wrong?

This topic was modified 3 years ago 2 times by michael.h.f.wilkinson

   
ReplyQuote
Topic Tags
(@wvreeven)
Quasar
Joined: 6 years ago
Posts: 2133
 

@michael-h-f-wilkinson We have had reports of certain astro photography software incorrectly adding a Bayer pattern to the FITS header of mono images. Can you check and see if that's the case with your images?

In any case, on tab 0 you can select "no interpolation" in the algorithm drop down. That should make sure that your images are treated as mono images.


   
ReplyQuote
(@michael-h-f-wilkinson)
Main Sequence Star
Joined: 6 years ago
Posts: 14
Topic starter  

@wvreeven I have notice APT got that wrong by default (now corrected). I will use no interpolation and see what that does. Cheers


   
ReplyQuote
(@astrogee)
Neutron Star
Joined: 6 years ago
Posts: 153
 
Posted by: @michael-h-f-wilkinson

@wvreeven I have notice APT got that wrong by default (now corrected). I will use no interpolation and see what that does. Cheers

Interesting problem because I had an ASI120-mm but my guiding program (Kstars/Ekos) was interpreting it as colour also. I think there may be an issue with some open source library like libraw - totally guessing but just to say that this problem is not unheard-of 


   
ReplyQuote
(@michael-h-f-wilkinson)
Main Sequence Star
Joined: 6 years ago
Posts: 14
Topic starter  

@astrogee I think APT just assumes a new camera is an OSC with RGGB bayer pattern, switching debayer off during installation of a new camera in APT sorts this out


   
astrogee reacted
ReplyQuote
(@col)
Neutron Star
Joined: 3 years ago
Posts: 127
 

@michael-h-f-wilkinson

I had a related issue, and its seems APT fixes the debayer preview into the FITS header, so its is advisable to use the correct debayer in the shfit+click camera setting and also in the APT setting CCD tab. In the latter, it defaults to RGGB for me every time APT starts up and I need to change it to BGGR for my camera. Then the subs work well with the correct color in APP and others.

Link to my problem and solution (that works for me) is here:

https://www.astropixelprocessor.com/community/main-forum/alternating-bayer-pattern-within-a-single-imaging-session/#post-15692

 


   
ReplyQuote
(@col)
Neutron Star
Joined: 3 years ago
Posts: 127
 

I meant to add that mine is the OSC case, but I guess yours will require the debater option in both settings cases (camera connection and apt ccd setting tab) to avoid using debater preview to avoid writing into the fits header..


   
ReplyQuote
(@vincent-mod)
Universe Admin
Joined: 7 years ago
Posts: 5707
 

Given the posts I've seen about this particular issue, APT is almost always mentioned. Seems like it indeed writes this easily in the header, something to tell the developers of APT about as well I think.


   
ReplyQuote
(@michael-h-f-wilkinson)
Main Sequence Star
Joined: 6 years ago
Posts: 14
Topic starter  

APT is absolutely a pain in this respect. After behaving well for a month or so, it suddenly assumed my ASI183MM-Pro is a colour camera with RGGB bayer pattern. Result: stacking takes far longer, and the result is noisy. I am taking this up with APT, but having a "Force NO Debayer" option in APP would be a godsend. I can manually remove the Bayer pattern indication in the FITS header (selecting No interpolation in APP does not give the right result, as it still interprets the data as colour), but with a few hundred of FITS files to go through this is a right royal pain.


   
ReplyQuote
(@michael-h-f-wilkinson)
Main Sequence Star
Joined: 6 years ago
Posts: 14
Topic starter  

I might write a little program to strip the bayer pattern information from the FITS header too


   
ReplyQuote
(@vincent-mod)
Universe Admin
Joined: 7 years ago
Posts: 5707
 

Yeah that would be nice indeed. The issue with developing an application like this is that there are many programs that take data out there and we can't easily start implementing remedy options for every particular issue in that software. That might cause bloating of features. So it would be great if APT can solve this, and of course we will always look at implementing things that make a more broad sense.


   
ReplyQuote
(@michael-h-f-wilkinson)
Main Sequence Star
Joined: 6 years ago
Posts: 14
Topic starter  
Posted by: @vincent-mod

Yeah that would be nice indeed. The issue with developing an application like this is that there are many programs that take data out there and we can't easily start implementing remedy options for every particular issue in that software. That might cause bloating of features. So it would be great if APT can solve this, and of course we will always look at implementing things that make a more broad sense.

Well, if the bayer pattern can be forced on, why not add the ability to force it off? That would solve the problem. I do not know the code stucture, but it would seem to me as code developer that this should not be a huge issue. If you can switch debayering on, you should be able to switch it off again.

 

I looked at bulk editing tools, and I could use fhedit from ftools, but that doesn't run on windows. The only bulk editor I found only allows manipulation of keywords it knows, and it doesn't know BAYER PAT, FITSwork allows me to edit the header, but you have to go through each file manually. When a few hundred files are involved this is quite a pain.

 

I have contacted APT, but that doesn't solve the issue with the existing files

 


   
ReplyQuote
(@vincent-mod)
Universe Admin
Joined: 7 years ago
Posts: 5707
 

I may have forgotten about the "no interpolation" option in tab 0, that is actually a kind of "force debayering off" option.


   
ReplyQuote
(@michael-h-f-wilkinson)
Main Sequence Star
Joined: 6 years ago
Posts: 14
Topic starter  
Posted by: @vincent-mod

I may have forgotten about the "no interpolation" option in tab 0, that is actually a kind of "force debayering off" option.

Doesn't work the same as removing the BAYER PAT tag, as it still interprets the data as colour, which means it takes much longer to process, and you cannot use the (monochrome) dark and flat files you might have lying around. I also get the impression that is is less sharp (if your darks and flats have the same erroneous tag).

 


   
ReplyQuote
(@vincent-mod)
Universe Admin
Joined: 7 years ago
Posts: 5707
 

Right, also true, but then I think it really is not a problem of APP to tackle. What will be possible is to change the FITS headers easily in the next version.


   
ReplyQuote
(@michael-h-f-wilkinson)
Main Sequence Star
Joined: 6 years ago
Posts: 14
Topic starter  

That would be very handy. The current "manipulate header" button in bulk modify doesn't seem to do anything


   
ReplyQuote
(@michael-h-f-wilkinson)
Main Sequence Star
Joined: 6 years ago
Posts: 14
Topic starter  

One more reflection on the matter: AS!3 allows you to force the bayer pattern, but also force monochrome, which is needed when using the IR-pass filter mode on cameras like the ASI224MC, which acts as a monochrome IR camera in that case, but of course reports an RGGB Bayer pattern. Thus it isn't illogical at all to allow stacking software to have a "force monochrome" option


   
ReplyQuote
(@domus)
Hydrogen Atom
Joined: 4 years ago
Posts: 1
 

@michael-h-f-wilkinson

I stumbled upon this problem of having mono represented as RGGB in APP recently. I have Python installed as software and it is relatively easy to manipulate FITS Files and FITS headers in Python using a library called "astropy" ( if you have some affinity with programming). For this particular case I used the following code:

from python command line, after importing the astropy library:

>from astropy.io import fits
>with fits.open(r'myfile',mode=update) as hdul:
>     hdr = hdul[0].header
>     del hdr['BAYERPAT']

Keep the single quotes before and after myfile
Replace myfile with your full filepath and filename

This code deletes the BAYERPAT keyword from the FITS header

It's also quite easy to write some code to do this in bulk for many files if needed.

Note: Python is case sensitive.

BR/Eric

 

This post was modified 1 year ago 2 times by Eric Dooms

   
ReplyQuote
Share: