GithubHelp home page GithubHelp logo

mbobra / sharps Goto Github PK

View Code? Open in Web Editor NEW
38.0 38.0 24.0 47.92 MB

The SHARP data includes images of active regions, together with metadata keywords that describe their characteristics, taken by the NASA Solar Dynamics Observatory

License: MIT License

Python 0.84% Jupyter Notebook 99.16%

sharps's People

Contributors

mbobra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sharps's Issues

Disambiguation Code

Hi Monica,

In the Python version of the disambiguation code, the following lines perform the disambiguation

disambig[1].data = (disambig[1].data / (np.power(2, self.method))).astype('uint8')
disambig[1].data = disambig[1].data*180.
azimuth[1].data = disambig[1].data + azimuth[1].data

I understand the first line, but are the second and third lines equivalent to the IDL code (https://www.heliodocs.com/xdoc/xdoc_print.php?file=$SSW/sdo/hmi/idl/hmi_disambig.pro), or am I missing a reason why these are different?

; Perform disambiguation
disambig = disambig / (2 ^ method)		; Move the corresponding bit to the lowest
index = where(disambig mod 2 ne 0, num)
if (num ne 0) then azimuth[index] = azimuth[index] + 180.

the original IDL code is reproduced as follows:

[Download](https://www.heliodocs.com/xdoc/xdoc_download.php?file=$SSW/sdo/hmi/idl/hmi_disambig.pro)
;+
; NAME:
;   hmi_disambig
; PURPOSE:
;	Combine HMI disambiguation result with azimuth
;	For details, see Section 5
;	Hoeksema et al., 2014, SoPh, online (doi:10.1007/s11207-014-0516-8)
; SAMPLE CALLS:
;	IDL> file_azi = 'hmi.B_720s.20110215_000000_TAI.azimuth.fits'
;	IDL> file_ambig = 'hmi.B_720s.20110215_000000_TAI.disambig.fits'
;	IDL> read_sdo, file_azi, index, azi
;	IDL> read_sdo, file_ambig, index, ambig
;	IDL> hmi_disambig, azi, ambig, 2
; INPUT:
;	azimuth:	azimuth image, with values between 0 and 180.
;	disambig:	bit mask with the same size as azimuth
;				bit 1 indicates the azimuth needs to be flipped (plus 180)
;				For full disk, three bits are set, giving three disambiguation
;				solutions from different methods. Note the strong field pixels
;				have the same solution (000 or 111, that is, 0 or 7) from the 
;				annealing method. The weak field regions differ 
;				lowest: potential field acute
;				middle: radial acute (default)
;				highest: random
; OPTIONAL INPUT:
;	method:		integer from 0 to 2 indicating the bit used.
;				0 for potential acute, 1 for random, 2 for radial acute (default)
;				Out-of-range values are ignored and set to 2
; OUTPUT:
;	azimuth:	modified azimuth image, with values between 0 and 360	
; HISTORY:
;   2014.05.13 - Xudong Sun ([email protected])
;	2016.05.06 -
;			fixed a bug. Originally optional method=method changed to mandatory
;			b.c. if user wanted method=0, keyword_set(method)=0: was considered as
;			keyword NOT set, then it automatically used method=2.
; NOTE:
;	Written for HMI data. Minimal check implemented so far
;	Note SHARP data are already disambiguated
;	
;-

pro hmi_disambig, azimuth, disambig, method

; Check dimensions only
; No further WCS check implemented

sz = size(azimuth) & nx = sz[1] & ny = sz[2]
sz1 = size(disambig) & nx1 = sz1[1] & ny1 = sz1[2]
if (nx ne nx1 or ny ne ny1) then begin
	print, 'Dimension of two images don not agree'
	return
endif

disambig = fix(disambig)

; Check method

if (method lt 0 or method gt 2) then begin
	method = 2
	print, 'Invalid disambiguation method, set to default method = 2'
endif

; Perform disambiguation

disambig = disambig / (2 ^ method)		; Move the corresponding bit to the lowest
index = where(disambig mod 2 ne 0, num)

if (num ne 0) then azimuth[index] = azimuth[index] + 180.

;

return


end

Extracting solar flare classes

Hi,

I'm trying to replicate the dataset from https://iopscience.iop.org/article/10.1088/0004-637X/798/2/135#apj504998f1, which describes labelling solar flares in activity regions by using the X-ray flux peak magnitude. I can't seem to find the label or the feature describing the X-ray flux peak in the data exposed by the API. Is this feature available somewhere ?

From what I understand, the results from using the R_VALUE > 5.5 or TOTUSJH > 8900 as describe in your notebooks only gives X class flares right ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.