Author Topic: Calibration and align batch operations  (Read 133524 times)

Offline kwiechen

  • PixInsight Addict
  • ***
  • Posts: 186
    • View Profile
Re: Calibration and align batch operations
« Reply #30 on: 2012 January 19 12:44:43 »
Max,

I have never thought about east and west side when aligning the light frames because StarAlignment works perfectly if I mix everything. Next, I will clean up the code of v0.0.7b and try to remove this limit from the calibration and alignment part.

@Rotator angle: if I understand this correctly you would like to make flat/light subgroups for a fixed angle value (in addition to the filter subgroups)?

Best,

Kai




Offline mmirot

  • PixInsight Padawan
  • ****
  • Posts: 881
    • View Profile
Re: Calibration and align batch operations
« Reply #31 on: 2012 January 19 14:30:47 »
You understand correctly the rotation angle is moved 180 on either side of the meridian after the flip.  I need to calibrate with the flat where the rotation angle and filter is the same as the light.

Max

Offline Mike Reid

  • Newcomer
  • Posts: 47
    • View Profile
    • Mike's Astro
Re: Calibration and align batch operations
« Reply #32 on: 2012 January 26 09:44:26 »
Excellent work Kai!

I have a couple of minor issues with 007b to report.

1) In getMasterDarkFrame the delta is seeded with 1000 seconds.  I tested the first time with Ha data that had 1800 second exposure time and I had 1800 second darks.  I had no short darks to match the flats so nexptime never got set tnio anything other than it's initialed value of 0 and I got a crash.  I hacked mine by increasing the initial delta to 2000 but you might want to add a check here.

2) On line 468 I had to change,
    masterFlatPath = engine.getMasterFlatFrame(binnning, info.filter);
to
    masterFlatPath = engine.getMasterFlatFrame(binnning, trim(info.filter));
because info.filter was something like '    Ha'.


Thanks,
Mike

Offline kwiechen

  • PixInsight Addict
  • ***
  • Posts: 186
    • View Profile
Re: Calibration and align batch operations
« Reply #33 on: 2012 January 26 12:10:08 »
Mike,

thank you for testing this! Currently I try to clean up the code and I will try to resolve these issues.

Kai


Offline mmirot

  • PixInsight Padawan
  • ****
  • Posts: 881
    • View Profile
Re: Calibration and align batch operations
« Reply #34 on: 2012 January 26 16:47:20 »
If understand correctly the script dark subtracts flats using scaling. I recommend an option to bias subtract the flats. Often the darks noise is so low with short exposures on the flats the bias works better. Too much error in the scaled dark.

Max

Offline Mike Reid

  • Newcomer
  • Posts: 47
    • View Profile
    • Mike's Astro
Re: Calibration and align batch operations
« Reply #35 on: 2012 January 27 15:05:07 »
Max,

Yes, you do understand correctly.  I think, rather than adding another option, it would be good to simply treat the master bias as a 0 second master dark.  This way Kai's algorithm that looks for the closest dark in exposure time to the flat would pick the master bias in this case.  He currently finds the dark master with the smallest absolute value difference in exposure time from the exposure time of the flat.  So if the case of my 9.8 second flat the master bias would be chosen in preference to the 1800 second master dark.

Mike

Offline kwiechen

  • PixInsight Addict
  • ***
  • Posts: 186
    • View Profile
Re: Calibration and align batch operations
« Reply #36 on: 2012 January 29 02:56:13 »
Dark scaling is enabled by default in the script. If there is no significant dark current in very short exposed flats, the ImageCalibration module
warns about no convergence in noise evalulation and (if I have understood this correctly) no dark is subtracted. But if there is no sigificant dark current in the flat I tend to ignore this.
I think it is not correct to use a bias for dark subtration as the bias will be subtracted twice.

Kai




Offline mmirot

  • PixInsight Padawan
  • ****
  • Posts: 881
    • View Profile
Re: Calibration and align batch operations
« Reply #37 on: 2012 January 29 05:10:17 »
If the script defaults to a bias subtraction when there is no convergence that sound fine.

Juan,

What do you think?

Max

Offline Mike Reid

  • Newcomer
  • Posts: 47
    • View Profile
    • Mike's Astro
Re: Calibration and align batch operations
« Reply #38 on: 2012 January 29 14:47:56 »
I think it is not correct to use a bias for dark subtration as the bias will be subtracted twice.

Well, not exactly.  The difference is that the bias that is used as a short dark would be scaled to match the flat before subtraction where the "real"  bias is simply subtracted.

I don't actually care which of these solutions is implemented.  In my version of the code I changed the max delta to 2000 instead of 1000 and now the script doesn't crash but it's scaling a 30 minute dark frame to do dark subtraction of a 9.8 second flat.  Maybe it would be better to just not do dark subtraction of the flats if the difference between the exposure time of the flat and the nearest dark is too great.

Mike


Offline mmirot

  • PixInsight Padawan
  • ****
  • Posts: 881
    • View Profile
Re: Calibration and align batch operations
« Reply #39 on: 2012 February 02 17:56:50 »
Please post your code Mike

Max

Offline Mike Reid

  • Newcomer
  • Posts: 47
    • View Profile
    • Mike's Astro
Re: Calibration and align batch operations
« Reply #40 on: 2012 February 02 20:08:33 »
Max,

I'd rather not post a copy of Kai's script.  But the two bug fixes I made were simple.  Referring to version 007b.  These are the changes to CalibrateAlign-007b.js,

1. Change line 199 from,
              var delta1 = 1000;
      to
              var delta1 = 2000;

2. Change line  468 from,
              masterFlatPath = engine.getMasterFlatFrame(binnning, info.filter);
    to
              masterFlatPath = engine.getMasterFlatFrame(binnning, trim(info.filter));

Any other changes that I have made were just to experiment with my own ideas for enhancements.  If any of these pan out I'll forward them to Kai for his consideration.

Thanks,
Mike

Offline troypiggo

  • PixInsight Addict
  • ***
  • Posts: 257
    • View Profile
Re: Calibration and align batch operations
« Reply #41 on: 2012 February 02 23:37:56 »
I'm having some trouble with this script on OSX 64 bit.  Script version 007b.

My FITS files are captured in MaxIm.  When I use this script to "add files" I select the files, but they don't appear in the script's window.  Doesn't matter if they're the bias, light or whatever.  Just can't seem to add them.

Looking in the process console window there are warnings  about line 120: reference to undefined property info.imagetype and TypeError: info.imagetype is undefined.

EDIT: I notice that the master bias file I had previously created in PI does not have an ImageTyp header, but the individual bias frames captured in MaxIm do.  Not sure how/why I'm getting the error when trying to add masters, though.

EDIT 2: I tried it again, and it seems that it will add the subs ok.  Only seems to break if trying the masters option.
« Last Edit: 2012 February 02 23:53:59 by troypiggo »

Offline Josh Lake

  • PixInsight Old Hand
  • ****
  • Posts: 424
    • View Profile
Re: Calibration and align batch operations
« Reply #42 on: 2012 February 03 05:28:20 »
Yes, I've had some issues in both versions on Mac OSX (Lion). I'm unable to open files! The error reads:

*** Error [222]:(path) /CalibrateAlign-007b.js, line 120: TypeError: info.imagetype is undefined

Offline Jack Harvey

  • PTeam Member
  • PixInsight Padawan
  • ****
  • Posts: 975
    • View Profile
    • PegasusAstronomy.com & Starshadows.com
Re: Calibration and align batch operations
« Reply #43 on: 2012 February 03 07:55:31 »
FWIW, I am running ver 006d on my Mac 64 without any problems.
Jack Harvey, PTeam Member
Team Leader, SSRO/PROMPT Imaging Team, CTIO

Offline Josh Lake

  • PixInsight Old Hand
  • ****
  • Posts: 424
    • View Profile
Re: Calibration and align batch operations
« Reply #44 on: 2012 February 03 20:46:52 »
It's worth something, Jack!  :D

I tried 006d on Mac 32 and got this error when choosing a Bias:

Processing script file: (path)/CalibrateAlign-006d.js
*** Error [222]: (path)/CalibrateAlign-006d.js, line 350: TypeError: engine.FrameSets[0][parseInt(info.binning) - 1] is undefined


I'll try 64 next.