Skip to content
This repository has been archived by the owner on Feb 27, 2022. It is now read-only.

Make kplr work for K2 campaigns > 0 #25

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions kplr/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1038,15 +1038,12 @@ def filename(self):
def url(self):
"""
The remote URL for the data file on the MAST servers.

"""
if self.sci_campaign != 0:
raise NotImplementedError("Only campaign 0 is supported for now")
base_url = "http://archive.stsci.edu/pub/k2/"
if self.ktc_k2_id < 201000000:
base_url += "{0}/c0/200000000/{1:05d}/{2}"
base_url += "{0}/c%d/200000000/{1:05d}/{2}" % self.sci_campaign
else:
base_url += "{{0}}/c0/{0}/{{1:05d}}/{{2}}" \
base_url += ("{{0}}/c%d/{0}/{{1:05d}}/{{2}}" % self.sci_campaign) \
.format(int(int(self.ktc_k2_id * 1e-5) * 1e5))

return base_url.format(self.product,
Expand Down