function SpdfLocationFilterOptions::init, $
allFilters = allFilters, $
distanceFromCenterOfEarth = distanceFromCenterOfEarth, $
magneticFieldStrength = magneticFieldStrength, $
distanceFromNeutralSheet = distanceFromNeutralSheet, $
distanceFromBowShock = distanceFromBowShock, $
distanceFromMagnetopause = distanceFromMagnetopause, $
dipoleLValue = dipoleLValue, $
dipoleInvariantLatitude = dipoleInvariantLatitude
compile_opt idl2
if keyword_set(allFilters) then begin
self.allFilters = 1b
endif else begin
self.allFilters = 0b
endelse
if keyword_set(distanceFromCenterOfEarth) then begin
self.distanceFromCenterOfEarth = $
ptr_new(distanceFromCenterOfEarth)
endif
if keyword_set(magneticFieldStrength) then begin
self.magneticFieldStrength = $
ptr_new(magneticFieldStrength)
endif
if keyword_set(distanceFromNeutralSheet) then begin
self.distanceFromNeutralSheet = $
ptr_new(distanceFromNeutralSheet)
endif
if keyword_set(distanceFromBowShock) then begin
self.distanceFromBowShock = $
ptr_new(distanceFromBowShock)
endif
if keyword_set(distanceFromMagnetopause) then begin
self.distanceFromMagnetopause = $
ptr_new(distanceFromMagnetopause)
endif
if keyword_set(dipoleLValue) then begin
self.dipoleLValue = $
ptr_new(dipoleLValue)
endif
if keyword_set(dipoleInvariantLatitude) then begin
self.dipoleInvariantLatitude = $
ptr_new(dipoleInvariantLatitude)
endif
return, self
end
pro SpdfLocationFilterOptions::cleanup
compile_opt idl2
if ptr_valid(self.distanceFromCenterOfEarth) then begin
ptr_free, self.distanceFromCenterOfEarth
endif
if obj_valid(self.magneticFieldStrength) then begin
obj_destroy, self.magneticFieldStrength
endif
if obj_valid(self.distanceFromNeutralSheet) then begin
obj_destroy, self.distanceFromNeutralSheet
endif
if obj_valid(self.distanceFromBowShock) then begin
obj_destroy, self.distanceFromBowShock
endif
if ptr_valid(self.distanceFromMagnetopause) then begin
ptr_free, self.distanceFromMagnetopause
endif
if ptr_valid(self.dipoleLValue) then begin
ptr_free, self.dipoleLValue
endif
if ptr_valid(self.dipoleInvariantLatitude) then begin
ptr_free, self.dipoleInvariantLatitude
endif
end
function SpdfLocationFilterOptions::getAllFilters
compile_opt idl2
return, self.allFilters
end
function SpdfLocationFilterOptions::getDistanceFromCenterOfEarth
compile_opt idl2
if obj_valid(self.distanceFromCenterOfEarth) then begin
return, self.distanceFromCenterOfEarth
endif else begin
return, obj_new()
endelse
end
function SpdfLocationFilterOptions::getMagneticFieldStrength
compile_opt idl2
if obj_valid(self.magneticFieldStrength) then begin
return, self.magneticFieldStrength
endif else begin
return, obj_new()
endelse
end
function SpdfLocationFilterOptions::getDistanceFromNeutralSheet
compile_opt idl2
if obj_valid(self.distanceFromNeutralSheet) then begin
return, self.distanceFromNeutralSheet
endif else begin
return, obj_new()
endelse
end
function SpdfLocationFilterOptions::getDistanceFromBowShock
compile_opt idl2
if obj_valid(self.distanceFromBowShock) then begin
return, self.distanceFromBowShock
endif else begin
return, obj_new()
endelse
end
function SpdfLocationFilterOptions::getDistanceFromMagnetopause
compile_opt idl2
if obj_valid(self.distanceFromMagnetopause) then begin
return, self.distanceFromMagnetopause
endif else begin
return, obj_new()
endelse
end
function SpdfLocationFilterOptions::getDipoleLValue
compile_opt idl2
if obj_valid(self.dipoleLValue) then begin
return, self.dipoleLValue
endif else begin
return, obj_new()
endelse
end
function SpdfLocationFilterOptions::getDipoleInvariantLatitude
compile_opt idl2
if obj_valid(self.dipoleInvariantLatitude) then begin
return, self.dipoleInvariantLatitude
endif else begin
return, obj_new()
endelse
end
function SpdfLocationFilterOptions::createDomElement, $
doc
compile_opt idl2
locationFilterOptionsElement = $
doc->createElement('LocationFilterOptions')
allFiltersElement = doc->createElement('AllFilters')
ovoid = outputOptionsElement->appendChild(allFiltersElement)
if self.allFilters eq 1b then begin
allFiltersText = 'true'
endif else begin
allFiltersText = 'false'
endelse
allFilterNode = doc->createTextNode(allFiltersText)
ovoid = allLocationFiltersElement->appendChild( $
allFilterNode)
if obj_valid(self.distanceFromCenterOfEarth) then begin
distanceFromCenterOfEarthElement = $
self.distanceFromCenterOfEarth->createDomElement(doc)
ovoid = locationFilterOptionsElement->appendChild( $
distanceFromCenterOfEarthElement)
endif
if obj_valid(self.magneticFieldStrength) then begin
magneticFieldStrengthElement = $
self.magneticFieldStrength->createDomElement(doc)
ovoid = locationFilterOptionsElement->appendChild( $
magneticFieldStrengthElement)
endif
if obj_valid(self.distanceFromNeutralSheet) then begin
distanceFromNeutralSheetElement = $
self.distanceFromCenterOfEarth->createDomElement(doc)
ovoid = locationFilterOptionsElement->appendChild( $
distanceFromNeutralSheetElement)
endif
if obj_valid(self.distanceFromBowShock) then begin
distanceFromBowShockElement = $
self.distanceFromBowShock->createDomElement(doc)
ovoid = locationFilterOptionsElement->appendChild( $
distanceFromBowShockElement)
endif
if obj_valid(self.distanceFromMagnetopause) then begin
distanceFromMagnetopauseElement = $
self.distanceFromMagnetopause->createDomElement(doc)
ovoid = locationFilterOptionsElement->appendChild( $
distanceFromMagnetopauseElement)
endif
if obj_valid(self.dipoleLValue) then begin
dipoleLValueElement = $
self.dipoleLValue->createDomElement(doc)
ovoid = locationFilterOptionsElement->appendChild( $
dipoleLValueElement)
endif
if obj_valid(self.dipoleInvariantLatitude) then begin
dipoleInvariantLatitudeElement = $
self.dipoleInvariantLatitude->createDomElement(doc)
ovoid = locationFilterOptionsElement->appendChild( $
dipoleInvariantLatitudeElement)
endif
return, locationFilterOptionsElement
end
pro SpdfLocationFilterOptions__define
compile_opt idl2
struct = { SpdfLocationFilterOptions, $
allFilters:1b, $
distanceFromCenterOfEarth:ptr_new(), $
magneticFieldStrength:obj_new(), $
distanceFromNeutralSheet:obj_new(), $
distanceFromBowShock:obj_new(), $
distanceFromMagnetopause:ptr_new(), $
dipoleLValue:ptr_new(), $
dipoleInvariantLatitude:ptr_new() $
}
end