atmo_sample.py 4.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. from sqlalchemy import Column, String, Float
  2. from sqlalchemy.dialects.postgresql import TEXT
  3. from app.database import Base
  4. class AtmoSampleData(Base):
  5. """
  6. 大气颗粒物采样点数据模型
  7. @param {str} id - 采样点ID(主键)
  8. @param {float} longitude - 经度坐标(精确到小数点后六位)
  9. @param {float} latitude - 纬度坐标(精确到小数点后六位)
  10. @param {str} sampling_location - 采样地点描述
  11. @param {str} start_time - 采样开始时间(精确到秒)
  12. @param {str} end_time - 采样结束时间(精确到秒)
  13. @param {str} cumulative_time - 累计采样时长
  14. @param {float} average_flow_rate - 平均流量(L/min)
  15. @param {float} cumulative_true_volume - 实况采样体积(L)
  16. @param {float} cumulative_standard_volume - 标准采样体积(L)
  17. @param {str} sample_type - 样品类型
  18. @param {str} sample_name - 样品名称
  19. @param {float} Cr_particulate - Cr含量(mg/kg)
  20. @param {float} As_particulate - As含量(mg/kg)
  21. @param {float} Cd_particulate - Cd含量(mg/kg)
  22. @param {float} Hg_particulate - Hg含量(mg/kg)
  23. @param {float} Pb_particulate - Pb含量(mg/kg)
  24. @param {float} particle_weight - 颗粒物重量(mg)
  25. @param {float} standard_volume - 标准体积(m³)
  26. @param {float} particle_concentration - 颗粒物浓度(μg/m³)
  27. @param {str} sample_code - 样品编码
  28. @param {float} temperature - 温度(℃)
  29. @param {float} pressure - 气压(kPa)
  30. @param {float} humidity - 湿度(%)
  31. @param {float} wind_speed - 风速(m/s)
  32. @param {str} wind_direction - 风向
  33. """
  34. __tablename__ = 'Atmo_sample_data'
  35. ID = Column('ID', String(50), primary_key=True, comment='采样点ID')
  36. longitude = Column('longitude', Float, nullable=True, comment='经度坐标(精确到小数点后六位)')
  37. latitude = Column('latitude', Float, nullable=True, comment='纬度坐标(精确到小数点后六位)')
  38. sampling_location = Column('sampling_location', String(500), nullable=True, comment='采样地点')
  39. # 时间信息
  40. start_time = Column('start_time', String(20), nullable=True, comment='采样开始时间(精确到秒)')
  41. end_time = Column('end_time', String(20), nullable=True, comment='采样结束时间(精确到秒)')
  42. cumulative_time = Column('cumulative_time', String(10), nullable=True, comment='累计采样时长')
  43. # 采样参数
  44. average_flow_rate = Column('average_flow_rate', Float, nullable=True, comment='平均流量(L/min)')
  45. cumulative_true_volume = Column('cumulative_true_volume', Float, nullable=True, comment='实况采样体积(L)')
  46. cumulative_standard_volume = Column('cumulative_standard_volume', Float, nullable=True, comment='标准采样体积(L)')
  47. # 样品信息
  48. sample_type = Column('sample_type', String(50), nullable=True, comment='样品类型')
  49. sample_name = Column('sample_name', String(50), nullable=True, comment='样品名称')
  50. # 重金属含量
  51. Cr_particulate = Column('Cr_particulate', Float, nullable=True, comment='Cr含量(mg/kg)')
  52. As_particulate = Column('As_particulate', Float, nullable=True, comment='As含量(mg/kg)')
  53. Cd_particulate = Column('Cd_particulate', Float, nullable=True, comment='Cd含量(mg/kg)')
  54. Hg_particulate = Column('Hg_particulate', Float, nullable=True, comment='Hg含量(mg/kg)')
  55. Pb_particulate = Column('Pb_particulate', Float, nullable=True, comment='Pb含量(mg/kg)')
  56. # 颗粒物物理参数
  57. particle_weight = Column('particle_weight', Float, nullable=True, comment='颗粒物重量(mg)')
  58. standard_volume = Column('standard_volume', Float, nullable=True, comment='标准体积(m³)')
  59. particle_concentration = Column('particle_concentration', Float, nullable=True, comment='颗粒物浓度(μg/m³)')
  60. # 其他环境参数
  61. sample_code = Column('sample_code', String(20), nullable=True, comment='样品编码')
  62. temperature = Column('temperature', Float, nullable=True, comment='温度(℃)')
  63. pressure = Column('pressure', Float, nullable=True, comment='气压(kPa)')
  64. humidity = Column('humidity', Float, nullable=True, comment='湿度(%)')
  65. wind_speed = Column('wind_speed', Float, nullable=True, comment='风速(m/s)')
  66. wind_direction = Column('wind_direction', String(20), nullable=True, comment='风向')