Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Data handled for EVE LightCurve object #889

Merged
merged 6 commits into from
Mar 10, 2014
Merged

Conversation

gunner272
Copy link
Contributor

Solved : #867 hopefully,
Capturing 'missing data' line EVE header ,and taking corresponding action

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) when pulling ce004b6 on gunner272:mdata into 76ae390 on sunpy:master.

@@ -125,5 +129,8 @@ def _parse_level_0cs(fp):
parser = lambda x: datetime(year, month, day, int(x[0:2]), int(x[2:4]))

data = read_csv(fp, sep="\s*", names=fields, index_col=0, date_parser=parser, header = None)
if __chk == True : #If missing data specified in header
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the == True is superfluous. just use if __chk:

@dpshelio
Copy link
Member

dpshelio commented Mar 5, 2014

Can anyone with more experience in EVE (ping @wafels, @ehsteve) find whether the missing data value is always the same or it could change?

If it can change, then I would suggest to automatically extract such value from the header instead of hardcode it.

@@ -125,5 +129,8 @@ def _parse_level_0cs(fp):
parser = lambda x: datetime(year, month, day, int(x[0:2]), int(x[2:4]))

data = read_csv(fp, sep="\s*", names=fields, index_col=0, date_parser=parser, header = None)
if __chk == True : #If missing data specified in header
data[data == -1.00e+00] = numpy.nan
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The missing data value specification should not be hard coded in the unlikely case that it changes.

@gunner272
Copy link
Contributor Author

@ehsteve ,Is this correct

@@ -92,6 +93,8 @@ def _parse_average_csv(fp):
@staticmethod
def _parse_level_0cs(fp):
"""Parses and EVE Level 0CS file"""
__chk = False #boolean to check for missing data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You seem to like the __ vars :p

I would call this is_missing_data or something a little more descriptive than __chk. The same goes for __val I think missing_data_val would be better.

remember these variables are only defined in the scope of this function so they do not form part of the API and therefore do not need to be 'hidden' from the user by using _ or __.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation @Cadair ,you caught my intention right,I will try and keep the varaible names more descriptive.

@@ -125,5 +133,8 @@ def _parse_level_0cs(fp):
parser = lambda x: datetime(year, month, day, int(x[0:2]), int(x[2:4]))

data = read_csv(fp, sep="\s*", names=fields, index_col=0, date_parser=parser, header = None)
if is_missing_data == True : #If missing data specified in header
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True is redundant here. This could be written as:

if is_missing_data:

@gunner272
Copy link
Contributor Author

@dpshelio ,could you please tell I fail to understand why Travis build fails,

Cadair added a commit that referenced this pull request Mar 10, 2014
Missing Data handled for EVE LightCurve object
@Cadair Cadair merged commit 845c5df into sunpy:master Mar 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants