diff --git a/geomagio/imagcdf/ImagCDFFactory.py b/geomagio/imagcdf/ImagCDFFactory.py index f25d0c2700bdde5ea02f3b6c042cf27274313382..fda30542c2147661ac81963eb3c5fbce1e3af734 100644 --- a/geomagio/imagcdf/ImagCDFFactory.py +++ b/geomagio/imagcdf/ImagCDFFactory.py @@ -51,8 +51,7 @@ class ImagCDFFactory(TimeseriesFactory): channels: List[str] = ("H", "D", "Z", "F"), type: DataType = "variation", interval: DataInterval = "minute", - urlTemplate="file://etc/imagcdf/{obs}_{dt}_{t}.cdf", - urlInterval: int = -1, + urlTemplate="file://{obs}_{dt}_{t}.cdf", inputFile: Optional[str] = None, output: Optional[str] = "iaga2002", ): @@ -74,7 +73,6 @@ class ImagCDFFactory(TimeseriesFactory): type=type, interval=interval, urlTemplate=urlTemplate, - urlInterval=urlInterval, ) self.inputFile = inputFile self.output = ( @@ -419,9 +417,10 @@ class ImagCDFFactory(TimeseriesFactory): nonstandard_times = None temperature_times = {} temperature_index = 1 - + channels = [] for trace in timeseries: channel = trace.stats.channel + channels.append(channel) times = [ (trace.stats.starttime + trace.stats.delta * i).datetime.replace( tzinfo=timezone.utc @@ -479,8 +478,8 @@ class ImagCDFFactory(TimeseriesFactory): last_times = [] self.isUniqueTimes = ( - len(time_vars) == 1 - ) # (true if is a single time stamp variable in the file) + len(channels) == 1 + ) # (If a single channel, then use specific naming i.e GeomagneticVectorTimes) for index, times in enumerate(time_vars.values()): if index > 0: self.isUniqueTimes = not np.array_equal(last_times, times) @@ -845,7 +844,7 @@ class ImagCDFFactory(TimeseriesFactory): base_path = self.urlTemplate[7:] if not base_path or base_path == "{obs}_{dt}_{t}.cdf": base_path = os.getcwd() # Default to current working directory - return os.path.join(base_path, "etc", "imagcdf", filename) + return os.path.join(base_path,filename) return os.path.join(self.urlTemplate, filename) # Unsupported URL scheme