-
-
Notifications
You must be signed in to change notification settings - Fork 573
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
Conversation
@@ -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 |
There was a problem hiding this comment.
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:
@@ -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 |
There was a problem hiding this comment.
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.
@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 |
There was a problem hiding this comment.
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 __
.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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:
@dpshelio ,could you please tell I fail to understand why Travis build fails, |
Missing Data handled for EVE LightCurve object
Solved : #867 hopefully,
Capturing 'missing data' line EVE header ,and taking corresponding action