EranOfek / MAAT

37 stars 13 forks source link

Bugfix branch #8

Closed vancky closed 5 years ago

vancky commented 5 years ago

OK, I will do that. For the commit about astrometry.m. There are two major committees. First one, add the InPar.RefCatName. This was because when the external reference catalog was provided, then the if statement at line 238 will go to line 240. In this case, the InPar. RefCat is an ascot object, thus will crash on line 262 which the lower function regard RefCat as a string. So I add a field of RefCatName for external reference catalog use. The change is downward compatible.

vancky commented 5 years ago

For the next commit, about the WCS. The original code,
ResAst(Isim).WCS=OrigSim(Isim).WCS; In fact, for OriginSim with empty WCS in, this statement does nothing but give the empty WCS to ResAst(Isim). If the OrigSim has WCS, then the code doesn't update the new WCS to it. So I write the code and it works fine with me only with the problem that WCS in SIM is inherited from superclass WorldCooSys thus xy2coo for SIM call function in WorldCooSys, need to fix.

EranOfek commented 5 years ago

can you send me a specific example of how you are trying to run it? thanks eran

On Wed, Mar 20, 2019 at 3:36 PM vancky notifications@github.com wrote:

OK, I will do that. For the commit about astrometry.m. There are two major committees. First one, add the InPar.RefCatName. This was because when the external reference catalog was provided, then the if statement at line 238 will go to line 240. In this case, the InPar. RefCat is an ascot object, thus will crash on line 262 which the lower function regard RefCat as a string. So I add a field of RefCatName for external reference catalog use. The change is downward compatible.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/EranOfek/MAAT/pull/8#issuecomment-474831166, or mute the thread https://github.com/notifications/unsubscribe-auth/AFNIcQFDc252uefsvTzeYg3UJ_skD9U9ks5vYjlVgaJpZM4bp7OF .

EranOfek commented 5 years ago

done

On Wed, Mar 20, 2019 at 3:53 PM vancky notifications@github.com wrote:

For the next commit, about the WCS. The original code, ResAst(Isim).WCS=OrigSim(Isim).WCS; In fact, for OriginSim with empty WCS in, this statement does nothing but give the empty WCS to ResAst(Isim). If the OrigSim has WCS, then the code doesn't update the new WCS to it. So I write the code and it works fine with me only with the problem that WCS in SIM is inherited from superclass WorldCooSys thus xy2coo for SIM call function in WorldCooSys, need to fix.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/EranOfek/MAAT/pull/8#issuecomment-474838602, or mute the thread https://github.com/notifications/unsubscribe-auth/AFNIcQJ9HPcWMB9I-RUhJhV7RFLuI5OZks5vYj08gaJpZM4bp7OF .

vancky commented 5 years ago

can you send me a specific example of how you are trying to run it? thanks eran On Wed, Mar 20, 2019 at 3:36 PM vancky @.***> wrote: OK, I will do that. For the commit about astrometry.m. There are two major committees. First one, add the InPar.RefCatName. This was because when the external reference catalog was provided, then the if statement at line 238 will go to line 240. In this case, the InPar. RefCat is an ascot object, thus will crash on line 262 which the lower function regard RefCat as a string. So I add a field of RefCatName for external reference catalog use. The change is downward compatible. — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <#8 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AFNIcQFDc252uefsvTzeYg3UJ_skD9U9ks5vYjlVgaJpZM4bp7OF .

In fact, this bug is easy to see, if you provided the external catalog to astrometry.m. Sometime, even I use the gaia dr2 catalog, I want to correct the differential refraction about the catalog, and I have to do this outside the function of the astrometry.
RefCat=VO.search.cat_cone(InPar.RefCat,InPar.RA,InPar.DEC,10/60/180pi,'RadiusUnits','rad','OutType','astcat'); And pass the RefCat to astromery like this: [R,~]=astrometry(S,'Scale',0.286030078125,'RA',InPar.RA,'Dec',InPar.DEC,'UnitsRA','deg','UnitsDec','deg','MaxRefStars',500,'ImSize',size(S.Im),... 'Flip',[1 1],'CleanOverDense',false,'Plot',InPar.PlotRMS,'RCrad',10/60/180pi,'MatchRotMethod','xcrot','BlockSize',size(S.Im),'RefCat',RefCat,... 'RefCatName','gaiadr2','RC_ColMag',InPar.useBand);

The keypoint is the switch statement at line 258, switch lower(InPar.RefCat) when InPar.RefCat is a astcat object (thus provided by me), this call for lower function will crash.