I'm working in getting a function to sunpy similar to function rot in IDL, what i really need to do is to organize and to implement it.
--
You received this message because you are subscribed to the Google Groups "SunPy" group.To post to this group, send email to su...@googlegroups.com.
To unsubscribe from this group, send email to sunpy+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/sunpy?hl=en.
That would be a helpful contribution. Perhaps it could go in the sunpy.image package? You could then add a convenience method in the Map class, etc. so that you can just do "aiamap.rotate(...)" similar to how the resample functionality is laid handled.Keith
I'm a little confused - do you mean rotating an image about a point, or do you mean calculating the rotation due to the differentially rotating Sun?
GoSA stands for Group of Solar Astrophysics... http://www.observatorio.unal.edu.co/gosa/GOSA/Home.html,
and my first attempt is rotating about a point, i'm going to try get a function to differential rotation.
Hi,
In the AIAPREP routine Keith sent me the other day there is multiple implementations of IDL rot.
Stuart
From a mountain in Scotland.
FUNCTION DIFF_ROT, ddays, latitude, howard=howard, allen=allen, $ synodic=synodic, sidereal=sidereal ;+ ; PROJECT: ; SOHO - CDS ; ; NAME: ; DIFF_ROT() ; ; PURPOSE: ; Computes the differential rotation of the sun ; ; EXPLANATION: ; ; CALLING SEQUENCE: ; Result = DIFF_ROT(ddays,latitude) ; ; INPUTS: ; DDAYS -- number of days to rotate ; LATITUDE -- latitude in DEGREES ; ; OPTIONAL INPUTS: ; None. ; ; OUTPUTS: ; Result -- Change in longitude over ddays days in DEGREES ; ; OPTIONAL OUTPUTS: ; None. ; ; KEYWORD PARAMETERS: ; ALLEN -- use values from Allen, Astrophysical Quantities (DEFAULT) ; HOWARD -- use values for small magnetic features from Howard et al. ; SIDEREAL -- use sidereal rotation rate (DEFAULT) ; SYNODIC -- use synodic rotation rate ; ; CALLS: ; None. ; ; COMMON BLOCKS: ; None. ; ; RESTRICTIONS: ; None. ; ; SIDE EFFECTS: ; None. ; ; CATEGORY: ; ; PREVIOUS HISTORY: ; Written T. Metcalf June 1992 ; ; MODIFICATION HISTORY: ; Version 1, Liyun Wang, GSFC/ARC, November 17, 1994 ; Incorporated into the CDS library ; Version 2, Zarro, GSFC, 1 July 1997 - made Howard the default ; Version 3, Zarro, GSFC, 19 Sept 1997 - corrected Howard coeff's ; ; VERSION: ; Version 2 ;- ; ON_ERROR, 2 sin2l = (SIN(FLOAT(latitude*!dtor)))^2 sin4l = sin2l*sin2l IF KEYWORD_SET(allen) THEN BEGIN ; Allen, Astrophysical Quantities rotation = ddays*(14.44-3.0*sin2l) ENDIF ELSE BEGIN ; Small magnetic features ; (Howard, Harvey, and Forgach, Solar Physics, 130, 295, 1990) rotation = 1.e-6*ddays*(2.894-0.428*sin2l-0.37*sin4l)*24.*3600./!dtor ENDELSE IF KEYWORD_SET(synodic) THEN BEGIN rotation = rotation-0.9856*ddays ENDIF RETURN, rotation END
#calculates days of rotation using date strings
#converts hpc coord to hg coord
#applies Howard, Harvey, and Forgach model for differential rotation as used in IDL rot_xy
#converts hg back into hpc
#updates and returns coordinate position
days = (sunpy.time.parse_time(date_end)-sunpy.time.parse_time(date_start)).days
print date_start, date_end
print days
longd,latt = sunpy.wcs.wcs.convert_hpc_hg(x,y)
sin2l = (math.sin(math.radians(float(longd))))**2
sin4l = sin2l*sin2l
rott_longd = (1e-6)*days*(2.894-0.428*sin2l-0.37*sin4l)*24*3600/0.0174532925
nposx,nposy = sunpy.wcs.wcs.convert_hg_hpc(rott_longd,latt)
nposx = nposx+x
return nposx
To unsubscribe from this group and stop receiving emails from it, send an email to sunpy+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/sunpy.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to a topic in the Google Groups "SunPy" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sunpy/k_Z59_N9cU4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sunpy+un...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "SunPy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sunpy+un...@googlegroups.com.
To post to this group, send email to su...@googlegroups.com.
Visit this group at http://groups.google.com/group/sunpy.
For more options, visit https://groups.google.com/d/optout.
I am trying to run the differential rotation of Sun in MATLAB(something similar to rot_xy in IDL). I am not sure on how to sent the arguments to the function and implement it. Has anyone worked on this or something similar before.
--
You received this message because you are subscribed to a topic in the Google Groups "SunPy" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sunpy/k_Z59_N9cU4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sunpy+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/sunpy.