diff --git a/geomagio/ImagCDFFactory.py b/geomagio/ImagCDFFactory.py
index 157ad0cf0546c7e804183978424de1600214ce0a..0acf6eceb9abe4345941a994422781e2461659db 100644
--- a/geomagio/ImagCDFFactory.py
+++ b/geomagio/ImagCDFFactory.py
@@ -129,12 +129,20 @@ class ImagCDFFactory(TimeseriesFactory):
     
     def write_file(self, fh, timeseries: Stream, channels: List[str]):
         # Create a temporary file to write the CDF data
-        with tempfile.NamedTemporaryFile(delete=False) as tmp_file:
-            tmp_file_path = tmp_file.name + ".cdf"
+        with tempfile.NamedTemporaryFile(delete=False, suffix='.cdf') as tmp_file:
+            tmp_file_path = tmp_file.name
 
         try:
             # Initialize the CDF writer
-            cdf_writer = cdflib.cdfwrite.CDF(tmp_file_path)
+            cdf_spec = {
+                'Compressed': 9,          # Enable compression (0-9)
+                # 'Majority': 'row_major',        # Data layout - gets set automatically
+                # 'Encoding': 'ibmpc',      # Corrupts CDF - gets set automatically
+                'Checksum': True,        # Disable checksum for faster writes (optional)
+                'rDim_sizes': [],         # Applicable only if using rVariables - CDF protocol recommends only using zVariables. 
+            }
+
+            cdf_writer = cdflib.cdfwrite.CDF(path=tmp_file_path, cdf_spec=cdf_spec, delete=True)
 
             # Write global attributes
             global_attrs = self._create_global_attributes(timeseries, channels)
@@ -206,7 +214,6 @@ class ImagCDFFactory(TimeseriesFactory):
             # Cleanup the temporary file
             os.remove(tmp_file_path)
 
-
     def put_timeseries(
         self,
         timeseries: Stream,
@@ -288,7 +295,7 @@ class ImagCDFFactory(TimeseriesFactory):
                         # Read existing data to merge with new data
                         existing_cdf = cdflib.cdfread.CDF(url_file)
                         existing_stream = self._read_cdf(existing_cdf)
-                        existing_cdf.close()
+                        # existing_cdf.close() #no close method?
                         existing_data = existing_stream
 
                         # Merge existing data with new data
@@ -480,7 +487,7 @@ class ImagCDFFactory(TimeseriesFactory):
         elif channel in TEMPERATURE_ELEMENTS_ID:
             units = 'Celsius'
             fieldnam = f"Temperature {temperature_index} {trace.stats.location}"
-            validmin = -273.15
+            validmin = -273.15 #absolute zero
             validmax = 79_999
         elif channel in ['F','S']:
             units = 'nT'