From 0776a25f2a5ec95455fbae6356ba9a896411a322 Mon Sep 17 00:00:00 2001 From: Rodrigo Luger Date: Fri, 8 Sep 2017 12:07:59 -0700 Subject: [PATCH] Make kplr work for K2 campaigns > 0 --- kplr/api.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/kplr/api.py b/kplr/api.py index ec4e70f..c71fe37 100644 --- a/kplr/api.py +++ b/kplr/api.py @@ -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,