We are pleased to announce several enhancements to the Groups.io web and app experience, which will be in effect starting Thursday, April 25th.Click here for more information.
" ); } else { wrap = '
Attachments:
- '; count = 0; for (i = 0; i < response.length; i++) { if (response[i].Inline == false) { wrap += '
- ' + response[i].Name + ' (' + response[i].HumanSize + ') "; count++; } } wrap += '
'; if (count > 0) { $('#attachments' + id).replaceWith(wrap); } else { $('#attachments' + id).replaceWith( "
" ); } } }); } var modTimeoutId; function modOnFormChange(id, draftid, groupurl, csrf) { clearTimeout(modTimeoutId); if (modSaving == true) { modTimeoutId = setTimeout(function () { // Runs 1 second (1000 ms) after the last change modOnFormChange(id, draftid, groupurl, csrf); }, 1000); return; } modTimeoutId = setTimeout(function () { // Runs 1 second (1000 ms) after the last change modSaveDraft(id, draftid, groupurl, csrf, false); }, 1000); } var modSaving = false; // modSaveDraft saves the current form state in the draft. function modSaveDraft(id, draftid, groupurl, csrf, onLeave) { if (draftid == 0) { console.log("DraftID 0, not modSaving"); return; } console.log("DELETEDDRAFT IS:", modDeletedDraft); console.log("DESTROYEDEDITOR IS:", modDestroyedEditor); if (modDeletedDraft == true) { console.log('NOT SAVING BECAUSE OF DELETED'); return; } if (modDestroyedEditor == true) { console.log('NOT SAVING BECAUSE OF DESTROYED'); return; } modSaving = true; console.log('modSaving'); var fromval = $('#from' + id).val(); var subject = $('#subject' + id).val(); var body = $('#editor' + id).val(); var bodytype = $('#bodytype' + id).val(); var replyto = $('#replyto' + id).val(); var special = '0'; if ($('#special').prop('checked') == true) { special = '1'; } var bccme = '0'; if ($('#bccmecheck' + id).prop('checked') == true) { bccme = '1'; } var bccall = '0'; if ($('#bccall' + id).prop('checked') == true) { bccall = '1'; } var saveval = '1'; if (onLeave == true) { saveval = '2'; } var hashtags = $('#hashtags').val(); upload = { draftid: draftid, csrf: csrf, from: fromval, subject: subject, body: body, bodytype: bodytype, special: special, replyto: replyto, bccme: bccme, bccall: bccall, hashtags: JSON.stringify(hashtags), mid: id, save: saveval }; let opts = { url: groupurl + '/draftop', cache: false, data: upload, method: 'POST', xhrFields: { withCredentials: true }, dataType: 'json' }; if (modUnloading == false) { // if we are unloading we don't want to retry, because sometimes // that can result in a spurious error, esp on Firefox opts.retryCount = 5; opts.retryVerify = modRetryVerify; } $.ajax(opts).done(function (response) { // Do something with the request console.log('saved'); modSaving = false; }); } // called to see if we need to continue retrying function modRetryVerify() { if (modDeletedDraft == true || modDestroyedEditor == true) { return false; } return true; } // stop modSaving drafts when we do a submit var postVar = null; // Code to find and return a selected piece of HTML. function modGetSelection(id) { var flag = 0; var sel = document.getSelection(); var selText = ''; id = 'msgbody' + id; var forkfork = document.getElementById(id); if (sel.rangeCount > 0) { var range = sel.getRangeAt(0); var test = range.cloneContents(); var clonedSelection = ''; if (typeof test.getElementByID != 'undefined') { clonedSelection = range.cloneContents().getElementById(id); } if (clonedSelection) { selText = clonedSelection.innerHTML; } else { clonedSelection = range.cloneContents(); var startNode = sel.getRangeAt(0).startContainer.parentNode; //console.log(modIsChild(startNode, forkfork)); if (modIsChild(startNode, forkfork)) { var div = document.createElement('div'); div.appendChild(clonedSelection); selText = div.innerHTML; } } } return selText.toString(); } function modIsChild(child, parent) { if (child === parent) return true; var current = child; while (current) { if (current === parent) return true; current = current.parentNode; } return false; } return { InitEditor: function ( id, bodyType, draftid, groupurl, csrf, handleAttachments, noFontChanges, isReply, isWiki, body, sig, onInitFunc ) { if (typeof onInitFunc === 'undefined') { onInitFunc = null; } document.body.addEventListener('htmx:beforeSwap', modDestroyAllEditors, {once: true}); modDeletedDraft = false; modDestroyedEditor = false; modUnloading = false; $('#preview' + id).hide(); $('#addattachments' + id).hide(); $('#return' + id).hide(); $('#markdownlink' + id).hide(); if (bodyType == 'html') { if (sig != '') { $('#editor' + id).val(sig); //tinyMCE.get('editor'+id).setContent(sig); } editor.initHTMLEditor( id, draftid, groupurl, csrf, handleAttachments, noFontChanges, isReply, isWiki, body, sig, onInitFunc ); } else { if (sig != '') { $('#editor' + id).val(sig); } editor.initPlainEditor(id, bodyType, groupurl, handleAttachments, sig); } }, initHTMLEditor: function ( id, draftid, groupurl, csrf, handleAttachments, noFontChanges, isReply, isWiki, body, sig, onInitFunc ) { if (typeof onInitFunc === 'undefined') { onInitFunc = null; } // extras: print, emoticons, image, insert, media, print /* All plugins: 'advlist autolink lists link image print preview hr anchor pagebreak', 'searchreplace wordcount visualblocks visualchars code fullscreen', 'insertdatetime media nonbreaking save table contextmenu directionality', 'emoticons template paste textcolor colorpicker textpattern imagetools codesample toc' */ modDeletedDraft = false; modDestroyedEditor = false; modUnloading = false; let attachments = ''; if (handleAttachments == 0 || handleAttachments == 3) { attachments = ' addPictures addAttachments'; } let fontchanges = ''; if (noFontChanges == false) { fontchanges = ' fontselect fontsizeselect forecolor backcolor'; } let fontawesome = ' charmap'; let forceRootBlock = false; if (isWiki == true) { attachments += ' addWikiImage addWikiLink addWikiTOC'; fontawesome = ' fontawesome'; // BORK fontawesome = ''; forceRootBlock = 'p'; } let toolbar1 = 'styleselect bold italic bullist numlist link blockquote alignleft aligncenter alignright' + attachments + ' advancedToolbar'; let toolbar2 = 'strikethrough underline hr alignjustify' + fontchanges + ' removeformat' + fontawesome + ' outdent indent undo redo preview code'; let small_toolbar1 = 'bold italic link blockquote' + attachments + ' advancedToolbar'; let small_toolbar2 = 'strikethrough underline hr alignjustify removeformat outdent indent'; let tm_fonts = 'Arial=arial,helvetica,sans-serif;' + 'Arial Black=arial black,avant garde;' + 'Comic Sans MS=comic sans ms;' + 'Courier Neue=courier_newregular,courier;' + 'Helvetica Neue=helvetica neue;' + 'Helvetica=helvetica;' + 'Impact=impactregular,chicago;' + 'Lucida Grande=lucida grande;' + 'Tahoma=tahoma,arial,helvetica,sans-serif;' + 'Times New Roman=times new roman,times;' + 'Verdana=verdana,geneva'; let plugins = [ 'SplitBlockquote', 'advlist autolink lists link image preview hr anchor', 'code fullscreen', 'nonbreaking table charmap', 'textcolor colorpicker imagetools noneditable' ]; let css = '/bootstrap/3.3.6/css/bootstrap.min.css,/bootstrap/3.3.6/css/bootstrap-theme.min.css,/css/groupsio.css,/css/tinymce.css,/fontawesome/all.min.css'; let fontsizes = '8pt 10pt 11pt 12pt 14pt 18pt 24pt 36pt'; let codesample_languages = [ { text: 'C', value: 'c' }, { text: 'C#', value: 'csharp' }, { text: 'C++', value: 'cpp' }, { text: 'CSS', value: 'css' }, { text: 'Go', value: 'go' }, { text: 'HTML/XML', value: 'markup' }, { text: 'Java', value: 'java' }, { text: 'JavaScript', value: 'javascript' }, { text: 'PHP', value: 'php' }, { text: 'Python', value: 'python' }, { text: 'Ruby', value: 'ruby' } ]; let style_formats = [ { title: 'Paragraph', block: 'p' }, { title: 'Header 1', block: 'h1' }, { title: 'Header 2', block: 'h2' }, { title: 'Header 3', block: 'h3' }, { title: 'Header 4', block: 'h4' }, { title: 'Header 5', block: 'h5' }, { title: 'Header 6', block: 'h6' } ]; if (isReply == true) { toolbar1 = 'quoteMessage ' + toolbar1; small_toolbar1 = 'quoteMessage ' + small_toolbar1; } if (document.documentElement.clientWidth > 1000) { tinymce.init({ noneditable_noneditable_class: 'fa', extended_valid_elements: 'span[*]', branding: false, link_context_toolbar: true, default_link_target: '_blank', link_assume_external_targets: true, elementpath: false, forced_root_block: forceRootBlock, content_css: css, relative_urls: false, remove_script_host: false, menubar: false, statusbar: true, plugins: plugins, toolbar1: toolbar1, toolbar2: toolbar2, font_formats: tm_fonts, browser_spellcheck: true, contextmenu: false, selector: '#editor' + id, resize: true, fontsize_formats: fontsizes, style_formats: style_formats, setup: function (teditor) { teditor.on('Init', function (e) { // see if any text is selected toquote = modGetSelection(id); if (toquote != '') { console.log('id=' + id); editor.ShowMessageHistory(id, groupurl, 'html', toquote, sig, true); } else { if (body != "") { console.log("body setContent"); teditor.setContent(body); } else if (sig != "") { console.log("sig setContent " + sig); teditor.setContent(sig); } } if (onInitFunc != null) { onInitFunc(e); } }); teditor.on('BeforeRenderUI', function (e) { teditor.theme.panel .find('toolbar') .slice(1) .hide(); }); teditor.addButton('advancedToolbar', { tooltip: 'Show advanced toolbar', icon: 'fa fa-bars', onclick: function () { if (!this.active()) { this.active(true); teditor.theme.panel .find('toolbar') .slice(1) .show(); } else { this.active(false); teditor.theme.panel .find('toolbar') .slice(1) .hide(); } } }); teditor.addButton('addPictures', { tooltip: 'Add pictures', icon: 'fa fa-image', onclick: function () { modUploaderPrompt("pictures", id, draftid, groupurl, csrf); } }); teditor.addButton('addAttachments', { tooltip: 'Add attachments', icon: 'fa fa-paperclip', onclick: function () { modUploaderPrompt("attachments", id, draftid, groupurl, csrf); } }); if (groupurl != '') { teditor.addButton('quoteMessage', { tooltip: 'Quote post', icon: 'fa fa-comment', onclick: function () { editor.ShowMessageHistory(id, groupurl, 'html', '', sig, false); } }); } if (draftid != '' && draftid != '0' && draftid != 0) { teditor.on('NodeChange', function () { //tinymce.triggerSave(); if (tinymce.activeEditor != null) { let markupStr = tinymce.activeEditor.getContent(); $('#editor' + id).val(markupStr); modOnFormChange(id, draftid, groupurl, csrf); } }); teditor.on('keyup', function () { //tinymce.triggerSave(); let markupStr = tinymce.activeEditor.getContent(); $('#editor' + id).val(markupStr); modOnFormChange(id, draftid, groupurl, csrf); }); } if (isWiki == true) { // special wiki buttons teditor.addButton('addWikiImage', { tooltip: 'Insert image', icon: 'fa fa-image', onclick: function () { $('#ImageModal').modal({}); } }); teditor.addButton('addWikiLink', { tooltip: 'Insert link to wiki page', icon: 'fa fa-book', onclick: function () { $('#LinkModal').modal({}); } }); teditor.addButton('addWikiTOC', { tooltip: 'Insert table of contents', icon: 'fa fa-list-alt', onclick: function () { $('#TOCModal').modal({}); } }); } } }); } else { tinymce.init({ branding: false, link_context_toolbar: true, default_link_target: '_blank', link_assume_external_targets: true, elementpath: false, forced_root_block: forceRootBlock, content_css: css, relative_urls: false, remove_script_host: false, menubar: false, statusbar: true, plugins: plugins, toolbar1: small_toolbar1, toolbar2: small_toolbar2, font_formats: tm_fonts, browser_spellcheck: true, contextmenu: false, selector: '#editor' + id, resize: true, fontsize_formats: fontsizes, style_formats: style_formats, setup: function (teditor) { teditor.on('Init', function (e) { // see if any text is selected toquote = modGetSelection(id); if (toquote != '') { console.log('id=' + id); editor.ShowMessageHistory(id, groupurl, 'html', toquote, sig, true); } else { if (body != "") { console.log("body setContent"); teditor.setContent(body); } else if (sig != "") { console.log("sig setContent" + sig); teditor.setContent(sig); } } if (onInitFunc != null) { onInitFunc(e); } }); teditor.on('BeforeRenderUI', function (e) { teditor.theme.panel .find('toolbar') .slice(1) .hide(); }); teditor.addButton('advancedToolbar', { tooltip: 'Show advanced toolbar', icon: 'fa fa-bars', onclick: function () { if (!this.active()) { this.active(true); teditor.theme.panel .find('toolbar') .slice(1) .show(); } else { this.active(false); teditor.theme.panel .find('toolbar') .slice(1) .hide(); } } }); teditor.addButton('addPictures', { tooltip: 'Add pictures', icon: 'fa fa-image', onclick: function () { modUploaderPrompt("pictures", id, draftid, groupurl, csrf); } }); teditor.addButton('addAttachments', { tooltip: 'Add attachments', icon: 'fa fa-paperclip', onclick: function () { modUploaderPrompt("attachments", id, draftid, groupurl, csrf); } }); if (groupurl != '') { teditor.addButton('quoteMessage', { tooltip: 'Quote post', icon: 'fa fa-comment', onclick: function () { editor.ShowMessageHistory(id, groupurl, 'html', '', sig, false); } }); } if (draftid != '' && draftid != '0' && draftid != 0) { teditor.on('NodeChange', function () { if (tinymce.activeEditor != null) { //tinymce.triggerSave(); let markupStr = tinymce.activeEditor.getContent(); $('#editor' + id).val(markupStr); modOnFormChange(id, draftid, groupurl, csrf); } }); teditor.on('keyup', function () { //tinymce.triggerSave(); let markupStr = tinymce.activeEditor.getContent(); $('#editor' + id).val(markupStr); modOnFormChange(id, draftid, groupurl, csrf); }); } // special wiki buttons teditor.addButton('addWikiImage', { tooltip: 'Add Image', icon: 'fa fa-image', onclick: function () { $('#ImageModal').modal({}); } }); teditor.addButton('addWikiLink', { tooltip: 'Add Link', icon: 'fa fa-book', onclick: function () { $('#LinkModal').modal({}); } }); teditor.addButton('addWikiTOC', { tooltip: 'Table of Contents', icon: 'fa fa-list-alt', onclick: function () { $('#TOCModal').modal({}); } }); } }); // disable tooltips because they require double taps on mobile $('.note-editor *').tooltip('disable'); } }, initPlainEditor: function (id, bodyType, groupurl, handleAttachments, sig) { $('#addattachments').show(); if (bodyType == 'plain') { $('#bodytype' + id).val('plain'); $('#preview' + id).hide(); $('#return' + id).hide(); $('#preview' + id).hide(); $('#markdownlink' + id).hide(); } else { $('#bodytype' + id).val('markdown'); $('#markdownbuttons' + id).show(); $('#preview' + id).show(); $('#return' + id).hide(); $('#previewWindow' + id).hide(); $('#markdownlink' + id).show(); } toquote = modGetSelection(id); if (toquote != '') { editor.ShowMessageHistory(id, groupurl, 'plain', toquote, sig, true); //$('#editor' + id).val(toquote); } }, InitPostDraft: function (id, draftid, csrf, groupurl) { // save the draft when leaving the page. $(window).on('beforeunload', function () { modUnloading = true; modSaveDraft(id, draftid, groupurl, csrf, true); }); // save the draft 1 second after a change $('form input, form textarea').on('input propertychange change', function () { modOnFormChange(id, draftid, groupurl, csrf); }); modUpdateAttachments(id, draftid, csrf, groupurl); if (typeof Capacitor !== 'undefined') { modInitDeviceUploader(id, draftid, csrf, groupurl); } else { modInitWebUploader(id, draftid, csrf, groupurl); } }, // InitReplyDraft creates a new draft, assumes a hidden form input called #draftidmid, and then calls initWindow(). InitReplyDraft: function ( id, bodytype, draftid, groupurl, csrf, handleAttachments, noFontChanges, isReply, isWiki, body, sig, onInitFunc ) { console.log('in InitReplyDraft draftid=' + draftid); modDeletedDraft = false; modDestroyedEditor = false; modUnloading = false; if (draftid == 0) { // create a new draft console.log('generating new draft' + groupurl); console.log('id=' + id); upload = { mid: id, csrf: csrf, body: sig }; $.ajax({ url: groupurl + '/reply', cache: false, method: 'POST', data: upload, xhrFields: { withCredentials: true }, dataType: 'json', error: function (xhr, ajaxOptions, thrownError) { if (modDeletedDraft == false && modDestroyedEditor == false) { createAlert("There was an error saving the draft. Please reload the page.", true, false) } } }).done(function (response) { console.log('reply draft created'); console.log('draftid:' + response.DraftID); draftid = response.DraftID; $('#draftid' + id).val(response.DraftID); editor.InitEditor( id, bodytype, draftid, groupurl, csrf, handleAttachments, noFontChanges, true, false, body, sig, onInitFunc ); editor.InitPostDraft(id, draftid, csrf, groupurl); console.log('id=' + id); $('#bodytype' + id).val(bodytype); $('#cancel-' + id).attr( 'onclick', 'editor.discardReplyDraft("' + id + '", "' + draftid + '","' + bodytype + '","' + csrf + '","' + groupurl + '");' ); return; }); return; } editor.InitEditor( id, bodytype, draftid, groupurl, csrf, handleAttachments, noFontChanges, true, false, body, sig, onInitFunc ); editor.InitPostDraft(id, draftid, csrf, groupurl); $('#bodytype' + id).val(bodytype); $('#cancel-' + id).attr( 'onclick', 'editor.discardReplyDraft("' + id + '", "' + draftid + '","' + bodytype + '","' + csrf + '","' + groupurl + '");' ); console.log('DONE'); }, // discardReplyDraft deletes the draft and any attachments and returns the user to the previous page. discardReplyDraft: function (id, draftid, bodytype, csrf, groupurl) { console.log('editor delete reply draft'); upload = { draftid: draftid, csrf: csrf, jsondelete: '1' }; $.ajax({ url: groupurl + '/draftop', cache: false, data: upload, method: 'POST', xhrFields: { withCredentials: true }, dataType: 'json' }).done(function (response) { // Do something with the request console.log("success delete reply draft"); $('#draftid' + id).val(''); if (bodytype == 'html') { tinymce.get('editor' + id).remove(); } $('#subject' + id).val($('#origsubject' + id).val()); $('#editor' + id).val(''); modDeletedDraft = true; modDestroyedEditor = true; }); }, PreviewMarkdown: function (id, groupurl) { let markdown = $('#editor' + id).val(); upload = { md: markdown }; $.ajax({ url: groupurl + '/previewmd', cache: false, data: upload, method: 'POST', xhrFields: { withCredentials: true }, dataType: 'json' }).done(function (response) { // Do something with the request console.log(response.markdown); wrap = '
' + response.markdown + '
'; $('#editwindow' + id).hide(); $('#previewWindow' + id).replaceWith(wrap); $('#previewWindow' + id).show(); }); $('#preview' + id).hide(); $('#return' + id).show(); }, ReturnMarkdown: function (id) { $('#preview' + id).show(); $('#return' + id).hide(); $('#previewWindow' + id).hide(); $('#editwindow' + id).show(); }, ClearTimeout: function() { clearTimeout(modTimeoutId); }, ShowMessageHistory: function( id, groupurl, bodytype, selectedText, sig, firstTime ) { console.log('URL ' + groupurl); console.log('ID ' + id); if (bodytype == 'html' && firstTime == false) { existingmsg = tinyMCE.get('editor' + id).getContent(); } else { existingmsg = $('#editor' + id).val(); } if (selectedText == '') { upload = { preview: bodytype, id: id }; } else { upload = { preview: bodytype, id: id, text: selectedText }; if (firstTime == true) { existingmsg = sig; } } $.ajax({ url: groupurl + '/previewmd', cache: false, data: upload, method: 'POST', xhrFields: { withCredentials: true }, dataType: 'json' }).done(function (response) { $('#editor' + id).val(response.reply + existingmsg); if (bodytype == 'html') { console.log('SETTING ' + response.reply + existingmsg); tinyMCE.get('editor' + id).setContent(response.reply + existingmsg); tinyMCE.get('editor' + id).selection.select(tinyMCE.get('editor' + id).getBody(), true); tinyMCE.get('editor' + id).selection.collapse(false); console.log('DONE'); } }); $('#editor' + id).focus(); } /* $('form').submit(function(e) { clearTimeout(modTimeoutId); if (postVar != null) { postVar.abort(); } console.log("SETTING DELETED TO TRUE"); console.log("EVENT:", e); modDeletedDraft = true; if ($(this).hasClass('form-submitted')) { e.preventDefault(); return; } $(this).addClass('form-submitted'); }); */ };}());async function uploadAttachments(doctype, id, draftid, groupurl, csrf) { const result = await Capacitor.Plugins.FilePicker.pickFiles(); const file = result.files[0]; console.log("in uploadAttachments"); console.log("files:", result.files); console.log("mimeType:", file.mimeType); console.log("name:", file.name); console.log("doctype:", doctype);const b64toBlob = (base64, type = 'image/jpeg') => fetch(`data:${type};base64,${base64}`).then(res => res.blob());const result2 = await Capacitor.Plugins.Filesystem.readFile({path:file.path})console.log("result2: ", result2);const blob = await b64toBlob(result2.data, file.mimeType);console.log("in uploadAttachments 2, " + file.mimeType); uploadImage(doctype, id, draftid, groupurl, csrf, blob, file.name);}async function takePicture2(doctype, id, draftid, groupurl, csrf) { console.log("in takePicture2"); try { const image = await Capacitor.Plugins.Camera.getPhoto({ quality: 90, allowEditing: false, resultType: "uri" }); console.log("got image");const b64toBlob = (base64, type = 'image/jpeg') => fetch(`data:${type};base64,${base64}`).then(res => res.blob());const result = await Capacitor.Plugins.Filesystem.readFile({path:image.path})const blob = await b64toBlob(result.data);console.log("path: ", image.path); uploadImage(doctype, id, draftid, groupurl, csrf, blob, image.path.split("/").pop()); } catch (err) { console.log("catch err 1: ", err); }}async function uploadImage(doctype, id, draftid, groupurl, csrf, raw, name) { console.log("here0"); const controller = new AbortController(); const formData = new FormData(); console.log("here1"); formData.append("csrf", csrf); formData.append("draftid", draftid); formData.append("upload", "1"); if (doctype === "pictures") { formData.append("inline", "1"); } console.log("FORMDATA:", formData); formData.append("fileupload", raw, name); console.log("here3"); const myRequest = new Request(groupurl + '/draftop', { method: 'POST', credentials: 'include', body: formData, signal: controller.signal, mode: 'cors' }); console.log("uploading"); try { const response = await fetch(myRequest); const result = await response.json(); if (doctype === "pictures") { console.log("picture processing"); for (let i = result.length - 1; i >= 0; i--) { console.log("Processing: ", i); const fileurl = result[i]; console.log('FILE: ' + result[i]); console.log('URL: ' + fileurl); const imghtml = ''; console.log('imghtml: ' + imghtml); tinymce.activeEditor.insertContent(imghtml); } } else { console.log("attachment processing"); updateAttachments(id, draftid, csrf, groupurl); console.log("attachment processing done"); } } catch (error) { console.error('Error:', error); }}
- RSpec-Astronomy | Main
- Topics
Search
DateDate1 - 13 of 13
USING A COLOUR CAMERA BINNED
Steve Haythornthwaite
#12899 Hello. I have only just started out with spectroscopy so forgive this if it's a noobish question. I have managed a few spectre so far and have been pleased with my results but there is room for improvement. As the title says I have a OS colour camera but with relatively small pixels (2.4) and large chip (5,500 width), binning would seem a better way of producing a decent image. It is the ZWO 183mc pro. I can't really afford a b&w camera just now so that is why I am thinking binning is ok for now. Now I know the different colours respond differently, so this can lead to unevenness in spectra results, so will binning take this unevenness out of the resulting spectra, or is there another way of making the use of OSC camera more effective until I can afford to shell out for a B&W one? cheers in advance. steve |
R L
#12900 Hi Steve, As you know I have been looking at your images and the problem is decoding of the Bayer pattern. The mono fits files you are using still have the Bayer pattern and although stacking them helps a bit due to the movement between images, the noise from the Bayer pattern is still there and I don't think binning will help. I am not experienced with colour cameras but it should be possible to decode the raw fits images correctly to give good smooth mono images without the Bayer pattern showing. Perhaps someone with good experience with colour cameras knows how this is best done with your camera ? Cheers |
pete@petersonengineering.com
#12901 Hi Steve, I'm also new to spectroscopy, having just acquired the Star Analyzer 100 and 200 about 6 weeks ago. Have been learning with the 100 grating at 90mm offset on an ASI 2600MC-P, which in turn has been mounted to my 14" Meade and a 102mm f/7 Explore Scientific triplet. To achieve minimum FWHM I've been running with 2X binning on both the refractor and the 14". And 2X seems to work. Due to the 90mm spacing the "C" chip's frame is set to about 1/4 size. I've not posted before as there seem to be answers to all of my questions somewhere in the forum archives. But, germane to your question, I've not been able to understand whether binning to achieve a lower FWHM improves resolution, or whether resolution is strictly dependent upon the actual size of light beam passing through the grating - in which case the FWHM is simply a way to optimize resolution on any given setup. Setting up a camera response curve should mitigate the RGB somewhat. And the experienced folks on this site post repeatedly about not shooting for perfection, but to simply enjoy the experience. I'm not working at this quite as hard as when I started out. And being relaxed is certainly better. Pete |
Steve Haythornthwaite
#12902 Thanks for the reply Pete, your response is quite reassuring. The other day I shot 2 A stars in one frame and then after got an M3iii star. After correctly getting one of the A star H lines in Rspec, I managed to get all the other stars absorption lines identified using the one step process and I have to say, the buzz I got from that was amazing and so yes, I did enjoy that experience. I do however like the idea of being able to improve my results as long as it doesn't become a chore. When things become a chore, they have the habit of sucking the fun out of them. I have placed a query in the SGL forums to see if I can discover anything about my query inline with the points @RL have raised above. |
Gary Hawkins
#12904 I have not done much spectroscopy with my 200-line grating, but I use a color camera extensively for photometry. My camera is a ZWO ASI533MC. With no binning, I get a 3008x3008 image with an RGGB pattern. If I do 2x2 binning I get a 1504 x 1504 image, with twice the effective pixel size with an RGGB pattern. The resolution is halved. It is possible to make a synthetic mono image using a program like AIJ or ASTAP. Again with no binning, either program will take the raw 3008 x 3008 color image and create a mono FITs file at 1504 x 1504 and twice the effectivel pixel size. The flux assigned to each mono pixel is B + R + (G1+G2)/2. Hope that helps, Gary |
Steve Haythornthwaite
#12905 Thank you Pete, that sounds like the kind of thing I am looking at exploring. I shall have a look. You don't happen to have a link to the program websites do you? |
Steve Haythornthwaite
#12906 Found ASTAP. It is also a stacking programme which seems similar to DSS. I shall have to have a good read through it as there is a lot to go through but hopefully I can have a decent bash at getting something that is an improvement, cheers. |
quantOnaut
#12907 Hi guys, found your discussion about stacking software available on the web, I started astrophotography in 2019 and here a list with free software that I found but yes ASTAP is really a very handy software to get familiar with astrometry, algorithms and stacking techniques https://github.com/Rolf-Hempel/PlanetarySystemStacker https://sites.google.com/view/sequator/ ——- |
Gary Hawkins
#12908 You can add SharpCap and ASTAP to that list. Both are excellent programs and do a lot of other things. |
Steve Haythornthwaite
#12909 I have got ASTAP but although I have heard you can use it to equalise the RGB pattern/give them the same mean value (for want of a better description) whilst as a mono FITS, I cannot figure out how to do it. I have seen a post in SGL which says as much, also heard other reference to the same but I am stuck.Siril - convert RGB to grey scale? - Discussions - Software - Stargazers Lounge regards Steve |
quantOnaut
#12910 using python or openCV is one solution to have a quick conversion of a image.. —————————————————— from astropy.io import fits import numpy as np # Open the FITS file hdulist = fits.open('rgb_image.fits') # Extract the data from each color channel red_channel = hdulist[0].data green_channel = hdulist[1].data blue_channel = hdulist[2].data # Compute the luminosity of each pixel luminosity = 0.2126 * red_channel + 0.7152 * green_channel + 0.0722 * blue_channel # Combine the luminosity values into a 2D greyscale image greyscale_image = np.mean(luminosity, axis=2) # Save the greyscale image to a new FITS file fits.writeto('greyscale_image.fits', greyscale_image, hdulist[0].header, overwrite=True) # Close the original FITS file hdulist.close() ——————————— Note that in this example, we used the standard formula for computing luminosity weights, which is commonly used in digital image processing. You can adjust the weights according to your specific needs and preferences. toggle quoted messageShow quoted text On Mon, 24 Apr 2023 at 16:35, mmylongname via groups.io <mmylongname=aol.com@groups.io> wrote: I have got ASTAP but although I have heard you can use it to equalise the RGB pattern/give them the same mean value (for want of a better description) whilst as a mono FITS, I cannot figure out how to do it. |
Steve Haythornthwaite
#12911 I would like to thank you for that but having had a quick read through this page,Installation — Astropy v5.2.3.dev0+g32d49b960.d20230411 I am lost already. I am not a pc dullard but script based stuff like this is all greek to me! I will have another look later but I am not confident in my abilities to be able to manage cheers |
quantOnaut
#12912 Sorry Steve yes its sometimes a bit of a struggle with all python versions and OS available, the abovescript may not work, you have the good manual which i also studied long time ago, chatGPT also helpssometimes correcting and writing code, for me it was real fun to experiment with processing technique in terminal by executing code snippets and receiving starless imagesor converted channels, having a Linux distro for doing experiments on astrophotography is a must for me, the freedom to download software is awesome, following code I have been tested as working on python3.10, with PixInsight i have debayered a fits from 294MC and saved as rgb.fits 140MB size with the python script I received a gray_luminosity.fits with 46.8MB ---------------------------------------- from astropy.io import fits # Open the RGB FITS file # Extract the color channels # Convert RGB to grayscale using the luminosity method # Save the grayscale image to a new FITS file toggle quoted messageShow quoted text On Mon, 24 Apr 2023 at 16:58, quantOnaut via groups.io <heiko.sterner=gmail.com@groups.io> wrote:
|
1 - 13 of 13 |
|
Previous TopicNext Topic